summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/X86RecognizableInstr.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-10 01:45:28 +0000
committerChris Lattner <sabre@nondot.org>2010-02-10 01:45:28 +0000
commita9dfb1bc07e437e4a97bd6b16e7af63de7e99839 (patch)
tree441d13a09add9cda34a5a4a41b8f4ed145d049a1 /llvm/utils/TableGen/X86RecognizableInstr.cpp
parent75c9a4eeaeed62d6b203206f5a61e2f41208bc3e (diff)
downloadbcm5719-llvm-a9dfb1bc07e437e4a97bd6b16e7af63de7e99839.tar.gz
bcm5719-llvm-a9dfb1bc07e437e4a97bd6b16e7af63de7e99839.zip
Introduce a new CodeGenInstruction::ConstraintInfo class
for representing constraint info semantically instead of as a c expression that will be blatted out to the .inc file. Fix X86RecognizableInstr to use this instead of parsing C code :). llvm-svn: 95753
Diffstat (limited to 'llvm/utils/TableGen/X86RecognizableInstr.cpp')
-rw-r--r--llvm/utils/TableGen/X86RecognizableInstr.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/X86RecognizableInstr.cpp b/llvm/utils/TableGen/X86RecognizableInstr.cpp
index 2b6e30d93d7..da2de6b3200 100644
--- a/llvm/utils/TableGen/X86RecognizableInstr.cpp
+++ b/llvm/utils/TableGen/X86RecognizableInstr.cpp
@@ -402,13 +402,10 @@ void RecognizableInstr::emitInstructionSpecifier(DisassemblerTables &tables) {
for (operandIndex = 0; operandIndex < numOperands; ++operandIndex) {
if (OperandList[operandIndex].Constraints.size()) {
- const std::string &constraint = OperandList[operandIndex].Constraints[0];
- std::string::size_type tiedToPos;
-
- if ((tiedToPos = constraint.find(" << 16) | (1 << TOI::TIED_TO))")) !=
- constraint.npos) {
- tiedToPos--;
- operandMapping[operandIndex] = constraint[tiedToPos] - '0';
+ const CodeGenInstruction::ConstraintInfo &Constraint =
+ OperandList[operandIndex].Constraints[0];
+ if (Constraint.isTied()) {
+ operandMapping[operandIndex] = Constraint.getTiedOperand();
} else {
++numPhysicalOperands;
operandMapping[operandIndex] = operandIndex;
OpenPOWER on IntegriCloud