mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
Centralize computation of the "code generation model" for object code & SIL
For a given function, we might end up emitting it's definition as object code, serialized SIL, or both. The @export, @inlinable, and @inline(always) attributes provide control of this behavior at the declaration level. Centralize the query function that will look for each of these attributes and map down to a specific "code generation model", whose 3 options follow the naming from SE-0497: interface, inlinable, and implementation. Use this one computation to back the queries for "always emit into client", "never emit into client", and "inlinable" so we can't get inconsistent results from places that are doing one-off checks for these attributes.
This commit is contained in:
@@ -993,8 +993,7 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
|
||||
M.setIsConcurrencyChecked();
|
||||
if (loadedModuleFile->strictMemorySafety())
|
||||
M.setStrictMemorySafety();
|
||||
if (loadedModuleFile->deferredCodeGen())
|
||||
M.setDeferredCodeGen();
|
||||
M.setCodeGenerationModel(loadedModuleFile->codeGenerationModel());
|
||||
if (loadedModuleFile->isAggressiveCMOEnabled())
|
||||
M.setAggressiveCMOEnabled();
|
||||
M.setStoredLibraryLevel(loadedModuleFile->getLibraryLevel());
|
||||
|
||||
Reference in New Issue
Block a user