diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2011-11-04 07:12:53 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2011-11-04 07:12:53 +0000 |
commit | 88491fc6dfc7ebbd856d57a9acb49fb83077d6c8 (patch) | |
tree | 5b6b9c180e853110fe02e99c6c09b0a23a57d03a /lib/Driver/Tools.cpp | |
parent | 69c2c50498dadfa6bb99baba52187e3cfa0ac78a (diff) |
Add a system include management interface to the toolchain, and call it
and the C++ include management routine from the proper place when
forming preprocessor options in the driver. This is the first step to
teaching the driver to manage all of the header search paths. Currently,
these methods remain just stubs in the abstract toolchain. Subsequent
patches will flesh them out with implementations for various toolchains
based on the current code in InitHeaderSearch.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 4811b03979..98c2d28a9c 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -364,16 +364,6 @@ void Clang::AddPreprocessingOptions(const Driver &D, Args.AddAllArgs(CmdArgs, options::OPT_I_Group, options::OPT_F, options::OPT_index_header_map); - // Add C++ include arguments, if needed. - types::ID InputType = Inputs[0].getType(); - if (types::isCXX(InputType)) { - bool ObjCXXAutoRefCount - = types::isObjC(InputType) && isObjCAutoRefCount(Args); - getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs, - ObjCXXAutoRefCount); - Args.AddAllArgs(CmdArgs, options::OPT_stdlib_EQ); - } - // Add -Wp, and -Xassembler if using the preprocessor. // FIXME: There is a very unfortunate problem here, some troubled @@ -428,6 +418,19 @@ void Clang::AddPreprocessingOptions(const Driver &D, // OBJCPLUS_INCLUDE_PATH - system includes enabled when compiling ObjC++. AddIncludeDirectoryList(Args, CmdArgs, "-objcxx-isystem", ::getenv("OBJCPLUS_INCLUDE_PATH")); + + // Add system include arguments. + getToolChain().AddClangSystemIncludeArgs(Args, CmdArgs); + + // Add C++ include arguments, if needed. + types::ID InputType = Inputs[0].getType(); + if (types::isCXX(InputType)) { + bool ObjCXXAutoRefCount + = types::isObjC(InputType) && isObjCAutoRefCount(Args); + getToolChain().AddClangCXXStdlibIncludeArgs(Args, CmdArgs, + ObjCXXAutoRefCount); + Args.AddAllArgs(CmdArgs, options::OPT_stdlib_EQ); + } } /// getARMTargetCPU - Get the (LLVM) name of the ARM cpu we are targeting. |