mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
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
This commit is contained in:
parent
b0dcf61252
commit
9127be8a19
@ -71,6 +71,7 @@ namespace llvm {
|
||||
return (unsigned)getUInt64Field(Elt);
|
||||
}
|
||||
uint64_t getUInt64Field(unsigned Elt) const;
|
||||
int64_t getInt64Field(unsigned Elt) const;
|
||||
DIDescriptor getDescriptorField(unsigned Elt) const;
|
||||
|
||||
template <typename DescTy>
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user