Debug Info: cleanup
authorManman Ren <mren@apple.com>
Tue, 2 Jul 2013 18:37:35 +0000 (18:37 +0000)
committerManman Ren <mren@apple.com>
Tue, 2 Jul 2013 18:37:35 +0000 (18:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185456 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DIBuilder.cpp
lib/Transforms/Instrumentation/DebugIR.cpp

index 9a9df499abc9bc9eb660826d7c288ac21fb59bca..6cb13a0844c847bb1d9614a41d1093e8ddda6b5d 100644 (file)
@@ -863,9 +863,10 @@ DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
     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::createLocalVariable(unsigned Tag, DIDescriptor Scope,
     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
index 7bc4da7a8f7d5fea9e69af3d36f10f92821b3f5e..f4109eff4f55f9a745d469779eab39acf5b504a7 100644 (file)
@@ -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");