mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-15 13:37:01 +02:00
Run semantic3 on imported modules, and emit new symbols with
`available_externally` linkage. This allows the inliner to inline functions from other modules while telling the code generator to ignore those functions (treat them as declarations) Still generates a few extra `TypeInfo`s and strings... Disabled when generating debug info because I don't really understand it, and it doesn't like this.
This commit is contained in:
@@ -635,6 +635,8 @@ VarDeclaration::VarDeclaration(Loc loc, Type *type, Identifier *id, Initializer
|
||||
offset2 = 0;
|
||||
|
||||
nakedUse = false;
|
||||
|
||||
availableExternally = true; // assume this unless proven otherwise
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1091,6 +1093,16 @@ void VarDeclaration::semantic2(Scope *sc)
|
||||
}
|
||||
}
|
||||
|
||||
void VarDeclaration::semantic3(Scope *sc)
|
||||
{
|
||||
// LDC
|
||||
if (!global.params.useAvailableExternally)
|
||||
availableExternally = false;
|
||||
|
||||
// Preserve call chain
|
||||
Declaration::semantic3(sc);
|
||||
}
|
||||
|
||||
const char *VarDeclaration::kind()
|
||||
{
|
||||
return "variable";
|
||||
@@ -1296,6 +1308,9 @@ Dsymbol *TypeInfoDeclaration::syntaxCopy(Dsymbol *s)
|
||||
void TypeInfoDeclaration::semantic(Scope *sc)
|
||||
{
|
||||
assert(linkage == LINKc);
|
||||
// LDC
|
||||
if (!global.params.useAvailableExternally)
|
||||
availableExternally = false;
|
||||
}
|
||||
|
||||
/***************************** TypeInfoConstDeclaration **********************/
|
||||
|
||||
Reference in New Issue
Block a user