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

Method GetStringCharPtr

IDEHelper/Compiler/BfModule.cpp:1860–1880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1858}
1859
1860BfIRValue BfModule::GetStringCharPtr(int stringId, bool force)
1861{
1862 if ((mBfIRBuilder->mIgnoreWrites) && (!force))
1863 {
1864 mUnreifiedStringPoolRefs.Add(stringId);
1865 return mBfIRBuilder->CreateConst(BfTypeCode_StringId, stringId);
1866 }
1867
1868 BfIRValue* irValue = NULL;
1869 if (!mStringCharPtrPool.TryAdd(stringId, NULL, &irValue))
1870 return *irValue;
1871
1872 // If this wasn't in neither dictionary yet, add to mStringPoolRefs
1873 if (!mStringObjectPool.ContainsKey(stringId))
1874 mStringPoolRefs.Add(stringId);
1875
1876 const StringImpl& str = mContext->mStringObjectIdMap[stringId].mString;
1877 BfIRValue strCharPtrConst = CreateStringCharPtr(str, stringId, false);
1878 *irValue = strCharPtrConst;
1879 return strCharPtrConst;
1880}
1881
1882BfIRValue BfModule::GetStringCharPtr(BfIRValue strValue, bool force)
1883{

Callers 5

CreateConstantMethod · 0.80
GetLiteralMethod · 0.80

Calls 8

ContainsKeyMethod · 0.80
CreateInBoundsGEPMethod · 0.80
AddMethod · 0.45
CreateConstMethod · 0.45
TryAddMethod · 0.45
IsConstMethod · 0.45
CreateLoadMethod · 0.45
GetConstantMethod · 0.45

Tested by

no test coverage detected