https://github.com/Bigcheese closed
https://github.com/llvm/llvm-project/pull/83641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) {
// Use the cached result, which may be nullptr.
Module = *MaybeModule;
+// Config macros are already checked before build
https://github.com/vsapsai approved this pull request.
https://github.com/llvm/llvm-project/pull/83641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/vsapsai edited
https://github.com/llvm/llvm-project/pull/83641
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Bigcheese updated
https://github.com/llvm/llvm-project/pull/83641
>From e8993b51f0dcdecd2fcb72f91d7e4631e95c2c09 Mon Sep 17 00:00:00 2001
From: Michael Spencer
Date: Fri, 1 Mar 2024 17:18:20 -0800
Subject: [PATCH] [clang] Diagnose config_macros before building modules
Before
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) {
// Use the cached result, which may be nullptr.
Module = *MaybeModule;
+// Config macros are already checked before build
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -1591,6 +1591,14 @@ static void checkConfigMacro(Preprocessor &PP, StringRef
ConfigMacro,
}
}
+static void checkConfigMacros(Preprocessor &PP, Module *M,
+ SourceLocation ImportLoc) {
+ clang::Module *TopModule = M->getTopLevelModule();
+ f
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) {
// Use the cached result, which may be nullptr.
Module = *MaybeModule;
+// Config macros are already checked before build
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -1,3 +1,39 @@
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: %clang_cc1 -std=c99 -fmodules -fimplicit-module-maps -x objective-c
-fmodules-cache-path=%t -DWANT_FOO=1 -emit-module -fmodule-name=config
%t/module.modulemap
+// RUN: %clang_cc1 -std=c99 -fmodules -fimplicit
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
@@ -2006,6 +2021,11 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
if (auto MaybeModule = MM.getCachedModuleLoad(*Path[0].first)) {
// Use the cached result, which may be nullptr.
Module = *MaybeModule;
+// Config macros are already checked before build
@@ -22,7 +58,10 @@
#define WANT_BAR 1 // expected-note{{macro was defined here}}
@import config; // expected-warning{{definition of configuration macro
'WANT_BAR' has no effect on the import of 'config'; pass '-DWANT_BAR=...' on
the command line to configure the module}}
-//
https://github.com/Bigcheese updated
https://github.com/llvm/llvm-project/pull/83641
>From c2445d426e374592522ac392254c9909ab52fc40 Mon Sep 17 00:00:00 2001
From: Michael Spencer
Date: Fri, 1 Mar 2024 17:18:20 -0800
Subject: [PATCH] [clang] Diagnose config_macros before building modules
Before
llvmbot wrote:
@llvm/pr-subscribers-clang-modules
Author: Michael Spencer (Bigcheese)
Changes
Before this patch, if a module fails to build because of a missing
config_macro, the user will never see the config macro warning. This patch
diagnoses this before building, and each subsequent
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Michael Spencer (Bigcheese)
Changes
Before this patch, if a module fails to build because of a missing
config_macro, the user will never see the config macro warning. This patch
diagnoses this before building, and each subsequent time a m
https://github.com/Bigcheese created
https://github.com/llvm/llvm-project/pull/83641
Before this patch, if a module fails to build because of a missing
config_macro, the user will never see the config macro warning. This patch
diagnoses this before building, and each subsequent time a module i
21 matches
Mail list logo