From 12d4938ff1061b85a2038c892022889160801643 Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Wed, 15 Jun 2016 10:51:40 +0000 Subject: [PATCH] Work around MSVC "friend" semantics. The error on clang-x86-win2008-selfhost is: C:\buildbot\slave-config\clang-x86-win2008-selfhost\llvm\lib\Transforms\Vectorize\SLPVectorizer.cpp(955) : error C2248: 'llvm::slpvectorizer::BoUpSLP::ScheduleData' : cannot access private struct declared in class 'llvm::slpvectorizer::BoUpSLP' C:\buildbot\slave-config\clang-x86-win2008-selfhost\llvm\lib\Transforms\Vectorize\SLPVectorizer.cpp(608) : see declaration of 'llvm::slpvectorizer::BoUpSLP::ScheduleData' C:\buildbot\slave-config\clang-x86-win2008-selfhost\llvm\lib\Transforms\Vectorize\SLPVectorizer.cpp(337) : see declaration of 'llvm::slpvectorizer::BoUpSLP' I reproduced this locally with both MSVC 2013 and MSVC 2015. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272772 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/Vectorize/SLPVectorizer.cpp b/lib/Transforms/Vectorize/SLPVectorizer.cpp index a19ebfbc87c..ca40bff4f97 100644 --- a/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -601,6 +601,7 @@ 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 @@ -730,6 +731,7 @@ private: /// dry-run). bool IsScheduled; }; +private: #ifndef NDEBUG friend raw_ostream &operator<<(raw_ostream &os, -- 2.50.1