From e34dd37a47cb7648b13580d08a3f6c2a84a477d6 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 5 Oct 2015 17:41:16 +0000 Subject: [PATCH] Undo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762. include/clang/CodeGenABITypes.h is in meant to be included by external users, but using a unique_ptr on the private CodeGenModule introduces a dependency on the type definition that prevents such a use. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249328 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/CodeGen/CodeGenABITypes.h | 3 ++- lib/CodeGen/CodeGenABITypes.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/clang/CodeGen/CodeGenABITypes.h b/include/clang/CodeGen/CodeGenABITypes.h index 455ad74584..25b8ef154a 100644 --- a/include/clang/CodeGen/CodeGenABITypes.h +++ b/include/clang/CodeGen/CodeGenABITypes.h @@ -52,6 +52,7 @@ class CodeGenABITypes public: CodeGenABITypes(ASTContext &C, llvm::Module &M, CoverageSourceInfo *CoverageInfo = nullptr); + ~CodeGenABITypes(); /// These methods all forward to methods in the private implementation class /// CodeGenTypes. @@ -79,7 +80,7 @@ private: std::unique_ptr PPO; /// The CodeGenModule we use get to the CodeGenTypes object. - std::unique_ptr CGM; + CodeGen::CodeGenModule *CGM; }; } // end namespace CodeGen diff --git a/lib/CodeGen/CodeGenABITypes.cpp b/lib/CodeGen/CodeGenABITypes.cpp index b673fc2471..b892f070b5 100644 --- a/lib/CodeGen/CodeGenABITypes.cpp +++ b/lib/CodeGen/CodeGenABITypes.cpp @@ -33,6 +33,11 @@ CodeGenABITypes::CodeGenABITypes(ASTContext &C, llvm::Module &M, CGM(new CodeGen::CodeGenModule(C, *HSO, *PPO, *CGO, M, C.getDiagnostics(), CoverageInfo)) {} +CodeGenABITypes::~CodeGenABITypes() +{ + delete CGM; +} + const CGFunctionInfo & CodeGenABITypes::arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, QualType receiverType) { -- 2.40.0