manojgupta added inline comments.

================
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(
----------------
barannikov88 wrote:
> 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.
Addressed most.
std::string is needed initially to avoid dangling storage issue:

warning: object backing the pointer will be destroyed at the end of the 
full-expression [-Wdangling-gsl]


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131225

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to