<div dir="ltr">OK, actually not too bad, just need to patch 5 files:<div><br></div><div><div>llvm_clang/v3.5/src/include/llvm/ADT/IntrusiveRefCntPtr.h</div><div>llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/CostAllocator.h</div><div>llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/Math.h</div><div>llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/RegAllocSolver.h</div><div>llvm_clang/v3.5/src/tools/clang/lib/Serialization/ASTWriter.cpp<br></div><div><br></div><div><br></div><div><div>--- llvm_clang/v3.5/src/include/llvm/ADT/IntrusiveRefCntPtr.h       2015-10-03 12:00:11.000000000 -0700</div><div>+++ llvm_clang/v3.5/src/include/llvm/ADT/IntrusiveRefCntPtr.h  2015-10-03 12:00:11.000000000 -0700</div><div>@@ -197,6 +197,9 @@</div><div>   private:</div><div>     void retain() { if (Obj) IntrusiveRefCntPtrInfo<T>::retain(Obj); }</div><div>     void release() { if (Obj) IntrusiveRefCntPtrInfo<T>::release(Obj); }</div><div>+</div><div>+    template <typename X></div><div>+    friend class IntrusiveRefCntPtr;</div><div>   };</div><div> </div><div>   template<class T, class U></div><div>--- llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/CostAllocator.h   2015-10-03 12:00:11.000000000 -0700</div><div>+++ llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/CostAllocator.h      2015-10-03 12:00:11.000000000 -0700</div><div>@@ -87,10 +87,10 @@</div><div>                !std::is_same<PoolEntry*,</div><div>                              typename std::remove_const<CostKeyT>::type>::value,</div><div>                bool>::type</div><div>-    operator()(const PoolEntry* a, const CostKeyT &b) {</div><div>+    operator()(const PoolEntry* a, const CostKeyT &b) const {</div><div>       return compare(a->getCost(), b);</div><div>     }</div><div>-    bool operator()(const PoolEntry* a, const PoolEntry* b) {</div><div>+    bool operator()(const PoolEntry* a, const PoolEntry* b) const {</div><div>       return compare(a->getCost(), b->getCost());</div><div>     }</div><div>   private:</div><div>--- llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/Math.h    2015-10-03 12:00:11.000000000 -0700</div><div>+++ llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/Math.h       2015-10-03 12:00:11.000000000 -0700</div><div>@@ -138,7 +138,7 @@</div><div> </div><div> class VectorComparator {</div><div> public:</div><div>-  bool operator()(const Vector &A, const Vector &B) {</div><div>+  bool operator()(const Vector &A, const Vector &B) const {</div><div>     if (A.Length < B.Length)</div><div>       return true;</div><div>     if (B.Length < A.Length)</div><div>@@ -386,7 +386,7 @@</div><div> </div><div> class MatrixComparator {</div><div> public:</div><div>-  bool operator()(const Matrix &A, const Matrix &B) {</div><div>+  bool operator()(const Matrix &A, const Matrix &B) const {</div><div>     if (A.Rows < B.Rows)</div><div>       return true;</div><div>     if (B.Rows < A.Rows)</div><div>--- llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/RegAllocSolver.h  2015-10-03 12:00:11.000000000 -0700</div><div>+++ llvm_clang/v3.5/src/include/llvm/CodeGen/PBQP/RegAllocSolver.h     2015-10-03 12:00:11.000000000 -0700</div><div>@@ -328,7 +328,7 @@</div><div>       class SpillCostComparator {</div><div>       public:</div><div>         SpillCostComparator(const Graph& G) : G(G) {}</div><div>-        bool operator()(NodeId N1Id, NodeId N2Id) {</div><div>+        bool operator()(NodeId N1Id, NodeId N2Id) const {</div><div>           PBQPNum N1SC = G.getNodeCosts(N1Id)[0] / G.getNodeDegree(N1Id);</div><div>           PBQPNum N2SC = G.getNodeCosts(N2Id)[0] / G.getNodeDegree(N2Id);</div><div>           return N1SC < N2SC;</div><div>--- llvm_clang/v3.5/src/tools/clang/lib/Serialization/ASTWriter.cpp 2015-10-03 12:00:11.000000000 -0700</div><div>+++ llvm_clang/v3.5/src/tools/clang/lib/Serialization/ASTWriter.cpp    2015-10-03 12:00:11.000000000 -0700</div><div>@@ -59,14 +59,14 @@</div><div> using namespace clang::serialization;</div><div> </div><div> template <typename T, typename Allocator></div><div>-static StringRef data(const std::vector<T, Allocator> &v) {</div><div>+static StringRef bytes(const std::vector<T, Allocator> &v) {</div><div>   if (v.empty()) return StringRef();</div><div>   return StringRef(reinterpret_cast<const char*>(&v[0]),</div><div>                          sizeof(T) * v.size());</div><div> }</div><div> </div><div> template <typename T></div><div>-static StringRef data(const SmallVectorImpl<T> &v) {</div><div>+static StringRef bytes(const SmallVectorImpl<T> &v) {</div><div>   return StringRef(reinterpret_cast<const char*>(v.data()),</div><div>                          sizeof(T) * v.size());</div><div> }</div><div>@@ -1402,7 +1402,7 @@</div><div>   Record.push_back(INPUT_FILE_OFFSETS);</div><div>   Record.push_back(InputFileOffsets.size());</div><div>   Record.push_back(UserFilesNum);</div><div>-  Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, data(InputFileOffsets));</div><div>+  Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, bytes(InputFileOffsets));</div><div> }</div><div> </div><div> //===----------------------------------------------------------------------===//</div><div>@@ -1796,7 +1796,7 @@</div><div>   Record.push_back(SOURCE_LOCATION_OFFSETS);</div><div>   Record.push_back(SLocEntryOffsets.size());</div><div>   Record.push_back(SourceMgr.getNextLocalOffset() - 1); // skip dummy</div><div>-  Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, data(SLocEntryOffsets));</div><div>+  Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, bytes(SLocEntryOffsets));</div><div> </div><div>   // Write the source location entry preloads array, telling the AST</div><div>   // reader which source locations entries it should load eagerly.</div><div>@@ -2122,7 +2122,7 @@</div><div>   Record.push_back(MacroOffsets.size());</div><div>   Record.push_back(FirstMacroID - NUM_PREDEF_MACRO_IDS);</div><div>   Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record,</div><div>-                            data(MacroOffsets));</div><div>+                            bytes(MacroOffsets));</div><div> }</div><div> </div><div> void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) {</div><div>@@ -2220,7 +2220,7 @@</div><div>     Record.push_back(PPD_ENTITIES_OFFSETS);</div><div>     Record.push_back(FirstPreprocessorEntityID - NUM_PREDEF_PP_ENTITY_IDS);</div><div>     Stream.EmitRecordWithBlob(PPEOffsetAbbrev, Record,</div><div>-                              data(PreprocessedEntityOffsets));</div><div>+                              bytes(PreprocessedEntityOffsets));</div><div>   }</div><div> }</div><div> </div><div>@@ -2583,7 +2583,7 @@</div><div>   Record.push_back(CXX_BASE_SPECIFIER_OFFSETS);</div><div>   Record.push_back(CXXBaseSpecifiersOffsets.size());</div><div>   Stream.EmitRecordWithBlob(BaseSpecifierOffsetAbbrev, Record,</div><div>-                            data(CXXBaseSpecifiersOffsets));</div><div>+                            bytes(CXXBaseSpecifiersOffsets));</div><div> }</div><div> </div><div> //===----------------------------------------------------------------------===//</div><div>@@ -2657,7 +2657,7 @@</div><div>     Decls.push_back(std::make_pair(D->getKind(), GetDeclRef(D)));</div><div> </div><div>   ++NumLexicalDeclContexts;</div><div>-  Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, data(Decls));</div><div>+  Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, bytes(Decls));</div><div>   return Offset;</div><div> }</div><div> </div><div>@@ -2676,7 +2676,7 @@</div><div>   Record.push_back(TYPE_OFFSET);</div><div>   Record.push_back(TypeOffsets.size());</div><div>   Record.push_back(FirstTypeID - NUM_PREDEF_TYPE_IDS);</div><div>-  Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, data(TypeOffsets));</div><div>+  Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets));</div><div> </div><div>   // Write the declaration offsets array</div><div>   Abbrev = new BitCodeAbbrev();</div><div>@@ -2689,7 +2689,7 @@</div><div>   Record.push_back(DECL_OFFSET);</div><div>   Record.push_back(DeclOffsets.size());</div><div>   Record.push_back(FirstDeclID - NUM_PREDEF_DECL_IDS);</div><div>-  Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, data(DeclOffsets));</div><div>+  Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets));</div><div> }</div><div> </div><div> void ASTWriter::WriteFileDeclIDsMap() {</div><div>@@ -2714,7 +2714,7 @@</div><div>   unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);</div><div>   Record.push_back(FILE_SORTED_DECLS);</div><div>   Record.push_back(FileSortedIDs.size());</div><div>-  Stream.EmitRecordWithBlob(AbbrevCode, Record, data(FileSortedIDs));</div><div>+  Stream.EmitRecordWithBlob(AbbrevCode, Record, bytes(FileSortedIDs));</div><div> }</div><div> </div><div> void ASTWriter::WriteComments() {</div><div>@@ -2937,7 +2937,7 @@</div><div>     Record.push_back(SelectorOffsets.size());</div><div>     Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS);</div><div>     Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record,</div><div>-                              data(SelectorOffsets));</div><div>+                              bytes(SelectorOffsets));</div><div>   }</div><div> }</div><div> </div><div>@@ -3360,7 +3360,7 @@</div><div>   Record.push_back(IdentifierOffsets.size());</div><div>   Record.push_back(FirstIdentID - NUM_PREDEF_IDENT_IDS);</div><div>   Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record,</div><div>-                            data(IdentifierOffsets));</div><div>+                            bytes(IdentifierOffsets));</div><div> }</div><div> </div><div> //===----------------------------------------------------------------------===//</div><div>@@ -4227,7 +4227,7 @@</div><div>   Record.clear();</div><div>   Record.push_back(TU_UPDATE_LEXICAL);</div><div>   Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record,</div><div>-                            data(NewGlobalDecls));</div><div>+                            bytes(NewGlobalDecls));</div><div>   </div><div>   // And a visible updates block for the translation unit.</div><div>   Abv = new llvm::BitCodeAbbrev();</div></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 16, 2016 at 1:29 PM, Welson Sun <span dir="ltr"><<a href="mailto:welson.sun@gmail.com" target="_blank">welson.sun@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I have been using Visual Studio 2012 to compile llvm+clang v3.5 without any problems. Recently, the build team decided to upgrade VS2012 to VS2015, and now instead of 0 errors, there are 25 errors during VS2015 compilation. For example:</div><div><br></div><div>






<p style="margin:0in;font-family:Calibri;font-size:11pt">v3.5\src\include\llvm/ADT/IntrusiveRefCntPtr.h(158):
error C2248:
'llvm::IntrusiveRefCntPtr<`anonymous-namespace'::ChainedIncludesSource>::Obj':
cannot access private member declared in class
'llvm::IntrusiveRefCntPtr<`anonymous-namespace'::ChainedIncludesSource>'</p></div><br clear="all"><div>Just curious anybody has tried this combination?</div><div><br></div>Thanks,<br><div data-smartmail="gmail_signature"><div dir="ltr">- Welson<br><div><div><div><br></div></div></div></div></div>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">- Welson<br><div><div><div><br></div></div></div></div></div>
</div>