Wrap the dumping and printing routines in NDEBUG and LLVM_ENABLE_DUMP macros.
authorChandler Carruth <chandlerc@gmail.com>
Fri, 14 Sep 2012 10:18:51 +0000 (10:18 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 14 Sep 2012 10:18:51 +0000 (10:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163888 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SROA.cpp

index 958f9b3705f5852300ab5b87e5907770b3ed01a7..0534d9f922e657e332c31cae7a0a3e9b565f37b4 100644 (file)
@@ -287,12 +287,14 @@ public:
   /// memcpy are ignored.
   Type *getCommonType(iterator I) const;
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
   void print(raw_ostream &OS, const_iterator I, StringRef Indent = "  ") const;
   void printUsers(raw_ostream &OS, const_iterator I,
                   StringRef Indent = "  ") const;
   void print(raw_ostream &OS) const;
   void LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED dump(const_iterator I) const;
   void LLVM_ATTRIBUTE_NOINLINE LLVM_ATTRIBUTE_USED dump() const;
+#endif
 
 private:
   template <typename DerivedT, typename RetT = void> class BuilderBase;
@@ -1054,6 +1056,8 @@ Type *AllocaPartitioning::getCommonType(iterator I) const {
   return Ty;
 }
 
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+
 void AllocaPartitioning::print(raw_ostream &OS, const_iterator I,
                                StringRef Indent) const {
   OS << Indent << "partition #" << (I - begin())
@@ -1102,6 +1106,8 @@ void AllocaPartitioning::print(raw_ostream &OS) const {
 void AllocaPartitioning::dump(const_iterator I) const { print(dbgs(), I); }
 void AllocaPartitioning::dump() const { print(dbgs()); }
 
+#endif // !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+
 
 namespace {
 /// \brief An optimization pass providing Scalar Replacement of Aggregates.