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