@@ -26,11 +26,19 @@ void tooling::dependencies::configureInvocationForCaching(
26
26
auto &FrontendOpts = CI.getFrontendOpts ();
27
27
FrontendOpts.CacheCompileJob = true ;
28
28
FrontendOpts.IncludeTimestamps = false ;
29
+
29
30
// Clear this otherwise it defeats the purpose of making the compilation key
30
31
// independent of certain arguments.
31
- CI.getCodeGenOpts ().DwarfDebugFlags .clear ();
32
+ auto &CodeGenOpts = CI.getCodeGenOpts ();
33
+ if (CI.getFrontendOpts ().ProgramAction != frontend::ActionKind::EmitObj) {
34
+ CodeGenOpts.UseCASBackend = false ;
35
+ CodeGenOpts.EmitCASIDFile = false ;
36
+ auto &LLVMArgs = FrontendOpts.LLVMArgs ;
37
+ llvm::erase (LLVMArgs, " -cas-friendly-debug-info" );
38
+ }
39
+ CodeGenOpts.DwarfDebugFlags .clear ();
32
40
resetBenignCodeGenOptions (FrontendOpts.ProgramAction , CI.getLangOpts (),
33
- CI. getCodeGenOpts () );
41
+ CodeGenOpts );
34
42
35
43
HeaderSearchOptions &HSOpts = CI.getHeaderSearchOpts ();
36
44
// Avoid writing potentially volatile diagnostic options into pcms.
@@ -78,7 +86,7 @@ void tooling::dependencies::configureInvocationForCaching(
78
86
// Disable `-gmodules` to avoid debug info referencing a non-existent PCH
79
87
// filename.
80
88
// FIXME: we should also allow -gmodules if there is no PCH involved.
81
- CI. getCodeGenOpts () .DebugTypeExtRefs = false ;
89
+ CodeGenOpts .DebugTypeExtRefs = false ;
82
90
HSOpts.ModuleFormat = " raw" ;
83
91
}
84
92
// Clear APINotes options.
0 commit comments