diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-06 19:25:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-06 19:25:43 +0000 |
commit | 98c870f87b7f0c996a9ba67003d88d434d6dbcd0 (patch) | |
tree | 3f02eb16478f4bae0f26a1164476630369829573 /utils/TableGen/CodeGenInstruction.h | |
parent | dea546b62339578938a91f05a00a145baf921f6c (diff) | |
download | external_llvm-98c870f87b7f0c996a9ba67003d88d434d6dbcd0.zip external_llvm-98c870f87b7f0c996a9ba67003d88d434d6dbcd0.tar.gz external_llvm-98c870f87b7f0c996a9ba67003d88d434d6dbcd0.tar.bz2 |
generalize alias support to allow the result of an alias to
add fixed immediate values. Move the aad and aam aliases to
use this, and document it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118350 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeGenInstruction.h')
-rw-r--r-- | utils/TableGen/CodeGenInstruction.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index f5b2239..ac593df 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -267,10 +267,26 @@ namespace llvm { struct ResultOperand { + private: StringRef Name; Record *R; - ResultOperand(StringRef N, Record *r) : Name(N), R(r) {} + int64_t Imm; + public: + enum { + K_Record, + K_Imm + } Kind; + + ResultOperand(StringRef N, Record *r) : Name(N), R(r), Kind(K_Record) {} + ResultOperand(int64_t I) : Imm(I), Kind(K_Imm) {} + + bool isRecord() const { return Kind == K_Record; } + bool isImm() const { return Kind == K_Imm; } + + StringRef getName() const { assert(isRecord()); return Name; } + Record *getRecord() const { assert(isRecord()); return R; } + int64_t getImm() const { assert(isImm()); return Imm; } }; /// ResultOperands - The decoded operands for the result instruction. |