mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-15 10:50:05 +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:
@@ -52,6 +52,10 @@ AggregateDeclaration::AggregateDeclaration(Loc loc, Identifier *id)
|
||||
ctor = NULL;
|
||||
defaultCtor = NULL;
|
||||
#endif
|
||||
|
||||
#if IN_LLVM
|
||||
availableExternally = true; // assume this unless proven otherwise
|
||||
#endif
|
||||
}
|
||||
|
||||
enum PROT AggregateDeclaration::prot()
|
||||
@@ -81,6 +85,10 @@ void AggregateDeclaration::semantic2(Scope *sc)
|
||||
void AggregateDeclaration::semantic3(Scope *sc)
|
||||
{ int i;
|
||||
|
||||
// LDC
|
||||
if (!global.params.useAvailableExternally)
|
||||
availableExternally = false;
|
||||
|
||||
//printf("AggregateDeclaration::semantic3(%s)\n", toChars());
|
||||
if (members)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user