summaryrefslogtreecommitdiff
path: root/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
commit997759ac22dc1de6f324b1c09c0a2a558236c489 (patch)
tree460a74c5f3edbd23d94eca2ad5967578e42fdc4c /utils/TableGen/FastISelEmitter.cpp
parent52e635ea3512cfcd03587201b20100074e5b6ac9 (diff)
downloadllvm-997759ac22dc1de6f324b1c09c0a2a558236c489.tar.gz
llvm-997759ac22dc1de6f324b1c09c0a2a558236c489.tar.bz2
llvm-997759ac22dc1de6f324b1c09c0a2a558236c489.tar.xz
Add source Record* reference to PatternToMatch. Allows better diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/FastISelEmitter.cpp')
-rw-r--r--utils/TableGen/FastISelEmitter.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/utils/TableGen/FastISelEmitter.cpp b/utils/TableGen/FastISelEmitter.cpp
index 399894f78d..f01de1dcfc 100644
--- a/utils/TableGen/FastISelEmitter.cpp
+++ b/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;
}
}