diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-01-05 19:48:07 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-01-05 19:48:07 +0000 |
commit | 41565463bd69932307daacf7e9b51e6a16dc6853 (patch) | |
tree | 3718df560ad1c4b02e11fed76e880fb5f3b15d6f /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 4c050c21908d417517bc2cfa3d6700363ce1565c (diff) | |
download | bcm5719-llvm-41565463bd69932307daacf7e9b51e6a16dc6853.tar.gz bcm5719-llvm-41565463bd69932307daacf7e9b51e6a16dc6853.zip |
Move Preprocessor over to std::shared_ptr rather than IntrusiveRefCntPtr
llvm-svn: 291166
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 10b8c7f4ff0..0d8d972d236 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -96,7 +96,9 @@ void CompilerInstance::setSourceManager(SourceManager *Value) { SourceMgr = Value; } -void CompilerInstance::setPreprocessor(Preprocessor *Value) { PP = Value; } +void CompilerInstance::setPreprocessor(std::shared_ptr<Preprocessor> Value) { + PP = std::move(Value); +} void CompilerInstance::setASTContext(ASTContext *Value) { Context = Value; @@ -370,10 +372,10 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { getDiagnostics(), getLangOpts(), &getTarget()); - PP = new Preprocessor(Invocation->getPreprocessorOptsPtr(), getDiagnostics(), - getLangOpts(), getSourceManager(), *HeaderInfo, *this, - PTHMgr, - /*OwnsHeaderSearch=*/true, TUKind); + PP = std::make_shared<Preprocessor>( + Invocation->getPreprocessorOptsPtr(), getDiagnostics(), getLangOpts(), + getSourceManager(), *HeaderInfo, *this, PTHMgr, + /*OwnsHeaderSearch=*/true, TUKind); PP->Initialize(getTarget(), getAuxTarget()); // Note that this is different then passing PTHMgr to Preprocessor's ctor. |