[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-05 Thread Michael Spencer via cfe-commits
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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via cfe-commits
@@ -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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via cfe-commits
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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via 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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via 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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread David Blaikie via cfe-commits
@@ -1591,6 +1591,14 @@ static void checkConfigMacro(Preprocessor , StringRef ConfigMacro, } } +static void checkConfigMacros(Preprocessor , Module *M, + SourceLocation ImportLoc) { + clang::Module *TopModule = M->getTopLevelModule(); + for

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Michael Spencer via cfe-commits
@@ -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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via cfe-commits
@@ -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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via cfe-commits
@@ -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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-04 Thread Volodymyr Sapsai via 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}}

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-01 Thread Michael Spencer via cfe-commits
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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-01 Thread via cfe-commits
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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-01 Thread via cfe-commits
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

[clang] [clang] Diagnose config_macros before building modules (PR #83641)

2024-03-01 Thread Michael Spencer via cfe-commits
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