Avoid GC allocation
This commit is contained in:
parent
73d8ff66dc
commit
a890ece1d0
|
|
@ -366,20 +366,15 @@ final class FirstPass : ASTVisitor
|
|||
currentSymbol = rootSymbol;
|
||||
moduleScope = GCAllocator.instance.make!Scope(0, uint.max);
|
||||
currentScope = moduleScope;
|
||||
auto objectLocations = cache.resolveImportLocations("object");
|
||||
if (objectLocations is null)
|
||||
warning("Could not locate object.d or object.di");
|
||||
else
|
||||
{
|
||||
foreach (objectLocation; objectLocations)
|
||||
{
|
||||
auto numResolved = cache.resolveImportLocations("object", (objectLocation) {
|
||||
auto objectImport = allocateSemanticSymbol(IMPORT_SYMBOL_NAME,
|
||||
CompletionKind.importSymbol, objectLocation);
|
||||
objectImport.acSymbol.skipOver = true;
|
||||
currentSymbol.addChild(objectImport, true);
|
||||
currentScope.addSymbol(objectImport.acSymbol, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
if (numResolved == 0)
|
||||
warning("Could not locate any object.d or object.di");
|
||||
foreach (s; builtinSymbols[])
|
||||
currentScope.addSymbol(s, false);
|
||||
mod.accept(this);
|
||||
|
|
|
|||
Loading…
Reference in New Issue