[flang-commits] [flang] c12ef70 - [flang][driver] Add missing parentheses in an assert

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Thu May 5 11:03:08 PDT 2022


Author: Andrzej Warzynski
Date: 2022-05-05T18:02:30Z
New Revision: c12ef70d2b0ac6234feb48e01eb954dd753bb538

URL: https://github.com/llvm/llvm-project/commit/c12ef70d2b0ac6234feb48e01eb954dd753bb538
DIFF: https://github.com/llvm/llvm-project/commit/c12ef70d2b0ac6234feb48e01eb954dd753bb538.diff

LOG: [flang][driver] Add missing parentheses in an assert

The assert in https://reviews.llvm.org/D124665 was missing parentheses,
which triggered a warning in GCC (verified with GCC 11). As `-Werror` is
on by default in FLang, that triggered build errors, see e.g. [1].

The fix is rather straightforward, so I am sending this without a
review.

[1] https://lab.llvm.org/buildbot/#/builders/160/builds/7016

Differential Revision: https://reviews.llvm.org/D125027

Added: 
    

Modified: 
    flang/lib/Frontend/FrontendActions.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Frontend/FrontendActions.cpp b/flang/lib/Frontend/FrontendActions.cpp
index 2ff121d2a241cb..395adefa7933cd 100644
--- a/flang/lib/Frontend/FrontendActions.cpp
+++ b/flang/lib/Frontend/FrontendActions.cpp
@@ -533,9 +533,9 @@ static void GenerateMachineCodeOrAssemblyImpl(clang::DiagnosticsEngine &diags,
                                               BackendActionTy act,
                                               llvm::Module &llvmModule,
                                               llvm::raw_pwrite_stream &os) {
-  assert((act == BackendActionTy::Backend_EmitObj) ||
-         (act == BackendActionTy::Backend_EmitAssembly) &&
-             "Unsupported action");
+  assert(((act == BackendActionTy::Backend_EmitObj) ||
+          (act == BackendActionTy::Backend_EmitAssembly)) &&
+         "Unsupported action");
 
   // Set-up the pass manager, i.e create an LLVM code-gen pass pipeline.
   // Currently only the legacy pass manager is supported.


        


More information about the flang-commits mailing list