r217829 - Unique_ptrify Preprocessor::PragmaHandlersBackup
    David Blaikie 
    dblaikie at gmail.com
       
    Mon Sep 15 14:31:42 PDT 2014
    
    
  
Author: dblaikie
Date: Mon Sep 15 16:31:42 2014
New Revision: 217829
URL: http://llvm.org/viewvc/llvm-project?rev=217829&view=rev
Log:
Unique_ptrify Preprocessor::PragmaHandlersBackup
Follow up to r217656
Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Lex/Preprocessor.cpp
Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=217829&r1=217828&r2=217829&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Mon Sep 15 16:31:42 2014
@@ -196,7 +196,7 @@ class Preprocessor : public RefCountedBa
 
   /// \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.
Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=217829&r1=217828&r2=217829&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Mon Sep 15 16:31:42 2014
@@ -183,7 +183,7 @@ void Preprocessor::InitializeForModelFil
   NumEnteredSourceFiles = 0;
 
   // Reset pragmas
-  PragmaHandlersBackup = PragmaHandlers.release();
+  PragmaHandlersBackup = std::move(PragmaHandlers);
   PragmaHandlers = llvm::make_unique<PragmaNamespace>(StringRef());
   RegisterBuiltinPragmas();
 
@@ -194,7 +194,7 @@ void Preprocessor::InitializeForModelFil
 void Preprocessor::FinalizeForModelFile() {
   NumEnteredSourceFiles = 1;
 
-  PragmaHandlers.reset(PragmaHandlersBackup);
+  PragmaHandlers = std::move(PragmaHandlersBackup);
 }
 
 void Preprocessor::setPTHManager(PTHManager* pm) {
    
    
More information about the cfe-commits
mailing list