File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,10 @@ class ASTUnit {
143
143
// / Parse available.
144
144
std::shared_ptr<CompilerInvocation> CCInvocation;
145
145
146
+ // / Optional owned invocation, just used to keep the invocation alive for the
147
+ // / members initialized in transferASTDataFromCompilerInstance.
148
+ std::shared_ptr<CompilerInvocation> ModifiedInvocation;
149
+
146
150
// / Fake module loader: the AST unit doesn't need to load any modules.
147
151
TrivialModuleLoader ModuleLoader;
148
152
Original file line number Diff line number Diff line change @@ -1499,6 +1499,10 @@ void ASTUnit::transferASTDataFromCompilerInstance(CompilerInstance &CI) {
1499
1499
Target = &CI.getTarget ();
1500
1500
Reader = CI.getASTReader ();
1501
1501
HadModuleLoaderFatalFailure = CI.hadModuleLoaderFatalFailure ();
1502
+ if (Invocation != CI.getInvocationPtr ()) {
1503
+ // This happens when Parse creates a copy of \c Invocation to modify.
1504
+ ModifiedInvocation = CI.getInvocationPtr ();
1505
+ }
1502
1506
}
1503
1507
1504
1508
StringRef ASTUnit::getMainFileName () const {
You can’t perform that action at this time.
0 commit comments