File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
clang/lib/Tooling/DependencyScanning Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -391,10 +391,13 @@ class DependencyScanningAction {
391391 IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
392392 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
393393 DiagnosticConsumer *DiagConsumer) {
394+ // Making sure that we canonicalize the defines before we create the deep
395+ // copy.
396+ if (any (Service.getOptimizeArgs () & ScanningOptimizations::Macros))
397+ canonicalizeDefines (Invocation->getPreprocessorOpts ());
398+
394399 // Make a deep copy of the original Clang invocation.
395400 CompilerInvocation OriginalInvocation (*Invocation);
396- if (any (Service.getOptimizeArgs () & ScanningOptimizations::Macros))
397- canonicalizeDefines (OriginalInvocation.getPreprocessorOpts ());
398401
399402 if (Scanned) {
400403 // Scanning runs once for the first -cc1 invocation in a chain of driver
You can’t perform that action at this time.
0 commit comments