<div dir="ltr">On Fri, Oct 24, 2014 at 11:19 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On Thu, Oct 23, 2014 at 8:24 PM, Saleem Abdulrasool<br>
<<a href="mailto:compnerd@compnerd.org">compnerd@compnerd.org</a>> wrote:<br>
> +void CrossWindowsToolChain::<br>
> +AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,<br>
> +                             llvm::opt::ArgStringList &CC1Args) const {<br>
> +  const llvm::Triple &Triple = getTriple();<br>
> +  const std::string &SysRoot = getDriver().SysRoot;<br>
> +<br>
> +  if (DriverArgs.hasArg(options::OPT_nostdlibinc) ||<br>
> +      DriverArgs.hasArg(options::OPT_nostdincxx))<br>
> +    return;<br>
> +<br>
> +  switch (GetCXXStdlibType(DriverArgs)) {<br>
> +  case ToolChain::CST_Libcxx:<br>
> +    addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include/c++/v1");<br>
> +    break;<br>
> +<br>
> +  case ToolChain::CST_Libstdcxx:<br>
> +    addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/incldue/c++");<br>
> +    switch (Triple.getArch()) {<br>
> +    default: llvm_unreachable("unsupported architecture");<br>
<br>
</span>It shouldn't be this easy for users to trip assertions or hit<br>
unreachable code. I think adding /usr/include/c++/Triple to the<br>
include search path, and letting users debug any fallout from that is<br>
probably reasonable.</blockquote><div><br></div><div>Fair enough; changed to assume that the path exists in SVN r220624.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
> +    case llvm::Triple::x86:<br>
> +    case llvm::Triple::x86_64:<br>
> +      addSystemInclude(DriverArgs, CC1Args,<br>
> +                       SysRoot + "/usr/include/c++/" + Triple.str());<br>
> +      break;<br>
> +    }<br>
> +    addSystemInclude(DriverArgs, CC1Args,<br>
> +                     SysRoot + "/usr/include/c++/backwards");<br>
> +  }<br>
> +}<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org
</div></div>