]> granicus.if.org Git - clang/commitdiff
Move BlockLiteralGeneric earlier in CGDebugInfo and remove
authorEric Christopher <echristo@gmail.com>
Sun, 14 Jul 2013 21:12:44 +0000 (21:12 +0000)
committerEric Christopher <echristo@gmail.com>
Sun, 14 Jul 2013 21:12:44 +0000 (21:12 +0000)
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
lib/CodeGen/CGDebugInfo.h

index 36d869232d63d4556d63e7ac2b3934b5aa864198..8d639f5aae39aeeb6d2932287b134c66759c616b 100644 (file)
@@ -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<llvm::Value *, 8> 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;
 }
index ddd4f0b1df1715f255d96e726b86100a1f9d81c6..29df600447482a0183156f6a505239ac95518126 100644 (file)
@@ -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<void *, llvm::WeakVH> TypeCache;
@@ -79,9 +80,6 @@ class CGDebugInfo {
   /// compilation.
   std::vector<std::pair<void *, llvm::WeakVH> >ReplaceMap;
 
-  bool BlockLiteralGenericSet;
-  llvm::DIType BlockLiteralGeneric;
-
   // LexicalBlockStack - Keep track of our current nested lexical block.
   std::vector<llvm::TrackingVH<llvm::MDNode> > LexicalBlockStack;
   llvm::DenseMap<const Decl *, llvm::WeakVH> RegionMap;