[llvm] 59686bb - [IPO] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 17:25:07 PST 2022


Author: Kazu Hirata
Date: 2022-12-13T17:25:01-08:00
New Revision: 59686bb3fc239c4a29164fdf1dcc7dd7b74d4788

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

LOG: [IPO] Fix a warning

This patch fixes:

  llvm/lib/Transforms/IPO/AttributorAttributes.cpp:1028:21: error:
  unused function 'operator<<' [-Werror,-Wunused-function]

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 420c8b568e198..1dd0bcf55e1ac 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -1025,6 +1025,7 @@ struct OffsetInfo {
   void merge(const OffsetInfo &R) { Offsets.append(R.Offsets); }
 };
 
+#ifndef NDEBUG
 static raw_ostream &operator<<(raw_ostream &OS, const OffsetInfo &OI) {
   ListSeparator LS;
   OS << "[";
@@ -1034,6 +1035,7 @@ static raw_ostream &operator<<(raw_ostream &OS, const OffsetInfo &OI) {
   OS << "]";
   return OS;
 }
+#endif // NDEBUG
 
 struct AAPointerInfoImpl
     : public StateWrapper<AA::PointerInfo::State, AAPointerInfo> {


        


More information about the llvm-commits mailing list