MCPcopy Create free account
hub / github.com/csyonghe/Spire / AddInstrConstantInt

Method AddInstrConstantInt

Source/SpireCore/SpirVCodeGen.cpp:2261–2273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2259 }
2260
2261 int AddInstrConstantInt(int i)
2262 {
2263 auto Type = GetTypeFromString("int");
2264 if (Dictionary_ConstantIntToID.ContainsKey(i))
2265 return Dictionary_ConstantIntToID[i].GetValue();
2266
2267 int typeID = DefineType(Type);
2268 ++CurrentID;
2269 CodeGen.OpConstantInt(CurrentID, typeID, i);
2270 IDInfos[CurrentID] = IDInfo::CreateIDInfoForValue(CurrentID, Type, 0, typeID);
2271 Dictionary_ConstantIntToID[i] = CurrentID;
2272 return CurrentID;
2273 }
2274
2275 int AddInstrConstantUInt(unsigned int i)
2276 {

Callers 2

GetOperandValueMethod · 0.80
PrintBinaryInstrMethod · 0.80

Calls 3

GetTypeFromStringFunction · 0.85
OpConstantIntMethod · 0.80
ContainsKeyMethod · 0.45

Tested by

no test coverage detected