aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/AsmMatcherEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-30 19:47:49 +0000
committerChris Lattner <sabre@nondot.org>2010-10-30 19:47:49 +0000
commit8cf8bcc40c977713e51fb85fb9f24a0ecfbde24b (patch)
treef770ed84c61823a5d1aaacdd171f8a59cddf3de7 /utils/TableGen/AsmMatcherEmitter.cpp
parent0f899c78e18e39a8ccd08386aaa493a1b9a712a3 (diff)
fix typos and some serious bugs in feature handling (but not for
cases that are currently exercised). Thanks to Frits van Bommel for the great review! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/AsmMatcherEmitter.cpp')
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index 999c137109..80f5e0841a 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1571,21 +1571,25 @@ static bool EmitMnemonicAliases(raw_ostream &OS) {
// We can't have two aliases from the same mnemonic with no predicate.
PrintError(ToVec[AliasWithNoPredicate]->getLoc(),
"two MnemonicAliases with the same 'from' mnemonic!");
- PrintError(R->getLoc(), "this is the other MnemonicAliases.");
- throw std::string("ERROR: Invalid MnemonicAliases definitions!");
+ PrintError(R->getLoc(), "this is the other MnemonicAlias.");
+ throw std::string("ERROR: Invalid MnemonicAlias definitions!");
}
AliasWithNoPredicate = i;
continue;
}
+ if (!MatchCode.empty())
+ MatchCode += "else ";
MatchCode += "if ((Features & " + FeatureMask + ") == "+FeatureMask+")\n";
MatchCode += " Mnemonic = \"" +R->getValueAsString("ToMnemonic")+"\";\n";
}
if (AliasWithNoPredicate != -1) {
Record *R = ToVec[AliasWithNoPredicate];
- MatchCode += "Mnemonic = \"" + R->getValueAsString("ToMnemonic") + "\";";
+ if (!MatchCode.empty())
+ MatchCode += "else\n ";
+ MatchCode += "Mnemonic = \"" + R->getValueAsString("ToMnemonic")+"\";\n";
}
MatchCode += "return;";