[llvm] r185456 - Debug Info: cleanup

Manman Ren mren at apple.com
Tue Jul 2 11:37:36 PDT 2013


Author: mren
Date: Tue Jul  2 13:37:35 2013
New Revision: 185456

URL: http://llvm.org/viewvc/llvm-project?rev=185456&view=rev
Log:
Debug Info: cleanup

Modified:
    llvm/trunk/lib/IR/DIBuilder.cpp
    llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=185456&r1=185455&r2=185456&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Tue Jul  2 13:37:35 2013
@@ -863,9 +863,10 @@ DIType DIBuilder::createForwardDecl(unsi
     ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
   };
   MDNode *Node = MDNode::getTemporary(VMContext, Elts);
-  assert(DIType(Node).isType() &&
+  DIType RetTy(Node);
+  assert(RetTy.isType() &&
          "createForwardDecl result should be a DIType");
-  return DIType(Node);
+  return RetTy;
 }
 
 /// getOrCreateArray - Get a DIArray, create one if required.
@@ -978,9 +979,10 @@ DIVariable DIBuilder::createLocalVariabl
     NamedMDNode *FnLocals = getOrInsertFnSpecificMDNode(M, Fn);
     FnLocals->addOperand(Node);
   }
-  assert(DIVariable(Node).isVariable() &&
+  DIVariable RetVar(Node);
+  assert(RetVar.isVariable() &&
          "createLocalVariable should return a valid DIVariable");
-  return DIVariable(Node);
+  return RetVar;
 }
 
 /// createComplexVariable - Create a new descriptor for the specified variable

Modified: llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp?rev=185456&r1=185455&r2=185456&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/DebugIR.cpp Tue Jul  2 13:37:35 2013
@@ -216,10 +216,10 @@ public:
 
     int FuncFlags = llvm::DIDescriptor::FlagPrototyped;
     assert(CUNode && FileNode);
-    MDNode *Sub = Builder.createFunction(
+    DISubprogram Sub = Builder.createFunction(
         DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
         Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
-    assert(DISubprogram(Sub).isSubprogram());
+    assert(Sub.isSubprogram());
     DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
                  << "\n");
 





More information about the llvm-commits mailing list