summaryrefslogtreecommitdiff
path: root/include/llvm/Target/Target.td
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-05-20 09:17:16 +0000
committerTim Northover <tnorthover@apple.com>2014-05-20 09:17:16 +0000
commitc9ff20e8c646764f802520a5d3f1c17050123f32 (patch)
tree4c93d0024d11bc043d66c0f524e8f1dd9946619d /include/llvm/Target/Target.td
parent0d0bab5168239afddcc6a4fbcc73b101b570f563 (diff)
downloadllvm-c9ff20e8c646764f802520a5d3f1c17050123f32.tar.gz
llvm-c9ff20e8c646764f802520a5d3f1c17050123f32.tar.bz2
llvm-c9ff20e8c646764f802520a5d3f1c17050123f32.tar.xz
TableGen: convert InstAlias's Emit bit to an int.
When multiple aliases overlap, the correct string to print can often be determined purely by considering the InstAlias declarations in some particular order. This allows the user to specify that order manually when desired, without resorting to hacking around with the default lexicographical order on Record instantiation, which is error-prone and ugly. I was also mistaken about "add w2, w3, w4" being the same as "add w2, w3, w4, uxtw". That's only true if Rn is the stack pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/Target.td')
-rw-r--r--include/llvm/Target/Target.td9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/Target/Target.td b/include/llvm/Target/Target.td
index facb89ade6..7d1f19c477 100644
--- a/include/llvm/Target/Target.td
+++ b/include/llvm/Target/Target.td
@@ -950,10 +950,15 @@ class MnemonicAlias<string From, string To, string VariantName = ""> {
/// InstAlias - This defines an alternate assembly syntax that is allowed to
/// match an instruction that has a different (more canonical) assembly
/// representation.
-class InstAlias<string Asm, dag Result, bit Emit = 0b1> {
+class InstAlias<string Asm, dag Result, int Emit = 1> {
string AsmString = Asm; // The .s format to match the instruction with.
dag ResultInst = Result; // The MCInst to generate.
- bit EmitAlias = Emit; // Emit the alias instead of what's aliased.
+
+ // This determines which order the InstPrinter detects aliases for
+ // printing. A larger value makes the alias more likely to be
+ // emitted. The Instruction's own definition is notionally 0.5, so 0
+ // disables printing and 1 enables it if there are no conflicting aliases.
+ int EmitPriority = Emit;
// Predicates - Predicates that must be true for this to match.
list<Predicate> Predicates = [];