mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 09:49:02 +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:
@@ -84,6 +84,8 @@ FuncDeclaration::FuncDeclaration(Loc loc, Loc endloc, Identifier *id, enum STC s
|
||||
isArrayOp = false;
|
||||
allowInlining = false;
|
||||
|
||||
availableExternally = true; // assume this unless proven otherwise
|
||||
|
||||
// function types in ldc don't merge if the context parameter differs
|
||||
// so we actually don't care about the function declaration, but only
|
||||
// what kind of context parameter it has.
|
||||
@@ -674,6 +676,10 @@ void FuncDeclaration::semantic3(Scope *sc)
|
||||
return;
|
||||
semanticRun = 3;
|
||||
|
||||
// LDC
|
||||
if (!global.params.useAvailableExternally)
|
||||
availableExternally = false;
|
||||
|
||||
if (!type || type->ty != Tfunction)
|
||||
return;
|
||||
f = (TypeFunction *)(type);
|
||||
|
||||
Reference in New Issue
Block a user