[F18] Build time investigations

Hi David,

Thanks for digging in to thos issue.

Did you ping the llvm list looking for guidance with modules, in particular to report a bug or ask about what has been implemented? My recollection is that Apple has been doing a bit of work with modules and dependencies; I’m not sure if that work is generally applicable, or if it may be helpful to cmake. I think the people doing the work are Alex Lorenz and Michael Spencer at Apple.

Did you try to pare down an implementation of std::variant to just the functions that required in f18? I wonder if “lots of less” would be fast enough.

I hate to suggest it, but could a member that is a variant be implemented as a pointer to a variant? Would that enable external template declarations?

Did you profile clang to see where the time is being spent? The perf tool is pretty easy to use to see a gross accounting for time in routines; no special recompilation needed.