diff --git a/tools/analyze/analyze.cpp b/tools/analyze/analyze.cpp index 492f47142bf..745aa0b0596 100644 --- a/tools/analyze/analyze.cpp +++ b/tools/analyze/analyze.cpp @@ -24,6 +24,7 @@ #include "llvm/Analysis/Expressions.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Analysis/FindUnsafePointerTypes.h" +#include "llvm/Analysis/FindUsedTypes.h" #include static void PrintMethod(Method *M) { @@ -75,6 +76,12 @@ static void PrintUnsafePtrTypes(Module *M) { FUPT.printResults(M, cout); } +static void PrintUsedTypes(Module *M) { + FindUsedTypes FUT; + FUT.run(M); + FUT.printTypes(cout, M); +} + static void PrintDominatorSets(Method *M) { cout << cfg::DominatorSet(M); } @@ -104,7 +111,9 @@ static void PrintPostDomFrontier(Method *M) { enum Ans { PassDone, // Unique Marker - print, intervals, exprclassify, instforest, callgraph, unsafepointertypes, + print, intervals, exprclassify, instforest, callgraph, + printusedtypes, unsafepointertypes, + domset, idom, domtree, domfrontier, postdomset, postidom, postdomtree, postdomfrontier, }; @@ -118,6 +127,7 @@ cl::EnumList AnalysesList(cl::NoFlags, clEnumVal(exprclassify , "Classify Expressions"), clEnumVal(instforest , "Print Instruction Forest"), clEnumVal(callgraph , "Print Call Graph"), + clEnumVal(printusedtypes , "Print Types Used by Module"), clEnumVal(unsafepointertypes, "Print Unsafe Pointer Types"), clEnumVal(domset , "Print Dominator Sets"), @@ -152,7 +162,8 @@ struct { }; pair ModAnTable[] = { - pair(callgraph , PrintCallGraph), + pair(callgraph , PrintCallGraph), + pair(printusedtypes , PrintUsedTypes), pair(unsafepointertypes, PrintUnsafePtrTypes), };