summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenInstruction.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-06 19:25:43 +0000
committerChris Lattner <sabre@nondot.org>2010-11-06 19:25:43 +0000
commitb6f8e8248d7f3540f739f696ec73534f7d9fcaf4 (patch)
tree2c801fdc13fe78886e5921f460e387914f125bd5 /llvm/utils/TableGen/CodeGenInstruction.h
parent161bf7de25c6505917741ee32a0a2aad2099bd1d (diff)
downloadbcm5719-llvm-b6f8e8248d7f3540f739f696ec73534f7d9fcaf4.tar.gz
bcm5719-llvm-b6f8e8248d7f3540f739f696ec73534f7d9fcaf4.zip
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. llvm-svn: 118350
Diffstat (limited to 'llvm/utils/TableGen/CodeGenInstruction.h')
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index f5b22396360..ac593dfb17d 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/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.
OpenPOWER on IntegriCloud