MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / con

Method con

chapter21/src/test/java/com/seaofnodes/simple/Eval2.java:302–311  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

300
301 // Java box ints and floats. Other things can just be null or some informative string
302 private static Object con( Type t ) {
303 return switch ( t ) {
304 case TypeInteger i -> i.isConstant() ? (Long )i.value() : "INT";
305 case TypeFloat f -> f.isConstant() ? (Double)f.value() : "FLT";
306 case TypeMemPtr tmp -> tmp;
307 case TypeFunPtr tfp -> tfp;
308 case TypeMem mem -> "MEM";
309 default -> null;
310 };
311 }
312
313 // Convert array size to array element count
314 private static int offToIdx( long off, TypeStruct t) {

Callers 2

computeMethod · 0.95
allocMethod · 0.95

Calls 2

isConstantMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected