]> granicus.if.org Git - clang/commitdiff
Re-introduce the unique_ptr removed in r249328 and just make
authorAdrian Prantl <aprantl@apple.com>
Mon, 5 Oct 2015 18:54:30 +0000 (18:54 +0000)
committerAdrian Prantl <aprantl@apple.com>
Mon, 5 Oct 2015 18:54:30 +0000 (18:54 +0000)
~CodeGenABITypes out-of-line, which should have the same effect.

Thanks to David Blaikie for pointing this out!

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

include/clang/CodeGen/CodeGenABITypes.h
lib/CodeGen/CodeGenABITypes.cpp

index 25b8ef154af6690e3f3ad3240ee0cf2a3f9719d0..d3a3a9b9ca096ce941c431a3074114eeacff22bc 100644 (file)
@@ -80,7 +80,7 @@ private:
   std::unique_ptr<PreprocessorOptions> PPO;
 
   /// The CodeGenModule we use get to the CodeGenTypes object.
-  CodeGen::CodeGenModule *CGM;
+  std::unique_ptr<CodeGen::CodeGenModule> CGM;
 };
 
 }  // end namespace CodeGen
index b892f070b511af34d386406dcb2527d482ec21f1..420b958ba70f0d464222c873bf081c58d5223a6d 100644 (file)
@@ -33,10 +33,9 @@ CodeGenABITypes::CodeGenABITypes(ASTContext &C, llvm::Module &M,
       CGM(new CodeGen::CodeGenModule(C, *HSO, *PPO, *CGO, M, C.getDiagnostics(),
                                      CoverageInfo)) {}
 
-CodeGenABITypes::~CodeGenABITypes()
-{
-  delete CGM;
-}
+// Explicitly out-of-line because ~CodeGenModule() is private but
+// CodeGenABITypes.h is part of clang's API.
+CodeGenABITypes::~CodeGenABITypes() = default;
 
 const CGFunctionInfo &
 CodeGenABITypes::arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD,