Skip to content

Commit f548440

Browse files
andykayloraadeshps-mcw
authored andcommitted
[CIR][NFC] Fix warnings in release builds (llvm#168791)
This fixes several warnings that occur in CIR release builds.
1 parent 1a9a487 commit f548440

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenCoroutine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ emitSuspendExpression(CIRGenFunction &cgf, CGCoroData &coro,
292292
AggValueSlot aggSlot, bool ignoreResult,
293293
mlir::Block *scopeParentBlock,
294294
mlir::Value &tmpResumeRValAddr, bool forLValue) {
295-
mlir::LogicalResult awaitBuild = mlir::success();
295+
[[maybe_unused]] mlir::LogicalResult awaitBuild = mlir::success();
296296
LValueOrRValue awaitRes;
297297

298298
CIRGenFunction::OpaqueValueMapping binder =

clang/lib/CIR/CodeGen/CIRGenException.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ void CIRGenFunction::exitCXXTryStmt(const CXXTryStmt &s, bool isFnTryBlock) {
425425
assert(!cir::MissingFeatures::incrementProfileCounter());
426426

427427
// Perform the body of the catch.
428-
mlir::LogicalResult emitResult =
428+
[[maybe_unused]] mlir::LogicalResult emitResult =
429429
emitStmt(catchStmt->getHandlerBlock(), /*useCurrentScope=*/true);
430430
assert(emitResult.succeeded() && "failed to emit catch handler block");
431431

clang/lib/CIR/CodeGen/CIRGenExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ static mlir::Value emitCXXNewAllocSize(CIRGenFunction &cgf, const CXXNewExpr *e,
426426
const llvm::APInt &count =
427427
mlir::cast<cir::IntAttr>(constNumElements).getValue();
428428

429-
unsigned numElementsWidth = count.getBitWidth();
429+
[[maybe_unused]] unsigned numElementsWidth = count.getBitWidth();
430430
bool hasAnyOverflow = false;
431431

432432
// The equivalent code in CodeGen/CGExprCXX.cpp handles these cases as

clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ void CIRGenItaniumCXXABI::emitVTableDefinitions(CIRGenVTables &cgvt,
459459
"emitVTableDefinitions: __fundamental_type_info");
460460
}
461461

462-
auto vtableAsGlobalValue = dyn_cast<cir::CIRGlobalValueInterface>(*vtable);
462+
[[maybe_unused]] auto vtableAsGlobalValue =
463+
dyn_cast<cir::CIRGlobalValueInterface>(*vtable);
463464
assert(vtableAsGlobalValue && "VTable must support CIRGlobalValueInterface");
464465
// Always emit type metadata on non-available_externally definitions, and on
465466
// available_externally definitions if we are performing whole program

clang/lib/CIR/Dialect/Transforms/LoweringPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static mlir::Type higherPrecisionElementTypeForComplexArithmetic(
462462
return info.getFloat128Format();
463463
}
464464

465-
assert(false && "Unsupported float type semantics");
465+
llvm_unreachable("Unsupported float type semantics");
466466
};
467467

468468
const mlir::Type higherElementType = getHigherPrecisionFPType(elementType);

0 commit comments

Comments
 (0)