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

Method CreateFunction

IDEHelper/Backend/BeModule.cpp:3278–3293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3276}
3277
3278BeFunction* BeModule::CreateFunction(BeFunctionType* funcType, BfIRLinkageType linkageType, const StringImpl& name)
3279{
3280 auto func = mOwnedValues.Alloc<BeFunction>();
3281 func->mName = name;
3282 func->mModule = this;
3283 func->mType = mContext->GetPointerTo(funcType);
3284 func->mLinkageType = linkageType;
3285 func->mParams.Resize(funcType->mParams.size());
3286 mFunctions.push_back(func);
3287
3288#ifdef _DEBUG
3289 // It IS possible hit this, especially if we have multiple intrinsics mapping to 'malloc' for example
3290 //BF_ASSERT(mFunctionMap.TryAdd(name, func));
3291#endif
3292 return func;
3293}
3294
3295BeDbgLoc* BeModule::GetCurrentDebugLocation()
3296{

Callers 1

HandleNextCmdMethod · 0.45

Calls 4

GetPointerToMethod · 0.45
ResizeMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected