diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/IR/Metadata.h | 9 | ||||
| -rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 3 | 
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/include/llvm/IR/Metadata.h b/llvm/include/llvm/IR/Metadata.h index 6ba0fd41730..a31bdbfac65 100644 --- a/llvm/include/llvm/IR/Metadata.h +++ b/llvm/include/llvm/IR/Metadata.h @@ -106,7 +106,14 @@ public:    ///    /// If \c M is provided, metadata nodes will be numbered canonically;    /// otherwise, pointer addresses are substituted. -  void dump(const Module *M = nullptr) const; +  /// +  /// Note: this uses an explicit overload instead of default arguments so that +  /// the nullptr version is easy to call from a debugger. +  /// +  /// @{ +  void dump() const; +  void dump(const Module *M) const; +  /// @}    /// \brief Print.    /// diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 509fb423ff7..ea6822052d0 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -3290,6 +3290,9 @@ LLVM_DUMP_METHOD  void NamedMDNode::dump() const { print(dbgs()); }  LLVM_DUMP_METHOD +void Metadata::dump() const { dump(nullptr); } + +LLVM_DUMP_METHOD  void Metadata::dump(const Module *M) const {    print(dbgs(), M);    dbgs() << '\n';  | 

