-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[CIR][NFC] Fix an unused variable warning #138415
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
Conversation
@llvm/pr-subscribers-clangir Author: Amr Hesham (AmrDeveloper) ChangesThis fixes a warning where a variable assigned in 'if' statement wasn't referenced again. Full diff: https://github.com/llvm/llvm-project/pull/138415.diff 1 Files Affected:
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
index ab1ea07bbf5ef..2d8550fad454c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
@@ -90,9 +90,10 @@ class ConstExprEmitter
}
mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) {
- if (const auto *ece = dyn_cast<ExplicitCastExpr>(e))
+ if (isa<ExplicitCastExpr>(e))
cgm.errorNYI(e->getBeginLoc(),
"ConstExprEmitter::VisitCastExpr explicit cast");
+
Expr *subExpr = e->getSubExpr();
switch (e->getCastKind()) {
|
@llvm/pr-subscribers-clang Author: Amr Hesham (AmrDeveloper) ChangesThis fixes a warning where a variable assigned in 'if' statement wasn't referenced again. Full diff: https://github.com/llvm/llvm-project/pull/138415.diff 1 Files Affected:
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
index ab1ea07bbf5ef..2d8550fad454c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
@@ -90,9 +90,10 @@ class ConstExprEmitter
}
mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) {
- if (const auto *ece = dyn_cast<ExplicitCastExpr>(e))
+ if (isa<ExplicitCastExpr>(e))
cgm.errorNYI(e->getBeginLoc(),
"ConstExprEmitter::VisitCastExpr explicit cast");
+
Expr *subExpr = e->getSubExpr();
switch (e->getCastKind()) {
|
6acc708
to
1b43e41
Compare
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.
lgtm
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/174/builds/17189 Here is the relevant piece of the build log for the reference
|
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.