From e7c6b244c9db0892b4214f0795bec8c60d7ab4f0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 25 Jul 2017 16:37:55 +0200 Subject: Build: add scripts to build dependencies for Windows and macOS. Note these are intended for platform maintainers, we do not intend to support users making their own builds with these. For that precompiled libraries from lib/ should be used. Implemented by Martijn Berger, Ray Molenkamp and Brecht Van Lommel. Differential Revision: https://developer.blender.org/D2753 --- build_files/build_environment/patches/clang.diff | 127 +++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 build_files/build_environment/patches/clang.diff (limited to 'build_files/build_environment/patches/clang.diff') diff --git a/build_files/build_environment/patches/clang.diff b/build_files/build_environment/patches/clang.diff new file mode 100644 index 00000000000..724e92f8163 --- /dev/null +++ b/build_files/build_environment/patches/clang.diff @@ -0,0 +1,127 @@ +--- cfe/trunk/lib/Serialization/ASTWriter.cpp ++++ cfe/trunk/lib/Serialization/ASTWriter.cpp +@@ -56,14 +56,14 @@ + using namespace clang::serialization; + + template +-static StringRef bytes(const std::vector &v) { ++static StringRef data(const std::vector &v) { + if (v.empty()) return StringRef(); + return StringRef(reinterpret_cast(&v[0]), + sizeof(T) * v.size()); + } + + template +-static StringRef bytes(const SmallVectorImpl &v) { ++static StringRef data(const SmallVectorImpl &v) { + return StringRef(reinterpret_cast(v.data()), + sizeof(T) * v.size()); + } +@@ -1385,7 +1385,7 @@ + Record.push_back(INPUT_FILE_OFFSETS); + Record.push_back(InputFileOffsets.size()); + Record.push_back(UserFilesNum); +- Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, bytes(InputFileOffsets)); ++ Stream.EmitRecordWithBlob(OffsetsAbbrevCode, Record, data(InputFileOffsets)); + } + + //===----------------------------------------------------------------------===// +@@ -1771,7 +1771,7 @@ + Record.push_back(SOURCE_LOCATION_OFFSETS); + Record.push_back(SLocEntryOffsets.size()); + Record.push_back(SourceMgr.getNextLocalOffset() - 1); // skip dummy +- Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, bytes(SLocEntryOffsets)); ++ Stream.EmitRecordWithBlob(SLocOffsetsAbbrev, Record, data(SLocEntryOffsets)); + + // Write the source location entry preloads array, telling the AST + // reader which source locations entries it should load eagerly. +@@ -2087,7 +2087,7 @@ + Record.push_back(MacroOffsets.size()); + Record.push_back(FirstMacroID - NUM_PREDEF_MACRO_IDS); + Stream.EmitRecordWithBlob(MacroOffsetAbbrev, Record, +- bytes(MacroOffsets)); ++ data(MacroOffsets)); + } + + void ASTWriter::WritePreprocessorDetail(PreprocessingRecord &PPRec) { +@@ -2185,7 +2185,7 @@ + Record.push_back(PPD_ENTITIES_OFFSETS); + Record.push_back(FirstPreprocessorEntityID - NUM_PREDEF_PP_ENTITY_IDS); + Stream.EmitRecordWithBlob(PPEOffsetAbbrev, Record, +- bytes(PreprocessedEntityOffsets)); ++ data(PreprocessedEntityOffsets)); + } + } + +@@ -2548,7 +2548,7 @@ + Record.push_back(CXX_BASE_SPECIFIER_OFFSETS); + Record.push_back(CXXBaseSpecifiersOffsets.size()); + Stream.EmitRecordWithBlob(BaseSpecifierOffsetAbbrev, Record, +- bytes(CXXBaseSpecifiersOffsets)); ++ data(CXXBaseSpecifiersOffsets)); + } + + //===----------------------------------------------------------------------===// +@@ -2623,7 +2623,7 @@ + Decls.push_back(std::make_pair((*D)->getKind(), GetDeclRef(*D))); + + ++NumLexicalDeclContexts; +- Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, bytes(Decls)); ++ Stream.EmitRecordWithBlob(DeclContextLexicalAbbrev, Record, data(Decls)); + return Offset; + } + +@@ -2642,7 +2642,7 @@ + Record.push_back(TYPE_OFFSET); + Record.push_back(TypeOffsets.size()); + Record.push_back(FirstTypeID - NUM_PREDEF_TYPE_IDS); +- Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, bytes(TypeOffsets)); ++ Stream.EmitRecordWithBlob(TypeOffsetAbbrev, Record, data(TypeOffsets)); + + // Write the declaration offsets array + Abbrev = new BitCodeAbbrev(); +@@ -2655,7 +2655,7 @@ + Record.push_back(DECL_OFFSET); + Record.push_back(DeclOffsets.size()); + Record.push_back(FirstDeclID - NUM_PREDEF_DECL_IDS); +- Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, bytes(DeclOffsets)); ++ Stream.EmitRecordWithBlob(DeclOffsetAbbrev, Record, data(DeclOffsets)); + } + + void ASTWriter::WriteFileDeclIDsMap() { +@@ -2680,7 +2680,7 @@ + unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev); + Record.push_back(FILE_SORTED_DECLS); + Record.push_back(FileSortedIDs.size()); +- Stream.EmitRecordWithBlob(AbbrevCode, Record, bytes(FileSortedIDs)); ++ Stream.EmitRecordWithBlob(AbbrevCode, Record, data(FileSortedIDs)); + } + + void ASTWriter::WriteComments() { +@@ -2893,7 +2893,7 @@ + Record.push_back(SelectorOffsets.size()); + Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS); + Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record, +- bytes(SelectorOffsets)); ++ data(SelectorOffsets)); + } + } + +@@ -3253,7 +3253,7 @@ + Record.push_back(IdentifierOffsets.size()); + Record.push_back(FirstIdentID - NUM_PREDEF_IDENT_IDS); + Stream.EmitRecordWithBlob(IdentifierOffsetAbbrev, Record, +- bytes(IdentifierOffsets)); ++ data(IdentifierOffsets)); + } + + //===----------------------------------------------------------------------===// +@@ -4046,7 +4046,7 @@ + Record.clear(); + Record.push_back(TU_UPDATE_LEXICAL); + Stream.EmitRecordWithBlob(TuUpdateLexicalAbbrev, Record, +- bytes(NewGlobalDecls)); ++ data(NewGlobalDecls)); + + // And a visible updates block for the translation unit. + Abv = new llvm::BitCodeAbbrev(); -- cgit v1.2.3