diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-04-18 22:35:36 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-04-18 22:35:36 +0000 |
commit | 88eb89b89f9426feb7be9b19d1a664b37c590bdb (patch) | |
tree | ecd35ce26341780f82ce5490efc66240bd7526e1 /include/llvm/Target/Target.td | |
parent | 860c08cad5b7c1359123bb2b0e74df4b6e48a15c (diff) | |
download | llvm-88eb89b89f9426feb7be9b19d1a664b37c590bdb.tar.gz llvm-88eb89b89f9426feb7be9b19d1a664b37c590bdb.tar.bz2 llvm-88eb89b89f9426feb7be9b19d1a664b37c590bdb.tar.xz |
[asm parser] Add support for predicating MnemonicAlias based on the assembler
variant/dialect. Addresses a FIXME in the emitMnemonicAliases function.
Use and test case to come shortly.
rdar://13688439 and part of PR13340.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179804 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
-rw-r--r-- | include/llvm/Target/Target.td | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td index cc27902645..7de8b384c3 100644 --- a/include/llvm/Target/Target.td +++ b/include/llvm/Target/Target.td @@ -807,6 +807,9 @@ class AsmParserVariant { // assembly language. int Variant = 0; + // Name - The AsmParser variant name (e.g., AT&T vs Intel). + string Name = ""; + // CommentDelimiter - If given, the delimiter string used to recognize // comments which are hard coded in the .td assembler strings for individual // instructions. @@ -860,9 +863,16 @@ class TokenAlias<string From, string To> { /// def : MnemonicAlias<"pushf", "pushfq">, Requires<[In64BitMode]>; /// def : MnemonicAlias<"pushf", "pushfl">, Requires<[In32BitMode]>; /// -class MnemonicAlias<string From, string To> { +/// Mnemonic aliases can also be constrained to specific variants, e.g.: +/// +/// def : MnemonicAlias<"pushf", "pushfq", "att">, Requires<[In64BitMode]>; +/// +/// If no variant (e.g., "att" or "intel") is specified then the alias is +/// applied unconditionally. +class MnemonicAlias<string From, string To, string VariantName = ""> { string FromMnemonic = From; string ToMnemonic = To; + string AsmVariantName = VariantName; // Predicates - Predicates that must be true for this remapping to happen. list<Predicate> Predicates = []; |