summaryrefslogtreecommitdiff
path: root/utils/TableGen
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2012-09-19 22:15:06 +0000
committerOwen Anderson <resistor@mac.com>2012-09-19 22:15:06 +0000
commiteb79b545fc347142eba44a7ffd29d426da3281ec (patch)
tree55d04e51783fd12c2f025433340a3cb921cd4739 /utils/TableGen
parentcdac1be34a0b329f1bd2232a3f4995432f633c3c (diff)
downloadllvm-eb79b545fc347142eba44a7ffd29d426da3281ec.tar.gz
llvm-eb79b545fc347142eba44a7ffd29d426da3281ec.tar.bz2
llvm-eb79b545fc347142eba44a7ffd29d426da3281ec.tar.xz
Soften the pattern-can-never-match error in TableGen into a warning. This pattern can be very useful in cases where you want to define a multiclass that covers both commutative and non-commutative operators (say, add and sub).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/CodeGenDAGPatterns.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/TableGen/CodeGenDAGPatterns.cpp b/utils/TableGen/CodeGenDAGPatterns.cpp
index 443a6622ad..c91ec95e2e 100644
--- a/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -2800,8 +2800,11 @@ void CodeGenDAGPatterns::AddPatternToMatch(const TreePattern *Pattern,
const PatternToMatch &PTM) {
// Do some sanity checking on the pattern we're about to match.
std::string Reason;
- if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this))
- Pattern->error("Pattern can never match: " + Reason);
+ if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this)) {
+ PrintWarning(Pattern->getRecord()->getLoc(),
+ Twine("Pattern can never match: ") + Reason);
+ return;
+ }
// If the source pattern's root is a complex pattern, that complex pattern
// must specify the nodes it can potentially match.