summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-06-26 22:58:01 +0000
committerJim Grosbach <grosbach@apple.com>2012-06-26 22:58:01 +0000
commit8ccdbd19c89e9abc7d55e6b439e8f05561771053 (patch)
tree022cc22cdb52d420b40d21cb2a6a9d878f86d6cf /llvm/utils/TableGen
parente02a1f8cf2b7f13764242a4ea35e4a85ffc675e9 (diff)
downloadbcm5719-llvm-8ccdbd19c89e9abc7d55e6b439e8f05561771053.tar.gz
bcm5719-llvm-8ccdbd19c89e9abc7d55e6b439e8f05561771053.zip
TableGen: AsmMatcher diagnostics preference detail.
Don't override a custom diagnostic w/ a generic InvalidOperand, all else being equal. llvm-svn: 159238
Diffstat (limited to 'llvm/utils/TableGen')
-rw-r--r--llvm/utils/TableGen/AsmMatcherEmitter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/AsmMatcherEmitter.cpp b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
index fb8d7048143..f5e094e486a 100644
--- a/llvm/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/llvm/utils/TableGen/AsmMatcherEmitter.cpp
@@ -2663,7 +2663,9 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
OS << " if (!HadMatchOtherThanPredicate &&\n";
OS << " (it == MnemonicRange.first || ErrorInfo <= i+1)) {\n";
OS << " ErrorInfo = i+1;\n";
- OS << " RetCode = Diag;\n";
+ OS << " // InvalidOperand is the default. Prefer specificity.\n";
+ OS << " if (Diag != Match_InvalidOperand)\n";
+ OS << " RetCode = Diag;\n";
OS << " }\n";
OS << " // Otherwise, just reject this instance of the mnemonic.\n";
OS << " OperandsValid = false;\n";
OpenPOWER on IntegriCloud