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