[cfe-dev] [RFC] Storing relative paths in .pcm files

Ben Langmuir blangmuir at apple.com
Mon Nov 17 18:08:41 PST 2014

Hey Richard (& cfe-dev),

Currently if one AST file imports another (e.g. module A imports module B), we store the absolute path of module B inside module A’s IMPORTS record.  When we know that both files will always be in the same directory, this wastes space and more importantly prevents moving those modules to another directory.  The latter is very handy when debugging a module bug for which someone has given you their broken module cache.

When an implicitly built module imports another implicitly built module, we can rely on the modules always being in the same module cache, and I think we should switch to a relative path that is either looked up relative to the current pcm file or the (hash-specific) module cache dir.  Do you think we should do this for explicitly built modules that happen to be in the same directory?  What about implicitly built modules that are imported by explicitly built modules?



More information about the cfe-dev mailing list