diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/DebugInfo.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/VMCore/DebugInfo.cpp b/lib/VMCore/DebugInfo.cpp index 7d8cf72..73eb92e 100644 --- a/lib/VMCore/DebugInfo.cpp +++ b/lib/VMCore/DebugInfo.cpp @@ -75,6 +75,18 @@ uint64_t DIDescriptor::getUInt64Field(unsigned Elt) const { return 0; } +int64_t DIDescriptor::getInt64Field(unsigned Elt) const { + if (DbgNode == 0) + return 0; + + if (Elt < DbgNode->getNumOperands()) + if (ConstantInt *CI + = dyn_cast_or_null<ConstantInt>(DbgNode->getOperand(Elt))) + return CI->getSExtValue(); + + return 0; +} + DIDescriptor DIDescriptor::getDescriptorField(unsigned Elt) const { if (DbgNode == 0) return DIDescriptor(); |