================
@@ -53,6 +55,23 @@ struct MissingIncludeInfo {
 };
 } // namespace
 
+static llvm::SmallString<128> normalizePath(llvm::StringRef Path) {
+  namespace path = llvm::sys::path;
+
+  llvm::SmallString<128> P = Path;
+  path::remove_dots(P, /*remove_dot_dot=*/true);
+  path::native(P, path::Style::posix);
+  while (!P.empty() && P.back() == '/')
----------------
zeyi2 wrote:

Nit: not sure about this line, IIUC `llvm::sys::path::remove_dots` already 
handles trailing separators for most cases. Unless we explicitly want to turn a 
single root `/` into an empty string, this might be redundant.

https://github.com/llvm/llvm-project/pull/180282
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to