diff options
Diffstat (limited to 'clang/include/clang/Frontend/CompilerInstance.h')
-rw-r--r-- | clang/include/clang/Frontend/CompilerInstance.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/include/clang/Frontend/CompilerInstance.h b/clang/include/clang/Frontend/CompilerInstance.h index c77dc621b0b..1ed6b52b9a7 100644 --- a/clang/include/clang/Frontend/CompilerInstance.h +++ b/clang/include/clang/Frontend/CompilerInstance.h @@ -91,7 +91,7 @@ class CompilerInstance : public ModuleLoader { IntrusiveRefCntPtr<SourceManager> SourceMgr; /// The preprocessor. - IntrusiveRefCntPtr<Preprocessor> PP; + std::shared_ptr<Preprocessor> PP; /// The AST context. IntrusiveRefCntPtr<ASTContext> Context; @@ -433,13 +433,14 @@ public: return *PP; } + std::shared_ptr<Preprocessor> getPreprocessorPtr() { return PP; } + void resetAndLeakPreprocessor() { - BuryPointer(PP.get()); - PP.resetWithoutRelease(); + BuryPointer(new std::shared_ptr<Preprocessor>(PP)); } /// Replace the current preprocessor. - void setPreprocessor(Preprocessor *Value); + void setPreprocessor(std::shared_ptr<Preprocessor> Value); /// } /// @name ASTContext |