MCPcopy Create free account
hub / github.com/beefytech/Beef / DoAddLocalVariable

Method DoAddLocalVariable

IDEHelper/Compiler/BfModule.cpp:16209–16234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16207}
16208
16209void BfModule::DoAddLocalVariable(BfLocalVariable* localVar)
16210{
16211 BF_ASSERT(localVar->mResolvedType != NULL);
16212
16213 while (localVar->mName.StartsWith('@'))
16214 {
16215 localVar->mNamePrefixCount++;
16216 localVar->mName.Remove(0);
16217 }
16218
16219 if (mCurMethodState->mLocals.mAllocSize == 0)
16220 {
16221 mCurMethodState->mLocals.Reserve(16);
16222 mCurMethodState->mLocalVarSet.Reserve(16);
16223 }
16224
16225 localVar->mLocalVarIdx = (int)mCurMethodState->mLocals.size();
16226 mCurMethodState->mLocals.push_back(localVar);
16227
16228 BfLocalVarEntry* localVarEntryPtr;
16229 if (!mCurMethodState->mLocalVarSet.TryAdd(BfLocalVarEntry(localVar), &localVarEntryPtr))
16230 {
16231 localVar->mShadowedLocal = localVarEntryPtr->mLocalVar;
16232 localVarEntryPtr->mLocalVar = localVar;
16233 }
16234}
16235
16236void BfModule::DoLocalVariableDebugInfo(BfLocalVariable* localVarDef, bool doAliasValue, BfIRValue declareBefore, BfIRInitType initType)
16237{

Callers 1

GetLambdaInstanceMethod · 0.80

Calls 7

BfLocalVarEntryClass · 0.85
StartsWithMethod · 0.45
RemoveMethod · 0.45
ReserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
TryAddMethod · 0.45

Tested by

no test coverage detected