[PATCH] Support Sourcery CodeBench MIPS toolchain

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Fri Apr 19 12:29:48 PDT 2013


  LGTM with the Twine issue fixed.


================
Comment at: lib/Driver/ToolChains.cpp:2379
@@ +2378,3 @@
+  if (GCCInstallation.isValid() && isMipsArch(getTriple().getArch())) {
+    Twine MipsInc = GCCInstallation.getInstallPath() + "/include";
+    if (llvm::sys::fs::exists(MipsInc))
----------------
It is dangerous to use Twine like this. I think this case is safe, but a change to, for example, compute a string in getInstallPath instead of just returning a StringRef to a member would break this.

Can you add a trivial addExternCSystemIncludeIfExits with a Twine argument to avoid this? Or maybe addExternCSystemInclude itself could check if thee directory exit?


http://llvm-reviews.chandlerc.com/D644



More information about the cfe-commits mailing list