summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-06 20:21:47 +0000
committerChris Lattner <sabre@nondot.org>2010-09-06 20:21:47 +0000
commit87410368e1bd50408e787f6ece0e58d94c53c1e1 (patch)
tree753e113dc101c42ee713db9ab42caf8e3002bb97 /utils
parent69c7249a6f628db393aaa426c9595dccd4a1d87b (diff)
downloadllvm-87410368e1bd50408e787f6ece0e58d94c53c1e1.tar.gz
llvm-87410368e1bd50408e787f6ece0e58d94c53c1e1.tar.bz2
llvm-87410368e1bd50408e787f6ece0e58d94c53c1e1.tar.xz
The "ambiguous instructions" check only produces anything with -debug,
so only do the N^2 loop with debug mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/AsmMatcherEmitter.cpp43
1 files changed, 22 insertions, 21 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp
index c0d95fbc1e..e7f4aa696e 100644
--- a/utils/TableGen/AsmMatcherEmitter.cpp
+++ b/utils/TableGen/AsmMatcherEmitter.cpp
@@ -1513,29 +1513,30 @@ void AsmMatcherEmitter::run(raw_ostream &OS) {
});
// Check for ambiguous instructions.
- unsigned NumAmbiguous = 0;
- for (unsigned i = 0, e = Info.Instructions.size(); i != e; ++i) {
- for (unsigned j = i + 1; j != e; ++j) {
- InstructionInfo &A = *Info.Instructions[i];
- InstructionInfo &B = *Info.Instructions[j];
-
- if (A.CouldMatchAmiguouslyWith(B)) {
- DEBUG_WITH_TYPE("ambiguous_instrs", {
- errs() << "warning: ambiguous instruction match:\n";
- A.dump();
- errs() << "\nis incomparable with:\n";
- B.dump();
- errs() << "\n\n";
- });
- ++NumAmbiguous;
+ DEBUG(unsigned NumAmbiguous = 0;
+ for (unsigned i = 0, e = Info.Instructions.size(); i != e; ++i) {
+ for (unsigned j = i + 1; j != e; ++j) {
+ InstructionInfo &A = *Info.Instructions[i];
+ InstructionInfo &B = *Info.Instructions[j];
+
+ if (A.CouldMatchAmiguouslyWith(B)) {
+ DEBUG_WITH_TYPE("ambiguous_instrs", {
+ errs() << "warning: ambiguous instruction match:\n";
+ A.dump();
+ errs() << "\nis incomparable with:\n";
+ B.dump();
+ errs() << "\n\n";
+ });
+ ++NumAmbiguous;
+ }
}
}
- }
- if (NumAmbiguous)
- DEBUG_WITH_TYPE("ambiguous_instrs", {
- errs() << "warning: " << NumAmbiguous
- << " ambiguous instructions!\n";
- });
+ if (NumAmbiguous)
+ DEBUG_WITH_TYPE("ambiguous_instrs", {
+ errs() << "warning: " << NumAmbiguous
+ << " ambiguous instructions!\n";
+ });
+ );
// Write the output.