summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit7b246c38724a9c79336fff87af668136fb676fe6 (patch)
treec3177ff120b4748603f05c49990579c92733d100 /llvm/lib/VMCore
parent9ab73626fc3881ecfad2b71d942ecd31e81e9e35 (diff)
downloadbcm5719-llvm-7b246c38724a9c79336fff87af668136fb676fe6.tar.gz
bcm5719-llvm-7b246c38724a9c79336fff87af668136fb676fe6.zip
Add 'getInt64Field()' method to get the signed integer instead of unsigned.
llvm-svn: 169145
Diffstat (limited to 'llvm/lib/VMCore')
-rw-r--r--llvm/lib/VMCore/DebugInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/DebugInfo.cpp b/llvm/lib/VMCore/DebugInfo.cpp
index 7d8cf72aab2..73eb92ee846 100644
--- a/llvm/lib/VMCore/DebugInfo.cpp
+++ b/llvm/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();
OpenPOWER on IntegriCloud