Added header file declarations and .exports entries
authorSean Callanan <scallanan@apple.com>
Mon, 8 Feb 2010 23:34:25 +0000 (23:34 +0000)
committerSean Callanan <scallanan@apple.com>
Mon, 8 Feb 2010 23:34:25 +0000 (23:34 +0000)
for the new APIs offered by the enhanced disassembler
for inspecting operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95606 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm-c/EnhancedDisassembly.h
tools/edis/EDMain.cpp
tools/edis/EnhancedDisassembly.exports

index a9703f5995d216b3c2debf641946181a1ef432b3..9cd1e1f5f3cfe72aaf744a650246447ed88572d7 100644 (file)
@@ -368,10 +368,55 @@ int EDNumOperands(EDInstRef inst);
 int EDGetOperand(EDOperandRef *operand,
                  EDInstRef inst,
                  int index);
+  
+/*!
+ @function EDOperandIsRegister
+ @param operand The operand to be queried.
+ @result 1 if the operand names a register; 0 if not; -1 on error.
+ */
+int EDOperandIsRegister(EDOperandRef operand);
+
+/*!
+ @function EDOperandIsImmediate
+ @param operand The operand to be queried.
+ @result 1 if the operand specifies an immediate value; 0 if not; -1 on error.
+ */
+int EDOperandIsImmediate(EDOperandRef operand);
+
+/*!
+ @function EDOperandIsMemory
+ @param operand The operand to be queried.
+ @result 1 if the operand specifies a location in memory; 0 if not; -1 on error.
+ */
+int EDOperandIsMemory(EDOperandRef operand);
+
+/*!
+ @function EDRegisterOperandValue
+ @param value A pointer whose target will be filled in with the LLVM register ID
+   of the register named by the operand.  
+ @param operand The operand to be queried.
+ @result 0 on success; -1 otherwise.
+ */
+int EDRegisterOperandValue(unsigned *value,
+                           EDOperandRef operand);
+  
+/*!
+ @function EDImmediateOperandValue
+ @param value A pointer whose target will be filled in with the value of the
+   immediate.
+ @param operand The operand to be queried.
+ @result 0 on success; -1 otherwise.
+ */
+int EDImmediateOperandValue(uint64_t *value,
+                            EDOperandRef operand);
 
 /*!
  @function EDEvaluateOperand
- Evaluates an operand using a client-supplied register state accessor.
+ Evaluates an operand using a client-supplied register state accessor.  Register
+ operands are evaluated by reading the value of the register; immediate operands
+ are evaluated by reporting the immediate value; memory operands are evaluated
+ by computing the target address (with only those relocations applied that were
+ already applied to the original bytes).
  @param result A pointer whose target is to be filled with the result of
    evaluating the operand.
  @param operand The operand to be evaluated.
index 1d2a6078b5eab88c7a08cbeb0b26fd4bb079ceb3..3585657ca62da482abd6c78bcb9ec88f9e5201d5 100644 (file)
@@ -221,7 +221,7 @@ int EDRegisterOperandValue(unsigned *value,
   return 0;
 }
 
-int EDImmedateOperandValue(uint64_t *value,
+int EDImmediateOperandValue(uint64_t *value,
                            EDOperandRef operand) {
   if(!operand->isImmediate())
     return -1;
index 63738e536656b7b793a91c99d4c9ba33859133cc..d3f87435cc3d4a2777c73088e45651861e4ad204 100644 (file)
@@ -25,6 +25,11 @@ _EDLiteralTokenAbsoluteValue
 _EDRegisterTokenValue
 _EDNumOperands
 _EDGetOperand
+_EDOperandIsRegister
+_EDOperandIsImmediate
+_EDOperandIsMemory
+_EDRegisterOperandValue
+_EDImmediateOperandValue
 _EDEvaluateOperand
 _EDBlockCreateInsts
 _EDBlockEvaluateOperand