summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/FastISelEmitter.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-12-07 23:05:49 +0000
committerJim Grosbach <grosbach@apple.com>2010-12-07 23:05:49 +0000
commitfb116aed60d637876e9f87f9d5e9653301d091c4 (patch)
treea18bf3085742d5320b59fa42ff533b8c99b3a424 /llvm/utils/TableGen/FastISelEmitter.cpp
parent721724e64318e737625bd524e3fbb45e6ce10539 (diff)
downloadbcm5719-llvm-fb116aed60d637876e9f87f9d5e9653301d091c4.tar.gz
bcm5719-llvm-fb116aed60d637876e9f87f9d5e9653301d091c4.zip
Add source Record* reference to PatternToMatch. Allows better diagnostics.
llvm-svn: 121196
Diffstat (limited to 'llvm/utils/TableGen/FastISelEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/FastISelEmitter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp
index 399894f78d6..f01de1dcfce 100644
--- a/llvm/utils/TableGen/FastISelEmitter.cpp
+++ b/llvm/utils/TableGen/FastISelEmitter.cpp
@@ -381,14 +381,10 @@ void FastISelMap::CollectPatterns(CodeGenDAGPatterns &CGP) {
SubRegNo,
PhysRegInputs
};
- // 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();
- }
+ .count(PredicateCheck))
+ throw TGError(Pattern.getSrcRecord()->getLoc(), "Duplicate record!");
+
SimplePatterns[Operands][OpcodeName][VT][RetVT][PredicateCheck] = Memo;
}
}
OpenPOWER on IntegriCloud