-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[CIR] Fix warnings related to unused variables in release builds #151412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ceabe27
5fa2289
bd8f03b
c794a25
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1472,9 +1472,10 @@ Address CIRGenFunction::emitArrayToPointerDecay(const Expr *e) { | |
if (e->getType()->isVariableArrayType()) | ||
return addr; | ||
|
||
auto pointeeTy = mlir::cast<cir::ArrayType>(lvalueAddrTy.getPointee()); | ||
[[maybe_unused]] auto pointeeTy = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These could be sunk into the asserts, but the expressions would need to be repeated. I was on the fence about which way to go. |
||
mlir::cast<cir::ArrayType>(lvalueAddrTy.getPointee()); | ||
|
||
mlir::Type arrayTy = convertType(e->getType()); | ||
[[maybe_unused]] mlir::Type arrayTy = convertType(e->getType()); | ||
assert(mlir::isa<cir::ArrayType>(arrayTy) && "expected array"); | ||
assert(pointeeTy == arrayTy); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -439,7 +439,7 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> { | |
value = builder.getTrue(cgf.getLoc(e->getExprLoc())); | ||
} else if (type->isIntegerType()) { | ||
QualType promotedType; | ||
bool canPerformLossyDemotionCheck = false; | ||
[[maybe_unused]] bool canPerformLossyDemotionCheck = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is written to but never read. It will be read when sanitizer support is added. |
||
if (cgf.getContext().isPromotableIntegerType(type)) { | ||
promotedType = cgf.getContext().getPromotedIntegerType(type); | ||
assert(promotedType != type && "Shouldn't promote to the same type."); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ironic, isn't it?