[flang-commits] [flang] 910b937 - [flang] Function 'attributeTypeIsCompatible' should be debug only (NFC)

Jie Fu via flang-commits flang-commits at lists.llvm.org
Wed Aug 30 07:28:44 PDT 2023


Author: Jie Fu
Date: 2023-08-30T22:28:35+08:00
New Revision: 910b9372d1bfc72b0aaeecf92206601d76175264

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

LOG: [flang] Function 'attributeTypeIsCompatible' should be debug only (NFC)

/data/home/jiefu/llvm-project/flang/lib/Optimizer/CodeGen/CodeGen.cpp:2905:20: error: unused function 'attributeTypeIsCompatible' [-Werror,-Wunused-function]
static inline bool attributeTypeIsCompatible(mlir::MLIRContext *ctx,
                   ^
1 error generated.

Added: 
    

Modified: 
    flang/lib/Optimizer/CodeGen/CodeGen.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/CodeGen/CodeGen.cpp b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
index 04e40cc759315f..a05f019471dfed 100644
--- a/flang/lib/Optimizer/CodeGen/CodeGen.cpp
+++ b/flang/lib/Optimizer/CodeGen/CodeGen.cpp
@@ -2892,6 +2892,7 @@ struct HasValueOpConversion : public FIROpConversion<fir::HasValueOp> {
   }
 };
 
+#ifndef NDEBUG
 // Check if attr's type is compatible with ty.
 //
 // This is done by comparing attr's element type, converted to LLVM type,
@@ -2927,6 +2928,7 @@ static inline bool attributeTypeIsCompatible(mlir::MLIRContext *ctx,
 
   return attrEleTy == eleTy;
 }
+#endif
 
 /// Lower `fir.global` operation to `llvm.global` operation.
 /// `fir.insert_on_range` operations are replaced with constant dense attribute


        


More information about the flang-commits mailing list