From: Adrian Prantl Date: Mon, 5 Oct 2015 18:54:30 +0000 (+0000) Subject: Re-introduce the unique_ptr removed in r249328 and just make X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b55480d638ed11c0072dbed4fce941ef933fd98a;p=clang Re-introduce the unique_ptr removed in r249328 and just make ~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 --- diff --git a/include/clang/CodeGen/CodeGenABITypes.h b/include/clang/CodeGen/CodeGenABITypes.h index 25b8ef154a..d3a3a9b9ca 100644 --- a/include/clang/CodeGen/CodeGenABITypes.h +++ b/include/clang/CodeGen/CodeGenABITypes.h @@ -80,7 +80,7 @@ private: std::unique_ptr PPO; /// The CodeGenModule we use get to the CodeGenTypes object. - CodeGen::CodeGenModule *CGM; + std::unique_ptr CGM; }; } // end namespace CodeGen diff --git a/lib/CodeGen/CodeGenABITypes.cpp b/lib/CodeGen/CodeGenABITypes.cpp index b892f070b5..420b958ba7 100644 --- a/lib/CodeGen/CodeGenABITypes.cpp +++ b/lib/CodeGen/CodeGenABITypes.cpp @@ -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,