aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/DebugInfo.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-03-01 22:58:13 +0000
committerDevang Patel <dpatel@apple.com>2011-03-01 22:58:13 +0000
commite9e16c5f52c4a093f4de234d448cdebedab8938e (patch)
tree30919eba1124cefad5813d264bfb9d0fb9e82131 /include/llvm/Analysis/DebugInfo.h
parentd9f574b724a208ec38761e250d83fcc2480e685c (diff)
downloadexternal_llvm-e9e16c5f52c4a093f4de234d448cdebedab8938e.zip
external_llvm-e9e16c5f52c4a093f4de234d448cdebedab8938e.tar.gz
external_llvm-e9e16c5f52c4a093f4de234d448cdebedab8938e.tar.bz2
Today, the language front ends produces llvm.dbg.* intrinsics, used to encode arguments' debug info, in order any way, most of the times. However, if a front end mix-n-matches llvm.dbg.declare and llvm.dbg.value intrinsics to encode debug info for arguments then code generator needs a way to find argument order.
Use 8 bits from line number field to keep track of argument ordering while encoding debug info for an argument. That leaves 24 bit for line no, DebugLoc also allocates 24 bit for line numbers. If a function has more than 255 arguments then rest of the arguments will be ordered by llvm.dbg.* intrinsics' ordering in IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DebugInfo.h')
-rw-r--r--include/llvm/Analysis/DebugInfo.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index aa69088..e75b74f 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -564,7 +564,13 @@ namespace llvm {
DIFile F = getFieldAs<DIFile>(3);
return F.getCompileUnit();
}
- unsigned getLineNumber() const { return getUnsignedField(4); }
+ unsigned getLineNumber() const {
+ return (getUnsignedField(4) << 8) >> 8;
+ }
+ unsigned getArgNumber() const {
+ unsigned L = getUnsignedField(4);
+ return L >> 24;
+ }
DIType getType() const { return getFieldAs<DIType>(5); }
/// isArtificial - Return true if this variable is marked as "artificial".