Add CreateLocation varinat that accepts MDNode (with a default value).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-11-23 19:11:20 +00:00
parent 05f6fa874e
commit e54a5e88a5
2 changed files with 15 additions and 0 deletions

View File

@ -598,6 +598,10 @@ namespace llvm {
DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo,
DIScope S, DILocation OrigLoc);
/// CreateLocation - Creates a debug info location.
DILocation CreateLocation(unsigned LineNo, unsigned ColumnNo,
DIScope S, MDNode *OrigLoc = 0);
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
Instruction *InsertDeclare(llvm::Value *Storage, DIVariable D,
BasicBlock *InsertAtEnd);

View File

@ -976,6 +976,17 @@ DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo,
return DILocation(MDNode::get(VMContext, &Elts[0], 4));
}
/// CreateLocation - Creates a debug info location.
DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo,
DIScope S, MDNode *OrigLoc) {
Value *Elts[] = {
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
ConstantInt::get(Type::getInt32Ty(VMContext), ColumnNo),
S.getNode(),
OrigLoc
};
return DILocation(MDNode::get(VMContext, &Elts[0], 4));
}
//===----------------------------------------------------------------------===//
// DIFactory: Routines for inserting code into a function