From 80c26f44a6f8d859a2a3babb06bd3ca8d86f2623 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 9 Sep 2010 17:38:22 +0000 Subject: Frontend: Add -cxx-system-include option which can be used to specify an explicit list for the C++ system include directories at the -cc1 level, as an alternative to the horrible AddDefaultCPlusPlusIncludePaths(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113505 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInvocation.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Frontend/CompilerInvocation.cpp') diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 8c644833b2..36d8dad58f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -443,6 +443,11 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, Res.push_back(Opts.Sysroot); } + for (unsigned i = 0, e = Opts.CXXSystemIncludes.size(); i != e; ++i) { + Res.push_back("-cxx-system-include"); + Res.push_back(Opts.CXXSystemIncludes[i]); + } + /// User specified include entries. for (unsigned i = 0, e = Opts.UserEntries.size(); i != e; ++i) { const HeaderSearchOptions::Entry &E = Opts.UserEntries[i]; @@ -1143,6 +1148,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0, static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { using namespace cc1options; + Opts.CXXSystemIncludes = Args.getAllArgValues(OPT_cxx_system_include); Opts.Sysroot = Args.getLastArgValue(OPT_isysroot, "/"); Opts.Verbose = Args.hasArg(OPT_v); Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc); -- cgit v1.2.3-18-g5258