[clang] [clang][Dependency Scanning] Canonicalize Defines of a Compiler Invocation As Early As Possible (PR #159620)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 18 11:37:11 PDT 2025


================
@@ -393,8 +393,6 @@ class DependencyScanningAction {
                      DiagnosticConsumer *DiagConsumer) {
     // Make a deep copy of the original Clang invocation.
     CompilerInvocation OriginalInvocation(*Invocation);
-    if (any(Service.getOptimizeArgs() & ScanningOptimizations::Macros))
-      canonicalizeDefines(OriginalInvocation.getPreprocessorOpts());
----------------
jansvoboda11 wrote:

I'd probably just move these up and pass in `Invocation` instead of `OriginalInvocation`.

https://github.com/llvm/llvm-project/pull/159620


More information about the cfe-commits mailing list