diff options
| author | Joao Matos <ripzonetriton@gmail.com> | 2012-09-04 17:29:52 +0000 | 
|---|---|---|
| committer | Joao Matos <ripzonetriton@gmail.com> | 2012-09-04 17:29:52 +0000 | 
| commit | 792d7afdc1704335b93ae3f7892068897135e3b0 (patch) | |
| tree | e09ebee6d5f8103616d4ebbd22cb4ba8b79583b8 | |
| parent | e30771fdbd0b6aae843b399c1a90967c53b68b03 (diff) | |
| download | bcm5719-llvm-792d7afdc1704335b93ae3f7892068897135e3b0.tar.gz bcm5719-llvm-792d7afdc1704335b93ae3f7892068897135e3b0.zip  | |
Revert r163076 per chandlerc's request.
llvm-svn: 163146
| -rw-r--r-- | clang/include/clang/Driver/Util.h | 5 | ||||
| -rw-r--r-- | clang/lib/Driver/WindowsToolChain.cpp | 56 | 
2 files changed, 22 insertions, 39 deletions
diff --git a/clang/include/clang/Driver/Util.h b/clang/include/clang/Driver/Util.h index 8e0958582c1..65aef4b3102 100644 --- a/clang/include/clang/Driver/Util.h +++ b/clang/include/clang/Driver/Util.h @@ -11,8 +11,6 @@  #define CLANG_DRIVER_UTIL_H_  #include "clang/Basic/LLVM.h" -#include <string> -#include <vector>  namespace clang {  namespace driver { @@ -24,9 +22,6 @@ namespace driver {    /// ActionList - Type used for lists of actions.    typedef SmallVector<Action*, 3> ActionList; -  /// Gets the default Windows system include directories. -  std::vector<std::string> GetWindowsSystemIncludeDirs(); -  } // end namespace driver  } // end namespace clang diff --git a/clang/lib/Driver/WindowsToolChain.cpp b/clang/lib/Driver/WindowsToolChain.cpp index ad2605a815c..6827034ef4c 100644 --- a/clang/lib/Driver/WindowsToolChain.cpp +++ b/clang/lib/Driver/WindowsToolChain.cpp @@ -14,7 +14,6 @@  #include "clang/Driver/Compilation.h"  #include "clang/Driver/Driver.h"  #include "clang/Driver/Options.h" -#include "clang/Driver/Util.h"  #include "clang/Basic/Version.h"  #include "llvm/Support/ErrorHandling.h"  #include "llvm/Support/Path.h" @@ -305,8 +304,19 @@ static bool getVisualStudioDir(std::string &path) {  #endif // _MSC_VER -std::vector<std::string> clang::driver::GetWindowsSystemIncludeDirs() { -  std::vector<std::string> Paths; +void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs, +                                        ArgStringList &CC1Args) const { +  if (DriverArgs.hasArg(options::OPT_nostdinc)) +    return; + +  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { +    llvm::sys::Path P(getDriver().ResourceDir); +    P.appendComponent("include"); +    addSystemInclude(DriverArgs, CC1Args, P.str()); +  } + +  if (DriverArgs.hasArg(options::OPT_nostdlibinc)) +    return;  #ifdef _MSC_VER    // Honor %INCLUDE%. It should know essential search paths with vcvarsall.bat. @@ -320,9 +330,9 @@ std::vector<std::string> clang::driver::GetWindowsSystemIncludeDirs() {        if (d.size() == 0)          continue;        ++n; -      Paths.push_back(d); +      addSystemInclude(DriverArgs, CC1Args, d);      } -    if (n) return Paths; +    if (n) return;    }    std::string VSDir; @@ -331,47 +341,25 @@ std::vector<std::string> clang::driver::GetWindowsSystemIncludeDirs() {    // When built with access to the proper Windows APIs, try to actually find    // the correct include paths first.    if (getVisualStudioDir(VSDir)) { -    Paths.push_back(VSDir + "\\VC\\include"); +    addSystemInclude(DriverArgs, CC1Args, VSDir + "\\VC\\include");      if (getWindowsSDKDir(WindowsSDKDir)) -      Paths.push_back(WindowsSDKDir + "\\include"); +      addSystemInclude(DriverArgs, CC1Args, WindowsSDKDir + "\\include");      else -      Paths.push_back(VSDir + "\\VC\\PlatformSDK\\Include"); -    return Paths; +      addSystemInclude(DriverArgs, CC1Args, +                       VSDir + "\\VC\\PlatformSDK\\Include"); +    return;    }  #endif // _MSC_VER    // As a fallback, select default install paths. -  const StringRef FallbackPaths[] = { +  const StringRef Paths[] = {      "C:/Program Files/Microsoft Visual Studio 10.0/VC/include",      "C:/Program Files/Microsoft Visual Studio 9.0/VC/include",      "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include",      "C:/Program Files/Microsoft Visual Studio 8/VC/include",      "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"    }; - -  for (unsigned i = 0; i < sizeof(FallbackPaths) / sizeof(FallbackPaths[0]); ++i) -    Paths.push_back(FallbackPaths[i]); - -  return Paths; -} - -void Windows::AddClangSystemIncludeArgs(const ArgList &DriverArgs, -                                        ArgStringList &CC1Args) const { -  if (DriverArgs.hasArg(options::OPT_nostdinc)) -    return; - -  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { -    llvm::sys::Path P(getDriver().ResourceDir); -    P.appendComponent("include"); -    addSystemInclude(DriverArgs, CC1Args, P.str()); -  } - -  if (DriverArgs.hasArg(options::OPT_nostdlibinc)) -    return; - -  std::vector<std::string> Paths = driver::GetWindowsSystemIncludeDirs(); -  for (size_t i = 0; i < Paths.size(); ++i) -    addSystemInclude(DriverArgs, CC1Args, Paths[i]); +  addSystemIncludes(DriverArgs, CC1Args, Paths);  }  void Windows::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,  | 

