cor3ntin wrote:

The issue is that if we allow the preprocessor's state to differ across 
modules, then the resulting compiled units can be arbitrary (and subtly 
incompatible).

I wonder if a possible solution is to record which macros are used (ie, are 
expanded or appear in `#ifdef` / `defined`)
And ONLY serialize the set of macros that are used.
That way, if your program never uses `__SSP__`, for example, then your module 
would not be incompatible just because __SPP__ has been defined.

I think that's worth pondering a bit more @Bigcheese 



https://github.com/llvm/llvm-project/pull/131569
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to