From eb996ab37d5f0bfa4a0c45d8dfd5ab7de0542aab Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 20 Mar 2009 00:40:03 +0000 Subject: [PATCH] Preserve ordering between -include and -include-pth. llvm-svn: 67354 --- clang/Driver/clang.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index 31aedbfc97f6..1fd54d4b9eeb 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -934,7 +934,8 @@ static bool InitializePreprocessor(Preprocessor &PP, // Add implicit #includes from -include and -include-pth. bool handledPTH = ImplicitIncludePTH.empty(); for (unsigned i = 0, e = ImplicitIncludes.size(); i != e; ++i) { - if (!handledPTH) { + if (!handledPTH && + ImplicitIncludePTH.getPosition() < ImplicitIncludes.getPosition(i)) { AddImplicitIncludePTH(PredefineBuffer, PP); handledPTH = true; }