summaryrefslogtreecommitdiff
path: root/tools/edis/EDOperand.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-02-04 01:43:08 +0000
committerSean Callanan <scallanan@apple.com>2010-02-04 01:43:08 +0000
commit76706584c2190f4a157ec7a3c89a7098ce9fd880 (patch)
treec6bac1147b6a6722a5aff9accaaf1ae699274ae2 /tools/edis/EDOperand.cpp
parent523d70ec1f8daa67bb8a9fe8f7b6b3d076a26c99 (diff)
downloadllvm-76706584c2190f4a157ec7a3c89a7098ce9fd880.tar.gz
llvm-76706584c2190f4a157ec7a3c89a7098ce9fd880.tar.bz2
llvm-76706584c2190f4a157ec7a3c89a7098ce9fd880.tar.xz
Filled in a few new APIs for the enhanced
disassembly library that provide access to instruction information, and fixed ambiguous wording in the comments for the header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95274 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/edis/EDOperand.cpp')
-rw-r--r--tools/edis/EDOperand.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/edis/EDOperand.cpp b/tools/edis/EDOperand.cpp
index c15860affd..da6797e035 100644
--- a/tools/edis/EDOperand.cpp
+++ b/tools/edis/EDOperand.cpp
@@ -125,6 +125,26 @@ int EDOperand::evaluate(uint64_t &result,
return -1;
}
+int EDOperand::isRegister() {
+ return(Inst.ThisInstInfo->operandFlags[OpIndex] & kOperandFlagRegister);
+}
+
+unsigned EDOperand::regVal() {
+ return Inst.Inst->getOperand(MCOpIndex).getReg();
+}
+
+int EDOperand::isImmediate() {
+ return(Inst.ThisInstInfo->operandFlags[OpIndex] & kOperandFlagImmediate);
+}
+
+uint64_t EDOperand::immediateVal() {
+ return Inst.Inst->getOperand(MCOpIndex).getImm();
+}
+
+int EDOperand::isMemory() {
+ return(Inst.ThisInstInfo->operandFlags[OpIndex] & kOperandFlagMemory);
+}
+
#ifdef __BLOCKS__
struct RegisterReaderWrapper {
EDRegisterBlock_t regBlock;