aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-12-07 19:35:36 +0000
committerJim Grosbach <grosbach@apple.com>2010-12-07 19:35:36 +0000
commit76612b549f176fd6db13c675003232d702c4b2ba (patch)
tree22527ddbe907dd1a552bfd04b10d10e53362a80a /utils
parentbd3af09cef3e628afa480be4923040c29a91d0a3 (diff)
Change assert to diagnostic. Message still needs work, but it's better than
an assert, at least. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/FastISelEmitter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index 0039506f62..2c7a91eea5 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/utils/TableGen/FastISelEmitter.cpp
@@ -20,6 +20,7 @@
#include "FastISelEmitter.h"
#include "Record.h"
#include "llvm/Support/Debug.h"
+#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/VectorExtras.h"
using namespace llvm;
@@ -380,9 +381,14 @@ void FastISelMap::CollectPatterns(CodeGenDAGPatterns &CGP) {
SubRegNo,
PhysRegInputs
};
- assert(!SimplePatterns[Operands][OpcodeName][VT][RetVT]
- .count(PredicateCheck) &&
- "Duplicate pattern!");
+ // FIXME: Source location information for the diagnostic.
+ if (SimplePatterns[Operands][OpcodeName][VT][RetVT]
+ .count(PredicateCheck)) {
+ SmallString<128> PatText;
+ raw_svector_ostream OS(PatText);
+ Pattern.SrcPattern->print(OS);
+ throw "Duplicate record: " + OS.str().str();
+ }
SimplePatterns[Operands][OpcodeName][VT][RetVT][PredicateCheck] = Memo;
}
}