Skip to content

Commit

Permalink
added operator<< statistics to printAsJson
Browse files Browse the repository at this point in the history
  • Loading branch information
mxHuber committed May 8, 2024
1 parent d1078f5 commit 1a2f47a
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions lib/PhasarLLVM/Passes/GeneralStatisticsAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,23 +298,40 @@ void GeneralStatistics::printAsJson(llvm::raw_ostream &OS) const {
Json["AddressTakenFunctions"] = AddressTakenFunctions;
Json["Globals"] = Globals;
Json["GlobalConsts"] = GlobalConsts;
Json["GlobalVariables"].push_back(Globals);
Json["GlobalVariables"].push_back(GlobalConsts);
Json["ExternalGlobals"] = ExternalGlobals;
Json["GlobalsDefinitions"] = GlobalsDefinitions;
Json["AllocaInstructions"] = AllocaInstructions.size();
Json["BasicBlocks"] = BasicBlocks;
Json["TotalNumPredecessorBBs"] = TotalNumPredecessorBBs;
Json["CallSites"] = CallSites;
Json["IndCalls"] = IndCalls;
Json["NumInlineAsm"] = NumInlineAsm;
Json["MemIntrinsics"] = MemIntrinsics;
Json["IndCalls"] = IndCalls;
Json["DebugIntrinsics"] = DebugIntrinsics;
Json["Switches"] = Switches;
Json["Branches"] = Branches;
Json["GetElementPtrs"] = GetElementPtrs;
Json["LandingPads"] = LandingPads;
Json["PhiNodes"] = PhiNodes;
Json["LandingPads"] = LandingPads;
Json["BasicBlocks"] = BasicBlocks;
Json["TotalNumPredecessorBBs"] = TotalNumPredecessorBBs;
Json["Branches"] = Branches;
Json["NonVoidInsts"] = NonVoidInsts;
Json["ModuleName"] = ModuleName;
Json["AvgPredPerBasicBlock"].push_back(TotalNumPredecessorBBs);
Json["AvgPredPerBasicBlock"].push_back(BasicBlocks);
Json["MaxPredPerBasicBlock"] = MaxNumPredecessorBBs;
Json["AvgSuccPerBasicBlock"].push_back(TotalNumSuccessorBBs);
Json["AvgSuccPerBasicBlock"].push_back(BasicBlocks);
Json["MaxSuccPerBasicBlock"] = MaxNumSuccessorBBs;
Json["AvgOperantsPerInst"].push_back(TotalNumOperands);
Json["AvgOperantsPerInst"].push_back(Instructions);
Json["MaxNumOperands"] = MaxNumOperands;
Json["AvgUsesPerInst"].push_back(TotalNumUses);
Json["AvgUsesPerInst"].push_back(Instructions);
Json["MaxUsesPerInst"] = MaxNumUses;
Json["NumInstWithMultipleUses"] = NumInstWithMultipleUses;
Json["NonVoidInsts"] = NonVoidInsts;
Json["NumInstsUsedOutsideBB"] = NumInstsUsedOutsideBB;

OS << Json;
}
Expand Down

0 comments on commit 1a2f47a

Please sign in to comment.