[PATCH] D131225: Driver: Refactor and support per target dirs in baremetal

Sergei Barannikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 12:17:34 PDT 2022


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

LGTM with the style issues fixed, but I'd like someone else to take a look.



================
Comment at: clang/lib/Driver/ToolChains/BareMetal.cpp:228-237
+  case ToolChain::RLT_CompilerRT: {
+    const std::string fileName = getCompilerRT(Args, "builtins");
+    std::string baseName = llvm::sys::path::filename(fileName).str();
+    llvm::StringRef baseNameRef(baseName);
+    baseNameRef.consume_front("lib");
+    baseNameRef.consume_back(".a");
     CmdArgs.push_back(
----------------
There are a few style issues.
* `return` is usually within the braces
* Variable names should start with capital letter
* Looks like std::string could be avoided completely in favor of `StringRef` and `Twine`

Same applies to ConstructJob below, there are also redundant braces in `for` statement.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131225



More information about the cfe-commits mailing list