mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-08 18:30:04 +00: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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164256 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdac1be34a
commit
eb79b545fc
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user