| 13311 | } |
| 13312 | |
| 13313 | bool 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 | |
| 13333 | BfVariant BfModule::TypedValueToVariant(BfAstNode* refNode, const BfTypedValue& value, bool allowUndef) |
| 13334 | { |
no test coverage detected