forked from OSchip/llvm-project
Parenthesize match expression to avoid operator precedence issues
PiperOrigin-RevId: 255435454
This commit is contained in:
parent
bda669beea
commit
7b5f49af76
|
@ -55,7 +55,7 @@ def : Pattern<(OpA:$res_a $operand, $attr),
|
|||
// CHECK: s.operand = op0->getOperand(0);
|
||||
// CHECK: attr = op0->getAttrOfType<IntegerAttr>("attr");
|
||||
// CHECK: s.attr = attr;
|
||||
// CHECK: if (!(s.res_a->hasOneUse())) return matchFailure();
|
||||
// CHECK: if (!((s.res_a->hasOneUse()))) return matchFailure();
|
||||
|
||||
// Test bound results in result pattern
|
||||
// ---
|
||||
|
|
|
@ -429,7 +429,7 @@ void PatternEmitter::emitMatchMethod(DagNode tree) {
|
|||
auto &entities = appliedConstraint.entities;
|
||||
|
||||
auto condition = constraint.getConditionTemplate();
|
||||
auto cmd = "if (!{0}) return matchFailure();\n";
|
||||
auto cmd = "if (!({0})) return matchFailure();\n";
|
||||
|
||||
if (isa<TypeConstraint>(constraint)) {
|
||||
auto self = formatv("(*{0}->result_type_begin())",
|
||||
|
|
Loading…
Reference in New Issue