[PATCH] D111322: Remove unnecessary StringRef convesion in llvm-config

John Ericson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 09:13:50 PDT 2021


Ericson2314 created this revision.
Ericson2314 added a reviewer: compnerd.
Ericson2314 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

We have a string litteral (via CPP) used to construct `StringRef`, which
is used to construct a `SmallString`. Just construct the latter
directly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111322

Files:
  llvm/tools/llvm-config/llvm-config.cpp


Index: llvm/tools/llvm-config/llvm-config.cpp
===================================================================
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -358,7 +358,7 @@
   } else {
     ActivePrefix = CurrentExecPrefix;
     ActiveIncludeDir = ActivePrefix + "/include";
-    SmallString<256> path(StringRef(LLVM_TOOLS_INSTALL_DIR));
+    SmallString<256> path(LLVM_TOOLS_INSTALL_DIR);
     sys::fs::make_absolute(ActivePrefix, path);
     ActiveBinDir = std::string(path.str());
     ActiveLibDir = ActivePrefix + "/lib" + LLVM_LIBDIR_SUFFIX;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111322.377884.patch
Type: text/x-patch
Size: 595 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211007/f6c84b2d/attachment.bin>


More information about the llvm-commits mailing list