• Home
  • Raw
  • Download

Lines Matching refs:allocator

192 bool Scope::AddLocal(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,  in AddLocal()  argument
207 … scope->Bindings().insert({newDecl->Name(), allocator->New<GlobalVariable>(newDecl, varFlags)}); in AddLocal()
209 … scope->PropagateBinding<LocalVariable>(allocator, newDecl->Name(), newDecl, varFlags); in AddLocal()
216 … newDecl->Name(), allocator->New<EnumLiteralVariable>(newDecl, VariableFlags::ENUM_LITERAL)); in AddLocal()
219 …bindings_.insert({newDecl->Name(), allocator->New<LocalVariable>(newDecl, VariableFlags::INTERFACE… in AddLocal()
235 bindings_.insert({newDecl->Name(), allocator->New<LocalVariable>(newDecl, flags)}); in AddLocal()
241 bool ParamScope::AddParam(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, Vari… in AddParam() argument
249 auto *param = allocator->New<LocalVariable>(newDecl, flags); in AddParam()
256 std::tuple<ParameterDecl *, const ir::AstNode *> ParamScope::AddParamDecl(ArenaAllocator *allocator, in AddParamDecl() argument
259 const auto [name, pattern] = util::Helpers::ParamName(allocator, param, params_.size()); in AddParamDecl()
261 auto *decl = NewDecl<ParameterDecl>(allocator, name); in AddParamDecl()
263 if (!AddParam(allocator, FindLocal(name), decl, VariableFlags::VAR)) { in AddParamDecl()
275 auto *varDecl = NewDecl<VarDecl>(allocator, binding->Name()); in AddParamDecl()
282 auto *paramVar = allocator->New<LocalVariable>(varDecl, VariableFlags::VAR); in AddParamDecl()
289 void FunctionParamScope::BindName(ArenaAllocator *allocator, util::StringView name) in BindName() argument
291 nameVar_ = AddDecl<ConstDecl, LocalVariable>(allocator, name, VariableFlags::INITIALIZED); in BindName()
295 bool FunctionParamScope::AddBinding([[maybe_unused]] ArenaAllocator *allocator, in AddBinding() argument
302 bool FunctionScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
307 return AddVar<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
310 return AddFunction<LocalVariable>(allocator, currentVariable, newDecl, extension); in AddBinding()
313 return AddClass<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
316 … return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL); in AddBinding()
319 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE); in AddBinding()
322 … return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS); in AddBinding()
325 … return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE); in AddBinding()
328 return AddLexical<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
333 bool TSEnumScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
337 …return enumMemberBindings_->insert({newDecl->Name(), allocator->New<EnumVariable>(newDecl, false)}… in AddBinding()
340 bool GlobalScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
345 return AddVar<GlobalVariable>(allocator, currentVariable, newDecl); in AddBinding()
348 return AddFunction<GlobalVariable>(allocator, currentVariable, newDecl, extension); in AddBinding()
351 return AddClass<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
354 … return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL); in AddBinding()
357 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE); in AddBinding()
360 … return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS); in AddBinding()
363 … return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE); in AddBinding()
366 return AddLexical<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
375 void ModuleScope::ConvertLocalVariableToModuleVariable(ArenaAllocator *allocator, util::StringView … in ConvertLocalVariableToModuleVariable() argument
385 res->second = allocator->New<ModuleVariable>(decl, flags | VariableFlags::LOCAL_EXPORT); in ConvertLocalVariableToModuleVariable()
397 bool ModuleScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
409 AddVar<ModuleVariable>(allocator, currentVariable, newDecl) : in AddBinding()
410 AddVar<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
420 AddFunction<ModuleVariable>(allocator, currentVariable, newDecl, extension) : in AddBinding()
421 AddFunction<LocalVariable>(allocator, currentVariable, newDecl, extension); in AddBinding()
425 AddClass<ModuleVariable>(allocator, currentVariable, newDecl) : in AddBinding()
426 AddClass<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
429 … return AddTSBinding<EnumLiteralVariable>(allocator, newDecl, VariableFlags::ENUM_LITERAL); in AddBinding()
432 return AddTSBinding<NamespaceVariable>(allocator, newDecl, VariableFlags::NAMESPACE); in AddBinding()
435 … return AddTSBinding<ImportEqualsVariable>(allocator, newDecl, VariableFlags::IMPORT_EQUALS); in AddBinding()
438 … return AddTSBinding<LocalVariable>(allocator, currentVariable, newDecl, VariableFlags::INTERFACE); in AddBinding()
445 AddLexical<ModuleVariable>(allocator, currentVariable, newDecl) : in AddBinding()
446 AddLexical<LocalVariable>(allocator, currentVariable, newDecl); in AddBinding()
453 bool LocalScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
456 return AddLocal(allocator, currentVariable, newDecl, extension); in AddBinding()
473 bool CatchParamScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDec… in AddBinding() argument
476 return AddParam(allocator, currentVariable, newDecl, VariableFlags::INITIALIZED); in AddBinding()
479 bool CatchScope::AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
486 return AddLocal(allocator, currentVariable, newDecl, extension); in AddBinding()