AaronBallman wrote:

> I wonder if -E should preserve some constants ( version of clang, glibc, msvc 
> and other things that are useful for diagnostics or that sort of workaround).

I'd be opposed to that; we already have options for `-E` to retain extra 
information like macro definitions. I think it would be surprising to anything 
running `-E` expecting those macros to be fully removed.

> Maybe a stupid suggestion, but could we translate `#define __GLIBCXX__ XXXX` 
> into `#pragma clang glibcxx_version XXXX`?

Now that's an idea we hadn't thought of -- `-E` output already retains pragmas, 
so this would be kind of novel, but not as novel as retaining the macro 
definitions directly. I don't know that I'd want to see that scale to other 
macros, but it'd be fine for things like `_MSC_VER` in `-fms-compatibility` 
mode for the same reasons if we needed to,

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

Reply via email to