From 688cf5b05713055d27bf53460f7c20a776440767 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Sun, 14 Jul 2013 21:12:44 +0000 Subject: [PATCH] Move BlockLiteralGeneric earlier in CGDebugInfo and remove BlockLiteralGenericSet and replace with a call to isType() on the BlockLiteralGeneric. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186293 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGDebugInfo.cpp | 8 +++----- lib/CodeGen/CGDebugInfo.h | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 36d869232d..8d639f5aae 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -41,9 +41,8 @@ using namespace clang; using namespace clang::CodeGen; CGDebugInfo::CGDebugInfo(CodeGenModule &CGM) - : CGM(CGM), DebugKind(CGM.getCodeGenOpts().getDebugInfo()), - DBuilder(CGM.getModule()), - BlockLiteralGenericSet(false) { + : CGM(CGM), DebugKind(CGM.getCodeGenOpts().getDebugInfo()), + DBuilder(CGM.getModule()) { CreateCompileUnit(); } @@ -650,7 +649,7 @@ llvm::DIType CGDebugInfo::getOrCreateStructPtrType(StringRef Name, llvm::DIType CGDebugInfo::CreateType(const BlockPointerType *Ty, llvm::DIFile Unit) { - if (BlockLiteralGenericSet) + if (BlockLiteralGeneric.isType()) return BlockLiteralGeneric; SmallVector EltTys; @@ -706,7 +705,6 @@ llvm::DIType CGDebugInfo::CreateType(const BlockPointerType *Ty, Unit, LineNo, FieldOffset, 0, Flags, llvm::DIType(), Elements); - BlockLiteralGenericSet = true; BlockLiteralGeneric = DBuilder.createPointerType(EltTy, Size); return BlockLiteralGeneric; } diff --git a/lib/CodeGen/CGDebugInfo.h b/lib/CodeGen/CGDebugInfo.h index ddd4f0b1df..29df600447 100644 --- a/lib/CodeGen/CGDebugInfo.h +++ b/lib/CodeGen/CGDebugInfo.h @@ -60,6 +60,7 @@ class CGDebugInfo { llvm::DIType OCLImage2dDITy, OCLImage2dArrayDITy; llvm::DIType OCLImage3dDITy; llvm::DIType OCLEventDITy; + llvm::DIType BlockLiteralGeneric; /// TypeCache - Cache of previously constructed Types. llvm::DenseMap TypeCache; @@ -79,9 +80,6 @@ class CGDebugInfo { /// compilation. std::vector >ReplaceMap; - bool BlockLiteralGenericSet; - llvm::DIType BlockLiteralGeneric; - // LexicalBlockStack - Keep track of our current nested lexical block. std::vector > LexicalBlockStack; llvm::DenseMap RegionMap; -- 2.40.0