]> granicus.if.org Git - clang/commitdiff
Unique_ptrify Preprocessor::PragmaHandlersBackup
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 15 Sep 2014 21:31:42 +0000 (21:31 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 15 Sep 2014 21:31:42 +0000 (21:31 +0000)
Follow up to r217656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217829 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Preprocessor.h
lib/Lex/Preprocessor.cpp

index 521a8713e7869625d3b04357b66570aef6c1b443..e08c07bd20d81de54818b35341a370842422e7b1 100644 (file)
@@ -196,7 +196,7 @@ class Preprocessor : public RefCountedBase<Preprocessor> {
 
   /// \brief Pragma handlers of the original source is stored here during the
   /// parsing of a model file.
-  PragmaNamespace *PragmaHandlersBackup;
+  std::unique_ptr<PragmaNamespace> PragmaHandlersBackup;
 
   /// \brief Tracks all of the comment handlers that the client registered
   /// with this preprocessor.
index b2f8107ca28cdad6be10fb6439f918b58c731507..400cdb469d5d79ab404f714887eb154c3709c21b 100644 (file)
@@ -183,7 +183,7 @@ void Preprocessor::InitializeForModelFile() {
   NumEnteredSourceFiles = 0;
 
   // Reset pragmas
-  PragmaHandlersBackup = PragmaHandlers.release();
+  PragmaHandlersBackup = std::move(PragmaHandlers);
   PragmaHandlers = llvm::make_unique<PragmaNamespace>(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) {