| 3918 | } |
| 3919 | |
| 3920 | addr_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 | |
| 3938 | addr_ce CeContext::GetReflectTypeDecl(int typeId) |
| 3939 | { |
nothing calls this directly
no test coverage detected