MCPcopy Create free account
hub / github.com/LFYSec/MScan / print

Method print

src/main/java/pascal/taie/ir/IRPrinter.java:38–58  ·  view source on GitHub ↗
(IR ir, PrintStream out)

Source from the content-addressed store, hash-verified

36public class IRPrinter {
37
38 public static void print(IR ir, PrintStream out) {
39 // print method signature
40 out.println("---------- " + ir.getMethod() + " ----------");
41 // print parameters
42 out.print("Parameters: ");
43 out.println(ir.getParams()
44 .stream()
45 .map(p -> p.getType() + " " + p)
46 .collect(Collectors.joining(", ")));
47 // print all variables
48 out.println("Variables:");
49 ir.getVars().forEach(v -> out.println(v.getType() + " " + v));
50 // print all statements
51 out.println("Statements:");
52 ir.forEach(s -> out.println(toString(s)));
53 // print all try-catch blocks
54 if (!ir.getExceptionEntries().isEmpty()) {
55 out.println("Exception entries:");
56 ir.getExceptionEntries().forEach(b -> out.println(" " + b));
57 }
58 }
59
60 public static String toString(Stmt stmt) {
61 if (stmt instanceof Invoke) {

Callers 10

testIRBuilderMethod · 0.95
printIRMethod · 0.95
testMethod · 0.95
dumpClassDeclarationMethod · 0.45
dumpFieldMethod · 0.45
dumpModifiersMethod · 0.45
dumpMethodMethod · 0.45
dumpMethodDeclarationMethod · 0.45
dumpVariablesMethod · 0.45
dumpElementMethod · 0.45

Calls 10

toStringMethod · 0.95
streamMethod · 0.80
getMethodMethod · 0.65
mapMethod · 0.65
getParamsMethod · 0.65
getTypeMethod · 0.65
forEachMethod · 0.65
getVarsMethod · 0.65
isEmptyMethod · 0.65
getExceptionEntriesMethod · 0.65

Tested by 3

testIRBuilderMethod · 0.76
printIRMethod · 0.76
testMethod · 0.76