]> granicus.if.org Git - clang/commitdiff
Preserve ordering between -include and -include-pth.
authorTed Kremenek <kremenek@apple.com>
Fri, 20 Mar 2009 00:40:03 +0000 (00:40 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 20 Mar 2009 00:40:03 +0000 (00:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67354 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/clang.cpp

index 31aedbfc97f6eb9a91972431b7c5bdb8073244c2..1fd54d4b9eeb8c919ef57bf6ece16e6dd592911f 100644 (file)
@@ -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;
     }