From: David Blaikie Date: Mon, 15 Sep 2014 21:31:42 +0000 (+0000) Subject: Unique_ptrify Preprocessor::PragmaHandlersBackup X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=745ac69f02a3805a66eaae6a05d08cd2c7ce5e47;p=clang Unique_ptrify Preprocessor::PragmaHandlersBackup Follow up to r217656 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217829 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 521a8713e7..e08c07bd20 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -196,7 +196,7 @@ class Preprocessor : public RefCountedBase { /// \brief Pragma handlers of the original source is stored here during the /// parsing of a model file. - PragmaNamespace *PragmaHandlersBackup; + std::unique_ptr PragmaHandlersBackup; /// \brief Tracks all of the comment handlers that the client registered /// with this preprocessor. diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index b2f8107ca2..400cdb469d 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -183,7 +183,7 @@ void Preprocessor::InitializeForModelFile() { NumEnteredSourceFiles = 0; // Reset pragmas - PragmaHandlersBackup = PragmaHandlers.release(); + PragmaHandlersBackup = std::move(PragmaHandlers); PragmaHandlers = llvm::make_unique(StringRef()); RegisterBuiltinPragmas(); @@ -194,7 +194,7 @@ void Preprocessor::InitializeForModelFile() { void Preprocessor::FinalizeForModelFile() { NumEnteredSourceFiles = 1; - PragmaHandlers.reset(PragmaHandlersBackup); + PragmaHandlers = std::move(PragmaHandlersBackup); } void Preprocessor::setPTHManager(PTHManager* pm) {