aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-12-03 19:44:25 +0000
committerBill Wendling <isanbard@gmail.com>2012-12-03 19:44:25 +0000
commit9127be8a19471039f1c8e50e92c8ebd0460048e9 (patch)
tree329a6927cbdf07f6145e4c5e01cafdbeb2d46f41 /lib/VMCore
parentb0dcf61252e58715a3bea79f4c112572df361c30 (diff)
downloadexternal_llvm-9127be8a19471039f1c8e50e92c8ebd0460048e9.zip
external_llvm-9127be8a19471039f1c8e50e92c8ebd0460048e9.tar.gz
external_llvm-9127be8a19471039f1c8e50e92c8ebd0460048e9.tar.bz2
Add 'getInt64Field()' method to get the signed integer instead of unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169145 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/DebugInfo.cpp12
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();