Skip to content

Commit 1f00acc

Browse files
committed
Address review feedback
1 parent 48088ba commit 1f00acc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/include/clang/CIR/Dialect/IR/CIROps.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,7 @@ def CIR_SwitchOp : CIR_Op<"switch", [
11781178
//===----------------------------------------------------------------------===//
11791179

11801180
def CIR_IsConstantOp : CIR_Op<"is_constant", [Pure]> {
1181+
let summary = "Test for manifest compile-time constant";
11811182
let description = [{
11821183
Returns `true` if the argument is known to be a manifest compile-time
11831184
constant otherwise returns `false`. If the argument is a constant expression

clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,8 +577,8 @@ RValue CIRGenFunction::emitBuiltinExpr(const GlobalDecl &gd, unsigned builtinID,
577577

578578
mlir::Value result = cir::IsConstantOp::create(
579579
builder, getLoc(e->getSourceRange()), argValue);
580-
if (result.getType() != resultType)
581-
result = builder.createBoolToInt(result, resultType);
580+
// IsConstantOp returns a bool, but __builtin_constant_p returns an int.
581+
result = builder.createBoolToInt(result, resultType);
582582
return RValue::get(result);
583583
}
584584
case Builtin::BI__builtin_dynamic_object_size:

0 commit comments

Comments
 (0)