29 lines
1.2 KiB
Diff
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
|
||
|
|