[llvm] bf9e0ed - [CodeGen] Use LLVM_ATTRIBUTE_UNUSED instead of LLVM_DUMP_METHOD on a raw_ostream operator<<.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 18:13:04 PST 2023


Author: Craig Topper
Date: 2023-02-27T18:12:18-08:00
New Revision: bf9e0ed1e61a407d7b0e133a9980cb8c29fc8ab0

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

LOG: [CodeGen] Use LLVM_ATTRIBUTE_UNUSED instead of LLVM_DUMP_METHOD on a raw_ostream operator<<.

LLVM_DUMP_METHOD includes ATTRIBUTE_NOINLINE. operator<< isn't
what we normally consider a dump method so it should be ok to inline.

This fixes a warning from gcc that some other declaration for some
other class was inline but this one is noinline. Seems like a bogus
warning from gcc really.

Added: 
    

Modified: 
    llvm/lib/CodeGen/ScheduleDAGInstrs.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 6dcb1fac9a8c..3dc76c77aad7 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -1522,7 +1522,7 @@ LLVM_DUMP_METHOD void ILPValue::dump() const {
 
 namespace llvm {
 
-LLVM_DUMP_METHOD
+LLVM_ATTRIBUTE_UNUSED
 raw_ostream &operator<<(raw_ostream &OS, const ILPValue &Val) {
   Val.print(OS);
   return OS;


        


More information about the llvm-commits mailing list