https://bugs.llvm.org/show_bug.cgi?id=49793
Bug ID: 49793
Summary: [Windows] LLVM should canonicalize slashes and allow
the user to override the default
Product: clang
Version: unspecified
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
On Windows, it's easy to end up with paths with mixed slash directions. It's
easy to set up an example with clang-cl where the diagnostics contain mixed
slashes. There have been instances where debug info contains mixed slashes,
although it may depend on the format (DWARF vs codeview). In LLVM, we struggle
to write portable lit tests because our diagnostic output depends on the host
slash direction. To address these issues, LLVM needs a consistent policy.
My basic proposal is that we should treat slashes the way we treat text
encodings: we should canonicalize to forward slashes internally early, and then
canonicalize to the preferred separator when producing a diagnostic or
embedding the path in an output. This logic extends to LLVM IR and serialized
ASTs: I want the paths embedded in DIFile to contain forward slashes to make
testing the IR easier. Making native paths should happen when writing output
files intended for consumption by other tools, i.e. object files, executables,
PDBs, etc.
Finally, there should be a way for the user to override the default. No matter
what we do, there will be a user somewhere who prefers the other slash
direction, and we need to be able to point at an escape hatch to keep them
pacified.
Random links for context:
https://reviews.llvm.org/D99580
https://bugs.llvm.org/show_bug.cgi?id=39025
https://bugs.llvm.org/show_bug.cgi?id=34497
git grep -F '{[/' ../clang/test
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs