]> granicus.if.org Git - clang/commitdiff
Revert r188498.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 16 Aug 2013 10:35:31 +0000 (10:35 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Fri, 16 Aug 2013 10:35:31 +0000 (10:35 +0000)
This change broke release+asserts build with compiler-rt.

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

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGDebugInfo.h

index 0c6f549e21c37ef79a867de4bfcec5ab6e1a6de8..fd6ce474747d2611dd649fd819388a2043c383b5 100644 (file)
@@ -2997,25 +2997,19 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block,
   DbgDecl->setDebugLoc(llvm::DebugLoc::get(line, column, scope));
 }
 
-/// If D is an out-of-class definition of a static data member of a class, find
-/// its corresponding in-class declaration.
-llvm::DIDerivedType
-CGDebugInfo::getStaticDataMemberDeclarationOrNull(const VarDecl *D) {
-  if (!D->isStaticDataMember())
-    return llvm::DIDerivedType();
-  return getStaticDataMemberDeclaration(D);
-}
-
-llvm::DIDerivedType
-CGDebugInfo::getStaticDataMemberDeclaration(const VarDecl *D) {
-  llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator
-    MI = StaticDataMemberCache.find(D->getCanonicalDecl());
-  if (MI != StaticDataMemberCache.end())
-    // Verify the info still exists.
-    if (llvm::Value *V = MI->second)
-      return llvm::DIDerivedType(cast<llvm::MDNode>(V));
-  llvm_unreachable(
-      "A static data member declaration should be available at this point");
+/// getStaticDataMemberDeclaration - If D is an out-of-class definition of
+/// a static data member of a class, find its corresponding in-class
+/// declaration.
+llvm::DIDerivedType CGDebugInfo::getStaticDataMemberDeclaration(const VarDecl *D) {
+  if (D->isStaticDataMember()) {
+    llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator
+      MI = StaticDataMemberCache.find(D->getCanonicalDecl());
+    if (MI != StaticDataMemberCache.end())
+      // Verify the info still exists.
+      if (llvm::Value *V = MI->second)
+        return llvm::DIDerivedType(cast<llvm::MDNode>(V));
+  }
+  return llvm::DIDerivedType();
 }
 
 /// EmitGlobalVariable - Emit information about a global variable.
@@ -3047,9 +3041,11 @@ void CGDebugInfo::EmitGlobalVariable(llvm::GlobalVariable *Var,
     LinkageName = StringRef();
   llvm::DIDescriptor DContext =
     getContextDescriptor(dyn_cast<Decl>(D->getDeclContext()));
-  llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
-      DContext, DeclName, LinkageName, Unit, LineNo, getOrCreateType(T, Unit),
-      Var->hasInternalLinkage(), Var, getStaticDataMemberDeclarationOrNull(D));
+  llvm::DIGlobalVariable GV =
+      DBuilder.createStaticVariable(DContext, DeclName, LinkageName, Unit,
+                                    LineNo, getOrCreateType(T, Unit),
+                                    Var->hasInternalLinkage(), Var,
+                                    getStaticDataMemberDeclaration(D));
   DeclCache.insert(std::make_pair(D->getCanonicalDecl(), llvm::WeakVH(GV)));
 }
 
@@ -3097,7 +3093,7 @@ void CGDebugInfo::EmitGlobalVariable(const ValueDecl *VD,
     return;
   llvm::DIGlobalVariable GV = DBuilder.createStaticVariable(
       Unit, Name, Name, Unit, getLineNumber(VD->getLocation()), Ty, true, Init,
-      getStaticDataMemberDeclarationOrNull(cast<VarDecl>(VD)));
+      getStaticDataMemberDeclaration(cast<VarDecl>(VD)));
   DeclCache.insert(std::make_pair(VD->getCanonicalDecl(), llvm::WeakVH(GV)));
 }
 
index c3d2834234370d7f1674cf3f0903a60b0443ad42..041fe492ab3962060ef36194bfd285c0a30fd272 100644 (file)
@@ -356,7 +356,6 @@ private:
   /// getStaticDataMemberDeclaration - Return debug info descriptor to
   /// describe in-class static data member declaration for the given
   /// out-of-class definition.
-  llvm::DIDerivedType getStaticDataMemberDeclarationOrNull(const VarDecl *D);
   llvm::DIDerivedType getStaticDataMemberDeclaration(const VarDecl *D);
 
   /// getFunctionName - Get function name for the given FunctionDecl. If the