diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-08-10 18:41:10 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-10 18:41:10 +0000 |
| commit | 338825c1928b956b2cbcc2c165a60afddd100398 (patch) | |
| tree | ff202062dddcfe90ec2c604d1094571c44d91902 /include/llvm/Target/Target.td | |
| parent | b2d555b25bee4df71b33bbf9a3d730339b6a4081 (diff) | |
llvm-mc/AsmMatcher: Change assembler parser match classes to their own record
structure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78581 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
| -rw-r--r-- | include/llvm/Target/Target.td | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index 3ca7567b78..a30d40f97d 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -278,6 +278,32 @@ def ptr_rc : PointerLikeRegClass<0>; /// it to be resolved by inference in the context it is used. def unknown; +/// AsmOperandClass - Representation for the kinds of operands which the target +/// specific parser can create and the assembly matcher may need to distinguish. +/// +/// Operand classes are used to define the order in which instructions are +/// matched, to ensure that the instruction which gets matched for any +/// particular list of operands is deterministic. +/// +/// The target specific parser must be able to classify a parsed operand into a +/// unique class which does not partially overlap with any other classes. It can +/// match a subset of some other class, in which case the super class field +/// should be defined. +class AsmOperandClass { + /// The name to use for this class, this should be usable as an enum value, + /// and will be used to generated the names for the methods to test whether a + /// particular target specific operand matches this class, and the method to + /// convert an operand of this class into an MCInst operand. + string Name = ?; + + /// The super class of this operand. + AsmOperandClass SuperClass = ?; +} + +def ImmAsmOperand : AsmOperandClass { + let Name = "Imm"; +} + /// Operand Types - These provide the built-in operand types that may be used /// by a target. Targets can optionally provide their own operand types as /// needed, though this should not be needed for RISC targets. @@ -295,13 +321,7 @@ class Operand<ValueType ty> { // into a unique class, which does not partially overlap with any other // classes. It can match a subset of some other class, in which case // ParserMatchSuperClass should be set to the name of that class. - string ParserMatchClass = "Imm"; - - // ParserMatchSuperClass - The enclosing super class for this operand (if - // any). This operand *must* be a subset of the valid operands for the super - // class; i.e., the match predicate for this super class must return true - // for all instances of this class. - string ParserMatchSuperClass = ?; + AsmOperandClass ParserMatchClass = ImmAsmOperand; } def i1imm : Operand<i1>; |
