[PATCH] support: add a utility function to canonicalise path separators

Saleem Abdulrasool abdulras at fb.com
Thu Mar 6 17:13:28 PST 2014



================
Comment at: lib/Support/Unix/Path.inc:278
@@ +277,3 @@
+    if (*PI == '\\' && *(PI + 1) == '\\')
+      ++PI; // increment once, the for loop will increment over the escaped slash
+    else if (*PI == '\\')
----------------
NAKAMURA Takumi wrote:
> What is "escaped slash"?
The slash that we just skipped over is the escaping slash.  The slash that follows (*(PI + 1)) is the escaped slash.

================
Comment at: include/llvm/Support/FileSystem.h:277
@@ +276,3 @@
+/// do on Windows, which accepts both characters as a path separtor.
+error_code normalise_separators(SmallVectorImpl<char> &Path);
+
----------------
NAKAMURA Takumi wrote:
> I suggest s/normalise/normalize/.
Sure, will do.


http://llvm-reviews.chandlerc.com/D2995



More information about the llvm-commits mailing list