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

Method GetConstantData

IDEHelper/Compiler/CeMachine.cpp:3920–3936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3918}
3919
3920addr_ce CeContext::GetConstantData(BeConstant* constant)
3921{
3922 auto writeConstant = constant;
3923 if (auto gvConstant = BeValueDynCast<BeGlobalVariable>(writeConstant))
3924 {
3925 if (gvConstant->mInitializer != NULL)
3926 writeConstant = gvConstant->mInitializer;
3927 }
3928
3929 CeConstStructData structData;
3930 auto result = mCeMachine->WriteConstant(structData, writeConstant, this, NULL);
3931 BF_ASSERT(result == CeErrorKind_None);
3932
3933 uint8* ptr = CeMallocZero(structData.mData.mSize);
3934 memcpy(ptr, structData.mData.mVals, structData.mData.mSize);
3935 return (addr_ce)(ptr - mMemory.mVals);
3936}
3937
3938addr_ce CeContext::GetReflectTypeDecl(int typeId)
3939{

Callers

nothing calls this directly

Calls 1

WriteConstantMethod · 0.45

Tested by

no test coverage detected