-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[flang][NFC] fix build warning about unused argument #164776
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-openacc Author: None (jeanPerier) ChangesFix warning: Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the if constexpr. Full diff: https://github.com/llvm/llvm-project/pull/164776.diff 1 Files Affected:
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 1fc59c702fd81..d7861ac6463c8 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -816,8 +816,9 @@ static void genDeclareDataOperandOperations(
Fortran::semantics::FindCommonBlockContaining(symbol)) {
emitCommonGlobal(
converter, builder, accObject, dataClause,
- [&](mlir::OpBuilder &modBuilder, mlir::Location loc,
- fir::GlobalOp globalOp, mlir::acc::DataClause clause,
+ [&](mlir::OpBuilder &modBuilder, [[maybe_unused]] mlir::Location loc,
+ [[maybe_unused]] fir::GlobalOp globalOp,
+ [[maybe_unused]] mlir::acc::DataClause clause,
std::stringstream &asFortranStr, const std::string &ctorName) {
if constexpr (std::is_same_v<EntryOp, mlir::acc::DeclareLinkOp>) {
createDeclareGlobalOp<
|
|
@llvm/pr-subscribers-flang-fir-hlfir Author: None (jeanPerier) ChangesFix warning: Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the if constexpr. Full diff: https://github.com/llvm/llvm-project/pull/164776.diff 1 Files Affected:
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 1fc59c702fd81..d7861ac6463c8 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -816,8 +816,9 @@ static void genDeclareDataOperandOperations(
Fortran::semantics::FindCommonBlockContaining(symbol)) {
emitCommonGlobal(
converter, builder, accObject, dataClause,
- [&](mlir::OpBuilder &modBuilder, mlir::Location loc,
- fir::GlobalOp globalOp, mlir::acc::DataClause clause,
+ [&](mlir::OpBuilder &modBuilder, [[maybe_unused]] mlir::Location loc,
+ [[maybe_unused]] fir::GlobalOp globalOp,
+ [[maybe_unused]] mlir::acc::DataClause clause,
std::stringstream &asFortranStr, const std::string &ctorName) {
if constexpr (std::is_same_v<EntryOp, mlir::acc::DeclareLinkOp>) {
createDeclareGlobalOp<
|
rscottmanley
left a comment
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.
Thanks for removing the warnings!
Fix warning about unused arguments. Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the `if constexpr`.
Fix warning about unused arguments. Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the `if constexpr`.
Fix warning about unused arguments. Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the `if constexpr`.
Fix warning:
Just use [[maybe_unsued]] to deal with the fact that these arguments are not always used because of the if constexpr.