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

Method ToRef

IDEHelper/Compiler/BfModule.cpp:13480–13496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13478}
13479
13480BfTypedValue BfModule::ToRef(BfTypedValue typedValue, BfRefType* refType)
13481{
13482 if (refType == NULL)
13483 refType = CreateRefType(typedValue.mType);
13484
13485 if ((refType->mRefKind == BfRefType::RefKind_Mut) && (typedValue.mType->IsObjectOrInterface()))
13486 {
13487 return LoadValue(typedValue);
13488 }
13489
13490 if (refType->mRefKind == BfRefType::RefKind_Mut)
13491 refType = CreateRefType(typedValue.mType);
13492
13493 if (!typedValue.mType->IsValuelessNonOpaqueType())
13494 typedValue = MakeAddressable(typedValue, false, true);
13495 return BfTypedValue(typedValue.mValue, refType);
13496}
13497
13498BfTypedValue BfModule::LoadValue(BfTypedValue typedValue, BfAstNode* refNode, bool isVolatile)
13499{

Callers 1

CreateCallMethod · 0.80

Calls 3

BfTypedValueClass · 0.85
IsObjectOrInterfaceMethod · 0.45

Tested by

no test coverage detected