summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index afcaa6e8787..6f39d48f596 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -66,9 +66,8 @@ CompilerInstance::~CompilerInstance() {
assert(OutputFiles.empty() && "Still output files in flight?");
}
-void CompilerInstance::setInvocation(
- std::shared_ptr<CompilerInvocation> Value) {
- Invocation = std::move(Value);
+void CompilerInstance::setInvocation(CompilerInvocation *Value) {
+ Invocation = Value;
}
bool CompilerInstance::shouldBuildGlobalModuleIndex() const {
@@ -1020,8 +1019,8 @@ static bool compileModuleImpl(CompilerInstance &ImportingInstance,
= ImportingInstance.getPreprocessor().getHeaderSearchInfo().getModuleMap();
// Construct a compiler invocation for creating this module.
- auto Invocation =
- std::make_shared<CompilerInvocation>(ImportingInstance.getInvocation());
+ IntrusiveRefCntPtr<CompilerInvocation> Invocation
+ (new CompilerInvocation(ImportingInstance.getInvocation()));
PreprocessorOptions &PPOpts = Invocation->getPreprocessorOpts();
@@ -1077,8 +1076,7 @@ static bool compileModuleImpl(CompilerInstance &ImportingInstance,
// module.
CompilerInstance Instance(ImportingInstance.getPCHContainerOperations(),
/*BuildingModule=*/true);
- auto &Inv = *Invocation;
- Instance.setInvocation(std::move(Invocation));
+ Instance.setInvocation(&*Invocation);
Instance.createDiagnostics(new ForwardingDiagnosticConsumer(
ImportingInstance.getDiagnosticClient()),
@@ -1100,7 +1098,7 @@ static bool compileModuleImpl(CompilerInstance &ImportingInstance,
// between all of the module CompilerInstances. Other than that, we don't
// want to produce any dependency output from the module build.
Instance.setModuleDepCollector(ImportingInstance.getModuleDepCollector());
- Inv.getDependencyOutputOpts() = DependencyOutputOptions();
+ Invocation->getDependencyOutputOpts() = DependencyOutputOptions();
// Get or create the module map that we'll use to build this module.
std::string InferredModuleMapContent;
OpenPOWER on IntegriCloud