[clang] [clang] use absolute path for builtin headers during module compilation (PR #68023)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 5 11:32:46 PDT 2023


jansvoboda11 wrote:

This is now always storing an absolute path into `Header::PathRelativeToRootModuleDirectory` for built-in headers. I guess that's not much more surprising than the "as-written" resource directory prepended to the header name we stored previously, but I think this should be clarified somehow (either by documentation, or by renaming the member).

My bigger concern is that we now generate absolute paths into the `<module-includes>` buffer which gets serialized into the PCM file. I believe that some folks using Clang modules rely on them being "relocatable", i.e. having no absolute paths serialized. I believe this patch would break that use-case.

I'm not sure what the best solution here... Maybe prepending `#pragma` before `#include` of each builtin header?

https://github.com/llvm/llvm-project/pull/68023


More information about the cfe-commits mailing list