1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

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
This commit is contained in:
Owen Anderson 2012-09-19 22:15:06 +00:00
parent 46c3ebc1a6
commit 76c554cf2a

View File

@ -2800,8 +2800,11 @@ void CodeGenDAGPatterns::AddPatternToMatch(const TreePattern *Pattern,
const PatternToMatch &PTM) { const PatternToMatch &PTM) {
// Do some sanity checking on the pattern we're about to match. // Do some sanity checking on the pattern we're about to match.
std::string Reason; std::string Reason;
if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this)) if (!PTM.getSrcPattern()->canPatternMatch(Reason, *this)) {
Pattern->error("Pattern can never match: " + Reason); PrintWarning(Pattern->getRecord()->getLoc(),
Twine("Pattern can never match: ") + Reason);
return;
}
// If the source pattern's root is a complex pattern, that complex pattern // If the source pattern's root is a complex pattern, that complex pattern
// must specify the nodes it can potentially match. // must specify the nodes it can potentially match.