SHA256
1
0
forked from pool/llvm
llvm/pr13141.patch
Ismail Dönmez 7c611aed7c Accepting request 127882 from home:llunak:branches:devel:tools:compiler
This adds few fixes, but mostly it updates the rewrite-includes patch. Sadly upstream has decided to rename the option name for whatever reason, so if unchanged 12.2 would be the only clang with the option named this way, causing further problems e.g. with icecream.

So it would be very nice to get this into 12.2. As it is an isolated feature, it should be low-risk.

OBS-URL: https://build.opensuse.org/request/show/127882
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=155
2012-07-14 15:44:52 +00:00

29 lines
1.2 KiB
Diff

From e9ddb0fd37e4245392af7e8f1e2c86a44d4339ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@suse.cz>
Date: Mon, 18 Jun 2012 22:23:37 +0200
Subject: [PATCH] do not reject PCH because of -DFOO -DFOO duplication
---
lib/Serialization/ASTReader.cpp | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index f224056..d176ee3 100644
--- tools/clang/lib/Serialization/ASTReader.cpp
+++ tools/clang/lib/Serialization/ASTReader.cpp
@@ -259,6 +259,11 @@ bool PCHValidator::ReadPredefinesBuffer(const PCHPredefinesBlocks &Buffers,
// definitions and they may appear at any point in the output.
std::sort(CmdLineLines.begin(), CmdLineLines.end());
std::sort(PCHLines.begin(), PCHLines.end());
+ // And remove duplicated definitions.
+ CmdLineLines.resize(
+ std::unique(CmdLineLines.begin(), CmdLineLines.end())-CmdLineLines.begin());
+ PCHLines.resize(
+ std::unique(PCHLines.begin(), PCHLines.end())-PCHLines.begin());
// Determine which predefines that were used to build the PCH file are missing
// from the command line.
--
1.7.7