IR: Default the Metadata::dump() argument "harder" after r232275
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 15 Mar 2015 06:53:32 +0000 (06:53 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 15 Mar 2015 06:53:32 +0000 (06:53 +0000)
Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.

Other than utility for debugging, there's NFC here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232315 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Metadata.h
lib/IR/AsmWriter.cpp

index 6ba0fd4173004670c02a60d3d7ad8729754ecdc8..a31bdbfac65f19f4370b504ae0e6df93c368959f 100644 (file)
@@ -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.
   ///
index 509fb423ff7e05b77f24c43e50d63a4e6f2fd1f7..ea6822052d01d1f8caaacead9e622ca09f863f32 100644 (file)
@@ -3289,6 +3289,9 @@ void Comdat::dump() const { print(dbgs()); }
 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);