[PATCH] D126289: [Clang][Driver] Fix include paths for `--sysroot /` on Linux

Egor Zhdan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 25 15:51:57 PDT 2022


egorzhdan added inline comments.


================
Comment at: clang/include/clang/Driver/ToolChain.h:219
+
+  static std::string concat(const std::string &Path, const Twine &A,
+                            const Twine &B = "", const Twine &C = "",
----------------
MaskRay wrote:
> This can use `llvm::sys::path::append`
The implementation of this already uses `llvm::sys::path::append`, do you mean replacing the usages of `concat` with `llvm::sys::path::append`?
That would produce quite a lot of boilerplate I think, since `llvm::sys::path::append` modifies the path in-place, so every call to `concat` would expand into 3 lines of code. Also it would be very easy to forget to pass `Style::posix` and cause incorrect behavior on Windows (something I've stumbled upon while making this patch).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126289



More information about the cfe-commits mailing list