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

Method TryGetConstString

IDEHelper/Compiler/BfModule.cpp:13313–13331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13311}
13312
13313bool BfModule::TryGetConstString(BfIRConstHolder* constHolder, BfIRValue irValue, StringImpl& str)
13314{
13315 auto constant = constHolder->GetConstant(irValue);
13316 if (constant == NULL)
13317 return false;
13318 if (constant->mTypeCode != BfTypeCode_StringId)
13319 return false;
13320 int stringId = constant->mInt32;
13321 BfStringPoolEntry* entry = NULL;
13322 if (mContext->mStringObjectIdMap.TryGetValue(stringId, &entry))
13323 {
13324 str += entry->mString;
13325 }
13326 else
13327 {
13328 BF_DBG_FATAL("Failed to find string by id");
13329 }
13330 return true;
13331}
13332
13333BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue& value, bool allowUndef)
13334{

Callers 1

Calls 2

TryGetValueMethod · 0.80
GetConstantMethod · 0.45

Tested by

no test coverage detected