#Clang C++20 Modules: Lazy and Eager loading

5 messages · Page 1 of 1 (latest)

marsh beacon
#

https://clang.llvm.org/docs/StandardCPlusPlusModules.html#introduction

The -fmodule-file=<path/to/BMI> option causes the compiler to load the specified BMI directly. The -fmodule-file=<module-name>=<path/to/BMI> option causes the compiler to load the specified BMI for the module specified by <module-name> when necessary. The main difference is that -fmodule-file=<path/to/BMI> will load the BMI eagerly, whereas -fmodule-file=<module-name>=<path/to/BMI> will only load the BMI lazily, as will -fprebuilt-module-path. The -fmodule-file=<path/to/BMI> option for named modules is deprecated and will be removed in a future version of Clang.

what does lazily and eagerly loading mean in this context?

rough flickerBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

gentle widget
#

load the specified BMI directly

load the specified BMI for the module specified by <module-name> when necessary

#

So "eagerly" means loading the BMI immediately when starting the compiler, and "lazily" is loading the BMI when it's imported

marsh beacon
#

ah, okay