[PATCH] D27066: Fix crash with unsupported architectures in Linux/Gnu target triples.

Joerg Sonnenberger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 30 15:33:54 PST 2016


joerg accepted this revision.
joerg added a reviewer: joerg.
joerg added a comment.

LGTM with a small cleanup.



================
Comment at: lib/Driver/Tools.cpp:10018
+  const char *LDMOption = getLDMOption(ToolChain.getTriple(), Args);
+  if (!LDMOption) {
+    D.Diag(diag::err_target_unknown_triple) << Triple.str();
----------------
Please write this as
```
   if (const char *LDMOption = ...) {
     ...
  } else {
     D.Diag(...);
     return;
  }
```


https://reviews.llvm.org/D27066





More information about the cfe-commits mailing list