diff options
author | Owen Anderson <resistor@mac.com> | 2012-09-19 22:15:06 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2012-09-19 22:15:06 +0000 |
commit | dee6583dfd336af67983213194607adb4dc7febf (patch) | |
tree | bacd4ba7080fe30449f80d91fee5fd68548d060b /llvm/utils | |
parent | 39def1f7c039dfe5c94164f535e26044cc350acd (diff) | |
download | bcm5719-llvm-dee6583dfd336af67983213194607adb4dc7febf.tar.gz bcm5719-llvm-dee6583dfd336af67983213194607adb4dc7febf.zip |
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).
llvm-svn: 164256
Diffstat (limited to 'llvm/utils')
-rw-r--r-- | llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp index 443a6622adf..c91ec95e2e5 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp +++ b/llvm/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. |