From a4cfb620dfe6a694fcb578d84ca252f0da473388 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Thu, 16 Jun 2016 07:00:19 +0000 Subject: Attempt to define friend function more portably. Patch written by Reid. I verified it locally with clang. llvm-svn: 272875 --- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp') diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index ca40bff4f97..774650b0c55 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -601,7 +601,6 @@ private: /// A list of blocks that we are going to CSE. SetVector CSEBlocks; -public: // Workaround for MSVC friend semantics. /// Contains all scheduling relevant data for an instruction. /// A ScheduleData either represents a single instruction or a member of an /// instruction bundle (= a group of instructions which is combined into a @@ -731,11 +730,13 @@ public: // Workaround for MSVC friend semantics. /// dry-run). bool IsScheduled; }; -private: #ifndef NDEBUG - friend raw_ostream &operator<<(raw_ostream &os, - const BoUpSLP::ScheduleData &SD); + friend inline raw_ostream &operator<<(raw_ostream &os, + const BoUpSLP::ScheduleData &SD) { + SD.dump(os); + return os; + } #endif /// Contains all scheduling data for a basic block. @@ -945,21 +946,9 @@ private: MapVector MinBWs; }; -#ifndef NDEBUG -raw_ostream &operator<<(raw_ostream &os, const BoUpSLP::ScheduleData &SD); -#endif - } // end namespace llvm } // end namespace slpvectorizer -#ifndef NDEBUG -raw_ostream &llvm::slpvectorizer::operator<<(raw_ostream &os, - const BoUpSLP::ScheduleData &SD) { - SD.dump(os); - return os; -} -#endif - void BoUpSLP::buildTree(ArrayRef Roots, ArrayRef UserIgnoreLst) { deleteTree(); -- cgit v1.2.3