[PATCH] D138677: [Lex] Fix suggested spelling of /usr/bin/../include/foo

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 25 02:01:08 PST 2022


sammccall marked 2 inline comments as done.
sammccall added inline comments.


================
Comment at: clang/lib/Lex/HeaderSearch.cpp:1932
+  
+  llvm::SmallString<32> FilePath(File.begin(), File.end());
+  path::remove_dots(FilePath, /*remove_dot_dot=*/true);
----------------
kadircet wrote:
> kadircet wrote:
> > nit: you can change the method signature to take in a SmallString directly. there's an implicit constructor and any caller that already has a copy that they're throwing away can pass it here instead.
> this is same as `llvm::SmallString<32> FilePath(File);`
I don't think this is a good reason to change the signature unless it's actually a hot path.
(In fact, no caller has a `SmallString<32>`).

I changed CheckDir though because it's internal.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138677



More information about the cfe-commits mailing list