[llvm] 4cc5a97 - MC: mark `dump` with `LLVM_DUMP_METHOD`

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu May 27 10:48:00 PDT 2021


Author: Saleem Abdulrasool
Date: 2021-05-27T10:47:39-07:00
New Revision: 4cc5a971010efd48c60820b17c8de8ed086aa45f

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

LOG: MC: mark `dump` with `LLVM_DUMP_METHOD`

Mark the `ELFRelocationEntry::dump` method as `LLVM_DUMP_METHOD` to
annotate it properly as used to prevent the function being dead stripped
away.  This allows use of `dump` in the debugger.  This is purely to
improve the developer experience.

Added: 
    

Modified: 
    llvm/include/llvm/MC/MCELFObjectWriter.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/MC/MCELFObjectWriter.h b/llvm/include/llvm/MC/MCELFObjectWriter.h
index 5d99c494b11eb..9f4b8de7947b5 100644
--- a/llvm/include/llvm/MC/MCELFObjectWriter.h
+++ b/llvm/include/llvm/MC/MCELFObjectWriter.h
@@ -47,7 +47,7 @@ struct ELFRelocationEntry {
         << ", OriginalAddend=" << OriginalAddend;
   }
 
-  void dump() const { print(errs()); }
+  LLVM_DUMP_METHOD void dump() const { print(errs()); }
 };
 
 class MCELFObjectTargetWriter : public MCObjectTargetWriter {


        


More information about the llvm-commits mailing list