summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/CodeGenInstruction.h
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2011-01-26 19:44:55 +0000
committerBob Wilson <bob.wilson@apple.com>2011-01-26 19:44:55 +0000
commitb9b2422e89266ce30a16dc08dc1732c249ef19df (patch)
tree0b2f97079d320928e38501538aca5898f267427f /llvm/utils/TableGen/CodeGenInstruction.h
parente1a47c176656a94658e10890b52ce95363af3320 (diff)
downloadbcm5719-llvm-b9b2422e89266ce30a16dc08dc1732c249ef19df.tar.gz
bcm5719-llvm-b9b2422e89266ce30a16dc08dc1732c249ef19df.zip
Improve the AsmMatcher's ability to handle suboperands.
When an operand class is defined with MIOperandInfo set to a list of suboperands, the AsmMatcher has so far required that operand to also define a custom ParserMatchClass, and InstAlias patterns have not been able to set the individual suboperands separately. This patch removes both of those restrictions. If a "compound" operand does not override the default ParserMatchClass, then the AsmMatcher will now parse its suboperands separately. If an InstAlias operand has the same class as the corresponding compound operand, then it will be handled as before; but if that check fails, TableGen will now try to match up a sequence of InstAlias operands with the corresponding suboperands. llvm-svn: 124314
Diffstat (limited to 'llvm/utils/TableGen/CodeGenInstruction.h')
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index fb0e50c08b7..58913b9da26 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/utils/TableGen/CodeGenInstruction.h
@@ -16,6 +16,7 @@
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/SourceMgr.h"
#include <string>
#include <vector>
#include <utility>
@@ -297,11 +298,18 @@ namespace llvm {
/// ResultOperands - The decoded operands for the result instruction.
std::vector<ResultOperand> ResultOperands;
- /// ResultInstOperandIndex - For each operand, this vector holds the
- /// corresponding index of an operand in the result instruction.
- std::vector<unsigned> ResultInstOperandIndex;
+ /// ResultInstOperandIndex - For each operand, this vector holds a pair of
+ /// indices to identify the corresponding operand in the result
+ /// instruction. The first index specifies the operand and the second
+ /// index specifies the suboperand. If there are no suboperands or if all
+ /// of them are matched by the operand, the second value should be -1.
+ std::vector<std::pair<unsigned, int> > ResultInstOperandIndex;
CodeGenInstAlias(Record *R, CodeGenTarget &T);
+
+ bool tryAliasOpMatch(DagInit *Result, unsigned AliasOpNo,
+ Record *InstOpRec, bool hasSubOps, SMLoc Loc,
+ CodeGenTarget &T, ResultOperand &ResOp);
};
}
OpenPOWER on IntegriCloud