r220547 - Driver: add missed file from previous commit

Saleem Abdulrasool compnerd at compnerd.org
Sat Oct 25 14:00:03 PDT 2014


On Fri, Oct 24, 2014 at 11:19 AM, Reid Kleckner <rnk at google.com> wrote:

> On Thu, Oct 23, 2014 at 8:24 PM, Saleem Abdulrasool
> <compnerd at compnerd.org> wrote:
> > +void CrossWindowsToolChain::
> > +AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
> > +                             llvm::opt::ArgStringList &CC1Args) const {
> > +  const llvm::Triple &Triple = getTriple();
> > +  const std::string &SysRoot = getDriver().SysRoot;
> > +
> > +  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||
> > +      DriverArgs.hasArg(options::OPT_nostdincxx))
> > +    return;
> > +
> > +  switch (GetCXXStdlibType(DriverArgs)) {
> > +  case ToolChain::CST_Libcxx:
> > +    addSystemInclude(DriverArgs, CC1Args, SysRoot +
> "/usr/include/c++/v1");
> > +    break;
> > +
> > +  case ToolChain::CST_Libstdcxx:
> > +    addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/incldue/c++");
> > +    switch (Triple.getArch()) {
> > +    default: llvm_unreachable("unsupported architecture");
>
> It shouldn't be this easy for users to trip assertions or hit
> unreachable code. I think adding /usr/include/c++/Triple to the
> include search path, and letting users debug any fallout from that is
> probably reasonable.


Fair enough; changed to assume that the path exists in SVN r220624.


> > +    case llvm::Triple::x86:
> > +    case llvm::Triple::x86_64:
> > +      addSystemInclude(DriverArgs, CC1Args,
> > +                       SysRoot + "/usr/include/c++/" + Triple.str());
> > +      break;
> > +    }
> > +    addSystemInclude(DriverArgs, CC1Args,
> > +                     SysRoot + "/usr/include/c++/backwards");
> > +  }
> > +}
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141025/0633c54c/attachment.html>


More information about the cfe-commits mailing list