[PATCH] D92677: Provide default location of sysroot for Baremetal toolchain.

Jon Roelofs via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 12:35:21 PST 2020


jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:105
+
+  if (!llvm::sys::fs::exists(SysRootDir))
+    return std::string();
----------------
Why not always add it, even if it doesn't exist? That's an easier failure mode to diagnose as a user, since you'll see the compiler appending paths that aren't there, rather than having magic behavior.


================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:108
+
+  return std::string(SysRootDir.str());
+}
----------------
Small string has an implicit conversion to std::string, so you can just `return SysRootDir;` here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92677/new/

https://reviews.llvm.org/D92677



More information about the cfe-commits mailing list