[CIR][NFC] Fix warnings in release builds (#168791)

This fixes several warnings that occur in CIR release builds.
This commit is contained in:
Andy Kaylor 2025-11-19 16:12:17 -08:00 committed by GitHub
parent ff39d59000
commit ef0cd1dae3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 5 deletions

View File

@ -292,7 +292,7 @@ emitSuspendExpression(CIRGenFunction &cgf, CGCoroData &coro,
AggValueSlot aggSlot, bool ignoreResult,
mlir::Block *scopeParentBlock,
mlir::Value &tmpResumeRValAddr, bool forLValue) {
mlir::LogicalResult awaitBuild = mlir::success();
[[maybe_unused]] mlir::LogicalResult awaitBuild = mlir::success();
LValueOrRValue awaitRes;
CIRGenFunction::OpaqueValueMapping binder =

View File

@ -425,7 +425,7 @@ void CIRGenFunction::exitCXXTryStmt(const CXXTryStmt &s, bool isFnTryBlock) {
assert(!cir::MissingFeatures::incrementProfileCounter());
// Perform the body of the catch.
mlir::LogicalResult emitResult =
[[maybe_unused]] mlir::LogicalResult emitResult =
emitStmt(catchStmt->getHandlerBlock(), /*useCurrentScope=*/true);
assert(emitResult.succeeded() && "failed to emit catch handler block");

View File

@ -426,7 +426,7 @@ static mlir::Value emitCXXNewAllocSize(CIRGenFunction &cgf, const CXXNewExpr *e,
const llvm::APInt &count =
mlir::cast<cir::IntAttr>(constNumElements).getValue();
unsigned numElementsWidth = count.getBitWidth();
[[maybe_unused]] unsigned numElementsWidth = count.getBitWidth();
bool hasAnyOverflow = false;
// The equivalent code in CodeGen/CGExprCXX.cpp handles these cases as

View File

@ -459,7 +459,8 @@ void CIRGenItaniumCXXABI::emitVTableDefinitions(CIRGenVTables &cgvt,
"emitVTableDefinitions: __fundamental_type_info");
}
auto vtableAsGlobalValue = dyn_cast<cir::CIRGlobalValueInterface>(*vtable);
[[maybe_unused]] auto vtableAsGlobalValue =
dyn_cast<cir::CIRGlobalValueInterface>(*vtable);
assert(vtableAsGlobalValue && "VTable must support CIRGlobalValueInterface");
// Always emit type metadata on non-available_externally definitions, and on
// available_externally definitions if we are performing whole program

View File

@ -462,7 +462,7 @@ static mlir::Type higherPrecisionElementTypeForComplexArithmetic(
return info.getFloat128Format();
}
assert(false && "Unsupported float type semantics");
llvm_unreachable("Unsupported float type semantics");
};
const mlir::Type higherElementType = getHigherPrecisionFPType(elementType);