diff options
| -rw-r--r-- | llvm/include/llvm/Analysis/DebugInfo.h | 4 | ||||
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 11 | 
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h index 3c40d65a485..aa99a133f2a 100644 --- a/llvm/include/llvm/Analysis/DebugInfo.h +++ b/llvm/include/llvm/Analysis/DebugInfo.h @@ -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); diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 8f62245296f..1a079b950a1 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -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  | 

