summaryrefslogtreecommitdiff
path: root/debian/patches/reproducible-pch.diff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-12-02 17:06:08 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-12-02 17:06:08 +0300
commit18583eaa2c6fa769ce80605422fa10a60d353af7 (patch)
tree4b6730afc2006e86ae8b91c8c4cf52b313b5c188 /debian/patches/reproducible-pch.diff
downloadllvm-toolchain-8-18583eaa2c6fa769ce80605422fa10a60d353af7.tar.gz
Import llvm-toolchain-8 (1:8.0.1-4)debian/8.0.1-4debian
Diffstat (limited to 'debian/patches/reproducible-pch.diff')
-rw-r--r--debian/patches/reproducible-pch.diff40
1 files changed, 40 insertions, 0 deletions
diff --git a/debian/patches/reproducible-pch.diff b/debian/patches/reproducible-pch.diff
new file mode 100644
index 0000000..b3f3930
--- /dev/null
+++ b/debian/patches/reproducible-pch.diff
@@ -0,0 +1,40 @@
+Description: Make ordering of OPENCL_EXTENSION_TYPES reproducible
+
+Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
+Bug-Debian: https://bugs.debian.org/877359
+Forwarded: no
+
+Index: llvm-toolchain-snapshot_8~svn349138/clang/lib/Serialization/ASTWriter.cpp
+===================================================================
+--- llvm-toolchain-snapshot_8~svn349138.orig/clang/lib/Serialization/ASTWriter.cpp
++++ llvm-toolchain-snapshot_8~svn349138/clang/lib/Serialization/ASTWriter.cpp
+@@ -4279,9 +4279,13 @@ void ASTWriter::WriteOpenCLExtensionType
+ return;
+
+ RecordData Record;
++ // Sort to allow reproducible .pch files - https://bugs.debian.org/877359
++ std::map<TypeID, std::set<std::string>> sortedOpenCLTypeExtMap;
+ for (const auto &I : SemaRef.OpenCLTypeExtMap) {
+- Record.push_back(
+- static_cast<unsigned>(getTypeID(I.first->getCanonicalTypeInternal())));
++ sortedOpenCLTypeExtMap[getTypeID(I.first->getCanonicalTypeInternal())]=I.second;
++ }
++ for (const auto &I : sortedOpenCLTypeExtMap) {
++ Record.push_back(static_cast<unsigned>(I.first));
+ Record.push_back(I.second.size());
+ for (auto Ext : I.second)
+ AddString(Ext, Record);
+@@ -4294,8 +4298,12 @@ void ASTWriter::WriteOpenCLExtensionDecl
+ return;
+
+ RecordData Record;
++ std::map<DeclID, std::set<std::string>> sortedOpenCLDeclExtMap;
+ for (const auto &I : SemaRef.OpenCLDeclExtMap) {
+- Record.push_back(getDeclID(I.first));
++ sortedOpenCLDeclExtMap[getDeclID(I.first)]=I.second;
++ }
++ for (const auto &I : sortedOpenCLDeclExtMap) {
++ Record.push_back(I.first);
+ Record.push_back(static_cast<unsigned>(I.second.size()));
+ for (auto Ext : I.second)
+ AddString(Ext, Record);