]> granicus.if.org Git - llvm/commitdiff
Work around MSVC "friend" semantics.
authorSean Silva <chisophugis@gmail.com>
Wed, 15 Jun 2016 10:51:40 +0000 (10:51 +0000)
committerSean Silva <chisophugis@gmail.com>
Wed, 15 Jun 2016 10:51:40 +0000 (10:51 +0000)
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

index a19ebfbc87cc7461e524d2e1cbe8950b94003623..ca40bff4f97a24b78d744940c01b866645fb51c2 100644 (file)
@@ -601,6 +601,7 @@ private:
   /// A list of blocks that we are going to CSE.
   SetVector<BasicBlock *> 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,