dexonsmith added a comment.

In D122766#3429552 <https://reviews.llvm.org/D122766#3429552>, @hans wrote:

>> My feeling is that the default behavior on Windows needs to be to use 
>> backslashes and not forward slashes.
>
> Okay, how would folks feel about always canonicalizing `__FILE__` etc. to use 
> //backslashes// when targeting Windows?

FWIW (I have little Windows experience and no stake in this!), defaulting to 
backslashes more sense to me. Also seems easy enough to add a preprocessor 
option to configure this.

I'm curious though, if you're building on POSIX (so the file starts out as 
POSIX) and targeting Windows, does calling `make_preferred()` actually give you 
something reasonable in the general case? Or should it be used *only* when 
there's a hit in `LangOpts.remapPathPrefix()`? Sorry if this has been discussed 
and rejected; I haven't followed the full thread; feel free to ignore if it's 
not relevant; but it seems to me that when `-ffile-prefix-map` is NOT being 
used, then `__FILE__` ought to correspond to the build environment (if 
anything, it should use `Style::native`).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122766

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to