From cc9c8eb83728649f826e11cfb5c80ddc677adeda Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Tue, 22 Feb 2011 00:40:56 +0000 Subject: Bug#8945: Add -cxx-isystem option to specify C++ system directories. It works like -isystem and the search path keeps -isystem and -cxx-isystem in order relative to each other. -cxx-isystem is only used for C++ sources though. Drop the existing -cxx-system-include option for cc1 as it is now redundant. llvm-svn: 126167 --- clang/lib/Frontend/CompilerInvocation.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 103d251a88f..915634b1dd7 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -490,6 +490,8 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, Res.push_back("-iquote"); } else if (E.Group == frontend::System) { Res.push_back("-isystem"); + } else if (E.Group == frontend::CXXSystem) { + Res.push_back("-cxx-isystem"); } else { assert(E.Group == frontend::Angled && "Invalid group!"); Res.push_back(E.IsFramework ? "-F" : "-I"); @@ -1236,7 +1238,6 @@ 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); @@ -1272,10 +1273,12 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { for (arg_iterator it = Args.filtered_begin(OPT_iquote), ie = Args.filtered_end(); it != ie; ++it) Opts.AddPath((*it)->getValue(Args), frontend::Quoted, true, false, true); - for (arg_iterator it = Args.filtered_begin(OPT_isystem, OPT_iwithsysroot), - ie = Args.filtered_end(); it != ie; ++it) - Opts.AddPath((*it)->getValue(Args), frontend::System, true, false, - (*it)->getOption().matches(OPT_iwithsysroot)); + for (arg_iterator it = Args.filtered_begin(OPT_cxx_isystem, OPT_isystem, + OPT_iwithsysroot), ie = Args.filtered_end(); it != ie; ++it) + Opts.AddPath((*it)->getValue(Args), + ((*it)->getOption().matches(OPT_cxx_isystem) ? + frontend::CXXSystem : frontend::System), + true, false, (*it)->getOption().matches(OPT_iwithsysroot)); // FIXME: Need options for the various environment variables! } -- cgit v1.2.3