summaryrefslogtreecommitdiff
path: root/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-11-23 19:11:20 +0000
committerDevang Patel <dpatel@apple.com>2009-11-23 19:11:20 +0000
commite54a5e88a57a78b1e24430f27bdf0a8f7f0e8e23 (patch)
treed8bab5a98c2923b91350f3a185c6c1d681272a26 /lib/Analysis/DebugInfo.cpp
parent05f6fa874e8d187483a836ccb4906bb3807bb305 (diff)
downloadllvm-e54a5e88a57a78b1e24430f27bdf0a8f7f0e8e23.tar.gz
llvm-e54a5e88a57a78b1e24430f27bdf0a8f7f0e8e23.tar.bz2
llvm-e54a5e88a57a78b1e24430f27bdf0a8f7f0e8e23.tar.xz
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
Diffstat (limited to 'lib/Analysis/DebugInfo.cpp')
-rw-r--r--lib/Analysis/DebugInfo.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 8f62245296..1a079b950a 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/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