summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/FastISelEmitter.cpp
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
commite99956eb3ee6003ba104e9dbf062796b61fc369c (patch)
tree6de9f8e818e4bf2eb7959b429e482d5fe927a299 /llvm/utils/TableGen/FastISelEmitter.cpp
parentb9bfd0945aaee4eef416ff6becec6154815d53e4 (diff)
downloadbcm5719-llvm-e99956eb3ee6003ba104e9dbf062796b61fc369c.tar.gz
bcm5719-llvm-e99956eb3ee6003ba104e9dbf062796b61fc369c.zip
Change assert to diagnostic. Message still needs work, but it's better than
an assert, at least. llvm-svn: 121166
Diffstat (limited to 'llvm/utils/TableGen/FastISelEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/FastISelEmitter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp
index 0039506f621..2c7a91eea52 100644
--- a/llvm/utils/TableGen/FastISelEmitter.cpp
+++ b/llvm/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;
}
}
OpenPOWER on IntegriCloud