From 839ca994a667601fca2b8174eaa394e6a6e1b60f Mon Sep 17 00:00:00 2001 From: Jeffrey-J-Ma <13196530@student.uts.edu.au> Date: Tue, 17 May 2022 02:09:13 +1000 Subject: [PATCH] fix merge conflicts --- lib/Util/Options.cpp | 1300 +++++++++++++++++++++--------------------- 1 file changed, 650 insertions(+), 650 deletions(-) diff --git a/lib/Util/Options.cpp b/lib/Util/Options.cpp index 9a8766169..452ee98b2 100644 --- a/lib/Util/Options.cpp +++ b/lib/Util/Options.cpp @@ -186,615 +186,615 @@ namespace SVF llvm::cl::values( clEnumValN(PointerAnalysis::FlowS_DDA, "dfs", "Demand-driven flow sensitive analysis"), clEnumValN(PointerAnalysis::Cxt_DDA, "cxt", "Demand-driven context- flow- sensitive analysis") - )); - - // FlowDDA.cpp - const llvm::cl::opt Options::FlowBudget( - "flow-bg", - llvm::cl::init(10000), - llvm::cl::desc("Maximum step budget of flow-sensitive traversing") - ); - - - // Offline constraint graph (OfflineConsG.cpp) - const llvm::cl::opt Options::OCGDotGraph( - "dump-ocg", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of Offline Constraint Graph") - ); - - - // Program Assignment Graph for pointer analysis (SVFIR.cpp) - llvm::cl::opt Options::HandBlackHole( - "blk", - llvm::cl::init(false), - llvm::cl::desc("Hanle blackhole edge") - ); - - const llvm::cl::opt Options::FirstFieldEqBase( - "ff-eq-base", - llvm::cl::init(true), - llvm::cl::desc("Treat base objects as their first fields") - ); - - - // SVFG optimizer (SVFGOPT.cpp) - const llvm::cl::opt Options::ContextInsensitive( - "ci-svfg", - llvm::cl::init(false), - llvm::cl::desc("Reduce SVFG into a context-insensitive one") - ); - - const llvm::cl::opt Options::KeepAOFI( - "keep-aofi", - llvm::cl::init(false), - llvm::cl::desc("Keep formal-in and actual-out parameters") - ); - - const llvm::cl::opt Options::SelfCycle( - "keep-self-cycle", - llvm::cl::value_desc("keep self cycle"), - llvm::cl::desc("How to handle self cycle edges: all, context, none") - ); - - - // Sparse value-flow graph (VFG.cpp) - const llvm::cl::opt Options::DumpVFG( - "dump-vfg", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of VFG") - ); - - - // Location set for modeling abstract memory object (LocationSet.cpp) - const llvm::cl::opt Options::SingleStride( - "stride-only", - llvm::cl::init(false), - llvm::cl::desc("Only use single stride in LocMemoryModel") - ); - - - // Base class of pointer analyses (PointerAnalysis.cpp) - const llvm::cl::opt Options::TypePrint( - "print-type", - llvm::cl::init(false), - llvm::cl::desc("Print type") - ); - - const llvm::cl::opt Options::FuncPointerPrint( - "print-fp", - llvm::cl::init(false), - llvm::cl::desc("Print targets of indirect call site") - ); - - const llvm::cl::opt Options::PTSPrint( - "print-pts", - llvm::cl::init(false), - llvm::cl::desc("Print points-to set of top-level pointers") - ); - - const llvm::cl::opt Options::PTSAllPrint( - "print-all-pts", - llvm::cl::init(false), - llvm::cl::desc("Print all points-to set of both top-level and address-taken variables") - ); - - const llvm::cl::opt Options::PStat( - "stat", - llvm::cl::init(true), - llvm::cl::desc("Statistic for Pointer analysis") - ); - - const llvm::cl::opt Options::StatBudget( - "stat-limit", - llvm::cl::init(20), - llvm::cl::desc("Iteration budget for On-the-fly statistics") - ); - - const llvm::cl::opt Options::PAGDotGraph( - "dump-pag", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of SVFIR") - ); - - const llvm::cl::opt Options::ShowSVFIRValue( - "show-ir-value", - llvm::cl::init(true), - llvm::cl::desc("Show values of SVFIR (e.g., when generating dot graph)") - ); - - const llvm::cl::opt Options::DumpICFG( - "dump-icfg", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of ICFG") - ); - - const llvm::cl::opt Options::CallGraphDotGraph( - "dump-callgraph", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of Call Graph") - ); - - const llvm::cl::opt Options::PAGPrint( - "print-pag", - llvm::cl::init(false), - llvm::cl::desc("Print SVFIR to command line") - ); - - const llvm::cl::opt Options::IndirectCallLimit( - "ind-call-limit", - llvm::cl::init(50000), - llvm::cl::desc("Indirect solved call edge limit") - ); - - const llvm::cl::opt Options::UsePreCompFieldSensitive( - "pre-field-sensitive", - llvm::cl::init(true), - llvm::cl::desc("Use pre-computed field-sensitivity for later analysis") - ); - - const llvm::cl::opt Options::EnableAliasCheck( - "alias-check", - llvm::cl::init(true), - llvm::cl::desc("Enable alias check functions") - ); - - const llvm::cl::opt Options::EnableThreadCallGraph( - "enable-tcg", - llvm::cl::init(true), - llvm::cl::desc("Enable pointer analysis to use thread call graph") - ); - - const llvm::cl::opt Options::ConnectVCallOnCHA( - "v-call-cha", - llvm::cl::init(false), - llvm::cl::desc("connect virtual calls using cha") - ); - - - // PointerAnalysisImpl.cpp - const llvm::cl::opt Options::INCDFPTData( - "inc-data", - llvm::cl::init(true), - llvm::cl::desc("Enable incremental DFPTData for flow-sensitive analysis") - ); - - const llvm::cl::opt Options::ClusterAnder( - "cluster-ander", - llvm::cl::init(false), - llvm::cl::desc("Stage Andersen's with Steensgard's and cluster based on that") - ); - - const llvm::cl::opt Options::ClusterFs( - "cluster-fs", - llvm::cl::init(false), - llvm::cl::desc("Cluster for FS/VFS with auxiliary Andersen's") - ); - - const llvm::cl::opt Options::PlainMappingFs( - "plain-mapping-fs", - llvm::cl::init(false), - llvm::cl::desc("Use an explicitly (not null) plain mapping for FS") - ); - - const llvm::cl::opt Options::PtType( - "pt-type", - llvm::cl::init(PointsTo::Type::SBV), - llvm::cl::desc("points-to set data structure to use in all analyses"), - llvm::cl::values( - clEnumValN(PointsTo::Type::SBV, "sbv", "sparse bit-vector"), - clEnumValN(PointsTo::Type::CBV, "cbv", "core bit-vector (dynamic bit-vector without leading and trailing 0s)"), - clEnumValN(PointsTo::Type::BV, "bv", "bit-vector (dynamic bit-vector without trailing 0s)") - ) - ); - - const llvm::cl::opt Options::ClusterMethod( - "cluster-method", - llvm::cl::init(HCLUST_METHOD_SVF_BEST), - llvm::cl::desc("hierarchical clustering method for objects"), - // TODO: maybe add descriptions. - llvm::cl::values( - clEnumValN(HCLUST_METHOD_SINGLE, "single", "single linkage; minimum spanning tree algorithm"), - clEnumValN(HCLUST_METHOD_COMPLETE, "complete", "complete linkage; nearest-neighbour-chain algorithm"), - clEnumValN(HCLUST_METHOD_AVERAGE, "average", "unweighted average linkage; nearest-neighbour-chain algorithm"), - clEnumValN(HCLUST_METHOD_SVF_BEST, "best", "try all linkage criteria; choose best") - ) - ); - - const llvm::cl::opt Options::RegionedClustering( - // Use cluster to "gather" the options closer together, even if it sounds a little worse. - "cluster-regioned", - llvm::cl::init(true), - llvm::cl::desc("cluster regions separately") - ); - - const llvm::cl::opt Options::RegionAlign( - "cluster-region-aligned", - llvm::cl::init(true), - llvm::cl::desc("align each region's identifiers to the native word size") - ); - - const llvm::cl::opt Options::PredictPtOcc( - "cluster-predict-occ", - llvm::cl::init(false), - llvm::cl::desc("try to predict which points-to sets are more important in staged analysis") - ); - - // Memory region (MemRegion.cpp) - const llvm::cl::opt Options::IgnoreDeadFun( - "mssa-ignore-dead-fun", - llvm::cl::init(false), - llvm::cl::desc("Don't construct memory SSA for deadfunction") - ); - - - // Base class of pointer analyses (MemSSA.cpp) - const llvm::cl::opt Options::DumpMSSA( - "dump-mssa", - llvm::cl::init(false), - llvm::cl::desc("Dump memory SSA") - ); - - const llvm::cl::opt Options::MSSAFun( - "mssa-fun", - llvm::cl::init(""), - llvm::cl::desc("Please specify which function needs to be dumped") - ); - - const llvm::cl::opt Options::MemPar( - "mem-par", - llvm::cl::init(MemSSA::MemPartition::IntraDisjoint), - llvm::cl::desc("Memory region partiion strategies (e.g., for SVFG construction)"), - llvm::cl::values( - clEnumValN(MemSSA::MemPartition::Distinct, "distinct", "memory region per each object"), - clEnumValN(MemSSA::MemPartition::IntraDisjoint, "intra-disjoint", "memory regions partioned based on each function"), - clEnumValN(MemSSA::MemPartition::InterDisjoint, "inter-disjoint", "memory regions partioned across functions")) - ); - - - // SVFG builder (SVFGBuilder.cpp) - const llvm::cl::opt Options::SVFGWithIndirectCall( - "svfg-with-ind-call", - llvm::cl::init(false), - llvm::cl::desc("Update Indirect Calls for SVFG using pre-analysis") - ); - - const llvm::cl::opt Options::SingleVFG( - "single-vfg", - llvm::cl::init(false), - llvm::cl::desc("Create a single VFG shared by multiple analysis") - ); - - llvm::cl::opt Options::OPTSVFG( - "opt-svfg", - llvm::cl::init(false), - llvm::cl::desc("Optimize SVFG to eliminate formal-in and actual-out") - ); - - const llvm::cl::opt Options::WriteSVFG( - "write-svfg", - llvm::cl::init(""), - llvm::cl::desc("Write Andersen's analysis results to a file") - ); - - const llvm::cl::opt Options::ReadSVFG( - "read-svfg", - llvm::cl::init(""), - llvm::cl::desc("Read Andersen's analysis results from a file") - ); - - // FSMPTA.cpp - const llvm::cl::opt Options::UsePCG( - "pcg-td-edge", - llvm::cl::init(false), - llvm::cl::desc("Use PCG lock for non-sparsely adding SVFG edges") - ); - - const llvm::cl::opt Options::IntraLock( - "intra-lock-td-edge", - llvm::cl::init(true), - llvm::cl::desc("Use simple intra-procedual lock for adding SVFG edges") - ); - - const llvm::cl::opt Options::ReadPrecisionTDEdge( - "rp-td-edge", - llvm::cl::init(false), - llvm::cl::desc("perform read precision to refine SVFG edges") - ); - - const llvm::cl::opt Options::AddModelFlag( - "add-td-edge", - llvm::cl::init(0), - llvm::cl::desc("Add thread SVFG edges with models: 0 Non Add Edge; 1 NonSparse; 2 All Optimisation; 3 No MHP; 4 No Alias; 5 No Lock; 6 No Read Precision.") - ); - - - // LockAnalysis.cpp - const llvm::cl::opt Options::PrintLockSpan( - "print-lock", - llvm::cl::init(false), - llvm::cl::desc("Print Thread Interleaving Results") - ); - + )); - // MHP.cpp - const llvm::cl::opt Options::PrintInterLev( - "print-interlev", - llvm::cl::init(false), - llvm::cl::desc("Print Thread Interleaving Results") - ); - - const llvm::cl::opt Options::DoLockAnalysis( - "lock-analysis", +// FlowDDA.cpp +const llvm::cl::opt Options::FlowBudget( + "flow-bg", + llvm::cl::init(10000), + llvm::cl::desc("Maximum step budget of flow-sensitive traversing") +); + + +// Offline constraint graph (OfflineConsG.cpp) +const llvm::cl::opt Options::OCGDotGraph( + "dump-ocg", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of Offline Constraint Graph") +); + + +// Program Assignment Graph for pointer analysis (SVFIR.cpp) +llvm::cl::opt Options::HandBlackHole( + "blk", + llvm::cl::init(false), + llvm::cl::desc("Hanle blackhole edge") +); + +const llvm::cl::opt Options::FirstFieldEqBase( + "ff-eq-base", + llvm::cl::init(true), + llvm::cl::desc("Treat base objects as their first fields") +); + + +// SVFG optimizer (SVFGOPT.cpp) +const llvm::cl::opt Options::ContextInsensitive( + "ci-svfg", + llvm::cl::init(false), + llvm::cl::desc("Reduce SVFG into a context-insensitive one") +); + +const llvm::cl::opt Options::KeepAOFI( + "keep-aofi", + llvm::cl::init(false), + llvm::cl::desc("Keep formal-in and actual-out parameters") +); + +const llvm::cl::opt Options::SelfCycle( + "keep-self-cycle", + llvm::cl::value_desc("keep self cycle"), + llvm::cl::desc("How to handle self cycle edges: all, context, none") +); + + +// Sparse value-flow graph (VFG.cpp) +const llvm::cl::opt Options::DumpVFG( + "dump-vfg", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of VFG") +); + + +// Location set for modeling abstract memory object (LocationSet.cpp) +const llvm::cl::opt Options::SingleStride( + "stride-only", + llvm::cl::init(false), + llvm::cl::desc("Only use single stride in LocMemoryModel") +); + + +// Base class of pointer analyses (PointerAnalysis.cpp) +const llvm::cl::opt Options::TypePrint( + "print-type", + llvm::cl::init(false), + llvm::cl::desc("Print type") +); + +const llvm::cl::opt Options::FuncPointerPrint( + "print-fp", + llvm::cl::init(false), + llvm::cl::desc("Print targets of indirect call site") +); + +const llvm::cl::opt Options::PTSPrint( + "print-pts", + llvm::cl::init(false), + llvm::cl::desc("Print points-to set of top-level pointers") +); + +const llvm::cl::opt Options::PTSAllPrint( + "print-all-pts", + llvm::cl::init(false), + llvm::cl::desc("Print all points-to set of both top-level and address-taken variables") +); + +const llvm::cl::opt Options::PStat( + "stat", + llvm::cl::init(true), + llvm::cl::desc("Statistic for Pointer analysis") +); + +const llvm::cl::opt Options::StatBudget( + "stat-limit", + llvm::cl::init(20), + llvm::cl::desc("Iteration budget for On-the-fly statistics") +); + +const llvm::cl::opt Options::PAGDotGraph( + "dump-pag", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of SVFIR") +); + +const llvm::cl::opt Options::ShowSVFIRValue( + "show-ir-value", llvm::cl::init(true), - llvm::cl::desc("Run Lock Analysis") - ); - - - // MTA.cpp - const llvm::cl::opt Options::AndersenAnno( - "tsan-ander", - llvm::cl::init(false), - llvm::cl::desc("Add TSan annotation according to Andersen") - ); - - const llvm::cl::opt Options::FSAnno( - "tsan-fs", - llvm::cl::init(false), - llvm::cl::desc("Add TSan annotation according to flow-sensitive analysis") - ); - - - // MTAAnnotator.cpp - const llvm::cl::opt Options::AnnoFlag( - "anno", - llvm::cl::init(0), - llvm::cl::desc("prune annotated instructions: 0001 Thread Local; 0002 Alias; 0004 MHP.") - ); - - - // MTAResultValidator.cpp - const llvm::cl::opt Options::PrintValidRes( - "mhp-validation", - llvm::cl::init(false), - llvm::cl::desc("Print MHP Validation Results") - ); - // LockResultValidator.cpp - const llvm::cl::opt Options::LockValid( - "lock-validation", - llvm::cl::init(false), - llvm::cl::desc("Print Lock Validation Results") - ); - - - // MTAStat.cpp - const llvm::cl::opt Options::AllPairMHP( - "all-pair-mhp", - llvm::cl::init(false), - llvm::cl::desc("All pair MHP computation") - ); - - - // PCG.cpp - //const llvm::cl::opt TDPrint( - // "print-td", - // llvm::cl::init(true), - // llvm::cl::desc("Print Thread Analysis Results")); - - - // TCT.cpp - const llvm::cl::opt Options::TCTDotGraph( - "dump-tct", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of Call Graph") - ); - - - // LeakChecker.cpp - const llvm::cl::opt Options::ValidateTests( - "valid-tests", - llvm::cl::init(false), - llvm::cl::desc("Validate memory leak tests") - ); - - - // Source-sink analyzer (SrcSnkDDA.cpp) - const llvm::cl::opt Options::DumpSlice( - "dump-slice", - llvm::cl::init(false), - llvm::cl::desc("Dump dot graph of Saber Slices") - ); - - const llvm::cl::opt Options::CxtLimit( - "cxt-limit", - llvm::cl::init(3), - llvm::cl::desc("Source-Sink Analysis Contexts Limit") - ); - - - // CHG.cpp - const llvm::cl::opt Options::DumpCHA( - "dump-cha", - llvm::cl::init(false), - llvm::cl::desc("dump the class hierarchy graph") - ); - - - // DCHG.cpp - const llvm::cl::opt Options::PrintDCHG( - "print-dchg", - llvm::cl::init(false), - llvm::cl::desc("print the DCHG if debug information is available") - ); - - - // LLVMModule.cpp - const llvm::cl::opt Options::Graphtxt( - "graph-txt", - llvm::cl::value_desc("filename"), - llvm::cl::desc("graph txt file to build SVFIR") - ); - - const llvm::cl::opt Options::SVFMain( - "svf-main", - llvm::cl::init(false), - llvm::cl::desc("add svf.main()") - ); - - const llvm::cl::opt Options::ModelConsts( - "model-consts", - llvm::cl::init(false), - llvm::cl::desc("Modeling individual constant objects") - ); - - const llvm::cl::opt Options::ModelArrays( - "model-arrays", - llvm::cl::init(false), - llvm::cl::desc("Modeling Gep offsets for array accesses") - ); - - const llvm::cl::opt Options::SymTabPrint( - "print-symbol-table", llvm::cl::init(false), - llvm::cl::desc("Print Symbol Table to command line") - ); - - - // Conditions.cpp - const llvm::cl::opt Options::MaxBddSize( - "max-bdd-size", - llvm::cl::init(100000), - llvm::cl::desc("Maximum context limit for DDA") - ); - - - // PathCondAllocator.cpp - const llvm::cl::opt Options::PrintPathCond( - "print-pc", - llvm::cl::init(false), - llvm::cl::desc("Print out path condition") - ); - - - // SVFUtil.cpp - const llvm::cl::opt Options::DisableWarn( - "dwarn", + llvm::cl::desc("Show values of SVFIR (e.g., when generating dot graph)") +); + +const llvm::cl::opt Options::DumpICFG( + "dump-icfg", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of ICFG") +); + +const llvm::cl::opt Options::CallGraphDotGraph( + "dump-callgraph", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of Call Graph") +); + +const llvm::cl::opt Options::PAGPrint( + "print-pag", + llvm::cl::init(false), + llvm::cl::desc("Print SVFIR to command line") +); + +const llvm::cl::opt Options::IndirectCallLimit( + "ind-call-limit", + llvm::cl::init(50000), + llvm::cl::desc("Indirect solved call edge limit") +); + +const llvm::cl::opt Options::UsePreCompFieldSensitive( + "pre-field-sensitive", + llvm::cl::init(true), + llvm::cl::desc("Use pre-computed field-sensitivity for later analysis") +); + +const llvm::cl::opt Options::EnableAliasCheck( + "alias-check", + llvm::cl::init(true), + llvm::cl::desc("Enable alias check functions") +); + +const llvm::cl::opt Options::EnableThreadCallGraph( + "enable-tcg", + llvm::cl::init(true), + llvm::cl::desc("Enable pointer analysis to use thread call graph") +); + +const llvm::cl::opt Options::ConnectVCallOnCHA( + "v-call-cha", + llvm::cl::init(false), + llvm::cl::desc("connect virtual calls using cha") +); + + +// PointerAnalysisImpl.cpp +const llvm::cl::opt Options::INCDFPTData( + "inc-data", + llvm::cl::init(true), + llvm::cl::desc("Enable incremental DFPTData for flow-sensitive analysis") +); + +const llvm::cl::opt Options::ClusterAnder( + "cluster-ander", + llvm::cl::init(false), + llvm::cl::desc("Stage Andersen's with Steensgard's and cluster based on that") +); + +const llvm::cl::opt Options::ClusterFs( + "cluster-fs", + llvm::cl::init(false), + llvm::cl::desc("Cluster for FS/VFS with auxiliary Andersen's") +); + +const llvm::cl::opt Options::PlainMappingFs( + "plain-mapping-fs", + llvm::cl::init(false), + llvm::cl::desc("Use an explicitly (not null) plain mapping for FS") +); + +const llvm::cl::opt Options::PtType( + "pt-type", + llvm::cl::init(PointsTo::Type::SBV), + llvm::cl::desc("points-to set data structure to use in all analyses"), + llvm::cl::values( + clEnumValN(PointsTo::Type::SBV, "sbv", "sparse bit-vector"), + clEnumValN(PointsTo::Type::CBV, "cbv", "core bit-vector (dynamic bit-vector without leading and trailing 0s)"), + clEnumValN(PointsTo::Type::BV, "bv", "bit-vector (dynamic bit-vector without trailing 0s)") + ) +); + +const llvm::cl::opt Options::ClusterMethod( + "cluster-method", + llvm::cl::init(HCLUST_METHOD_SVF_BEST), + llvm::cl::desc("hierarchical clustering method for objects"), + // TODO: maybe add descriptions. + llvm::cl::values( + clEnumValN(HCLUST_METHOD_SINGLE, "single", "single linkage; minimum spanning tree algorithm"), + clEnumValN(HCLUST_METHOD_COMPLETE, "complete", "complete linkage; nearest-neighbour-chain algorithm"), + clEnumValN(HCLUST_METHOD_AVERAGE, "average", "unweighted average linkage; nearest-neighbour-chain algorithm"), + clEnumValN(HCLUST_METHOD_SVF_BEST, "best", "try all linkage criteria; choose best") + ) +); + +const llvm::cl::opt Options::RegionedClustering( + // Use cluster to "gather" the options closer together, even if it sounds a little worse. + "cluster-regioned", + llvm::cl::init(true), + llvm::cl::desc("cluster regions separately") +); + +const llvm::cl::opt Options::RegionAlign( + "cluster-region-aligned", + llvm::cl::init(true), + llvm::cl::desc("align each region's identifiers to the native word size") +); + +const llvm::cl::opt Options::PredictPtOcc( + "cluster-predict-occ", + llvm::cl::init(false), + llvm::cl::desc("try to predict which points-to sets are more important in staged analysis") +); + +// Memory region (MemRegion.cpp) +const llvm::cl::opt Options::IgnoreDeadFun( + "mssa-ignore-dead-fun", + llvm::cl::init(false), + llvm::cl::desc("Don't construct memory SSA for deadfunction") +); + + +// Base class of pointer analyses (MemSSA.cpp) +const llvm::cl::opt Options::DumpMSSA( + "dump-mssa", + llvm::cl::init(false), + llvm::cl::desc("Dump memory SSA") +); + +const llvm::cl::opt Options::MSSAFun( + "mssa-fun", + llvm::cl::init(""), + llvm::cl::desc("Please specify which function needs to be dumped") +); + +const llvm::cl::opt Options::MemPar( + "mem-par", + llvm::cl::init(MemSSA::MemPartition::IntraDisjoint), + llvm::cl::desc("Memory region partiion strategies (e.g., for SVFG construction)"), + llvm::cl::values( + clEnumValN(MemSSA::MemPartition::Distinct, "distinct", "memory region per each object"), + clEnumValN(MemSSA::MemPartition::IntraDisjoint, "intra-disjoint", "memory regions partioned based on each function"), + clEnumValN(MemSSA::MemPartition::InterDisjoint, "inter-disjoint", "memory regions partioned across functions")) +); + + +// SVFG builder (SVFGBuilder.cpp) +const llvm::cl::opt Options::SVFGWithIndirectCall( + "svfg-with-ind-call", + llvm::cl::init(false), + llvm::cl::desc("Update Indirect Calls for SVFG using pre-analysis") +); + +const llvm::cl::opt Options::SingleVFG( + "single-vfg", + llvm::cl::init(false), + llvm::cl::desc("Create a single VFG shared by multiple analysis") +); + +llvm::cl::opt Options::OPTSVFG( + "opt-svfg", + llvm::cl::init(false), + llvm::cl::desc("Optimize SVFG to eliminate formal-in and actual-out") +); + +const llvm::cl::opt Options::WriteSVFG( + "write-svfg", + llvm::cl::init(""), + llvm::cl::desc("Write Andersen's analysis results to a file") +); + +const llvm::cl::opt Options::ReadSVFG( + "read-svfg", + llvm::cl::init(""), + llvm::cl::desc("Read Andersen's analysis results from a file") +); + +// FSMPTA.cpp +const llvm::cl::opt Options::UsePCG( + "pcg-td-edge", + llvm::cl::init(false), + llvm::cl::desc("Use PCG lock for non-sparsely adding SVFG edges") +); + +const llvm::cl::opt Options::IntraLock( + "intra-lock-td-edge", + llvm::cl::init(true), + llvm::cl::desc("Use simple intra-procedual lock for adding SVFG edges") +); + +const llvm::cl::opt Options::ReadPrecisionTDEdge( + "rp-td-edge", + llvm::cl::init(false), + llvm::cl::desc("perform read precision to refine SVFG edges") +); + +const llvm::cl::opt Options::AddModelFlag( + "add-td-edge", + llvm::cl::init(0), + llvm::cl::desc("Add thread SVFG edges with models: 0 Non Add Edge; 1 NonSparse; 2 All Optimisation; 3 No MHP; 4 No Alias; 5 No Lock; 6 No Read Precision.") +); + + +// LockAnalysis.cpp +const llvm::cl::opt Options::PrintLockSpan( + "print-lock", + llvm::cl::init(false), + llvm::cl::desc("Print Thread Interleaving Results") +); + + +// MHP.cpp +const llvm::cl::opt Options::PrintInterLev( + "print-interlev", + llvm::cl::init(false), + llvm::cl::desc("Print Thread Interleaving Results") +); + +const llvm::cl::opt Options::DoLockAnalysis( + "lock-analysis", + llvm::cl::init(true), + llvm::cl::desc("Run Lock Analysis") +); + + +// MTA.cpp +const llvm::cl::opt Options::AndersenAnno( + "tsan-ander", + llvm::cl::init(false), + llvm::cl::desc("Add TSan annotation according to Andersen") +); + +const llvm::cl::opt Options::FSAnno( + "tsan-fs", + llvm::cl::init(false), + llvm::cl::desc("Add TSan annotation according to flow-sensitive analysis") +); + + +// MTAAnnotator.cpp +const llvm::cl::opt Options::AnnoFlag( + "anno", + llvm::cl::init(0), + llvm::cl::desc("prune annotated instructions: 0001 Thread Local; 0002 Alias; 0004 MHP.") +); + + +// MTAResultValidator.cpp +const llvm::cl::opt Options::PrintValidRes( + "mhp-validation", + llvm::cl::init(false), + llvm::cl::desc("Print MHP Validation Results") +); +// LockResultValidator.cpp +const llvm::cl::opt Options::LockValid( + "lock-validation", + llvm::cl::init(false), + llvm::cl::desc("Print Lock Validation Results") +); + + +// MTAStat.cpp +const llvm::cl::opt Options::AllPairMHP( + "all-pair-mhp", + llvm::cl::init(false), + llvm::cl::desc("All pair MHP computation") +); + + +// PCG.cpp +//const llvm::cl::opt TDPrint( + // "print-td", + // llvm::cl::init(true), + // llvm::cl::desc("Print Thread Analysis Results")); + + +// TCT.cpp +const llvm::cl::opt Options::TCTDotGraph( + "dump-tct", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of Call Graph") +); + + +// LeakChecker.cpp +const llvm::cl::opt Options::ValidateTests( + "valid-tests", + llvm::cl::init(false), + llvm::cl::desc("Validate memory leak tests") +); + + +// Source-sink analyzer (SrcSnkDDA.cpp) +const llvm::cl::opt Options::DumpSlice( + "dump-slice", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of Saber Slices") +); + +const llvm::cl::opt Options::CxtLimit( + "cxt-limit", + llvm::cl::init(3), + llvm::cl::desc("Source-Sink Analysis Contexts Limit") +); + + +// CHG.cpp +const llvm::cl::opt Options::DumpCHA( + "dump-cha", + llvm::cl::init(false), + llvm::cl::desc("dump the class hierarchy graph") +); + + +// DCHG.cpp +const llvm::cl::opt Options::PrintDCHG( + "print-dchg", + llvm::cl::init(false), + llvm::cl::desc("print the DCHG if debug information is available") +); + + +// LLVMModule.cpp +const llvm::cl::opt Options::Graphtxt( + "graph-txt", + llvm::cl::value_desc("filename"), + llvm::cl::desc("graph txt file to build SVFIR") +); + +const llvm::cl::opt Options::SVFMain( + "svf-main", + llvm::cl::init(false), + llvm::cl::desc("add svf.main()") +); + +const llvm::cl::opt Options::ModelConsts( + "model-consts", + llvm::cl::init(false), + llvm::cl::desc("Modeling individual constant objects") +); + +const llvm::cl::opt Options::ModelArrays( + "model-arrays", + llvm::cl::init(false), + llvm::cl::desc("Modeling Gep offsets for array accesses") +); + +const llvm::cl::opt Options::SymTabPrint( + "print-symbol-table", llvm::cl::init(false), + llvm::cl::desc("Print Symbol Table to command line") +); + + +// Conditions.cpp +const llvm::cl::opt Options::MaxBddSize( + "max-bdd-size", + llvm::cl::init(100000), + llvm::cl::desc("Maximum context limit for DDA") +); + + +// PathCondAllocator.cpp +const llvm::cl::opt Options::PrintPathCond( + "print-pc", + llvm::cl::init(false), + llvm::cl::desc("Print out path condition") +); + + +// SVFUtil.cpp +const llvm::cl::opt Options::DisableWarn( + "dwarn", + llvm::cl::init(true), + llvm::cl::desc("Disable warning") +); + + +// Andersen.cpp +const llvm::cl::opt Options::ConsCGDotGraph( + "dump-constraint-graph", + llvm::cl::init(false), + llvm::cl::desc("Dump dot graph of Constraint Graph") +); + +const llvm::cl::opt Options::BriefConsCGDotGraph( + "brief-constraint-graph", llvm::cl::init(true), - llvm::cl::desc("Disable warning") - ); - - - // Andersen.cpp - const llvm::cl::opt Options::ConsCGDotGraph( - "dump-constraint-graph", - llvm::cl::init(false), llvm::cl::desc("Dump dot graph of Constraint Graph") - ); - - const llvm::cl::opt Options::BriefConsCGDotGraph( - "brief-constraint-graph", - llvm::cl::init(true), - llvm::cl::desc("Dump dot graph of Constraint Graph") - ); - - const llvm::cl::opt Options::PrintCGGraph( - "print-constraint-graph", - llvm::cl::init(false), - llvm::cl::desc("Print Constraint Graph to Terminal") - ); - - const llvm::cl::opt Options::WriteAnder( - "write-ander", - llvm::cl::init(""), - llvm::cl::desc("-write-ander=ir_annotator (Annotated IR with Andersen's results) or write Andersen's analysis results to a user-specified text file") - ); - - const llvm::cl::opt Options::ReadAnder( - "read-ander", - llvm::cl::init(""), - llvm::cl::desc("-read-ander=ir_annotator (Read Andersen's analysis results from the annotated IR, e.g., *.pre.bc) or from a text file") - ); - - const llvm::cl::opt Options::PtsDiff( - "diff", - llvm::cl::init(true), - llvm::cl::desc("Disable diff pts propagation") - ); - - const llvm::cl::opt Options::MergePWC( - "merge-pwc", - llvm::cl::init(true), - llvm::cl::desc("Enable PWC in graph solving") - ); - - - // FlowSensitive.cpp - const llvm::cl::opt Options::CTirAliasEval( - "ctir-alias-eval", - llvm::cl::init(false), - llvm::cl::desc("Prints alias evaluation of ctir instructions in FS analyses") - ); - - - // FlowSensitiveTBHC.cpp - /// Whether we allow reuse for TBHC. - const llvm::cl::opt Options::TBHCStoreReuse( - "tbhc-store-reuse", - llvm::cl::init(false), - llvm::cl::desc("Allow for object reuse in at stores in FSTBHC") - ); - - const llvm::cl::opt Options::TBHCAllReuse( - "tbhc-all-reuse", - llvm::cl::init(false), - llvm::cl::desc("Allow for object reuse everywhere in FSTBHC") - ); - - - // TypeAnalysis.cpp - const llvm::cl::opt Options::GenICFG( - "gen-icfg", - llvm::cl::init(true), - llvm::cl::desc("Generate ICFG graph") - ); - - - //WPAPass.cpp - const llvm::cl::opt Options::AnderSVFG( - "svfg", - llvm::cl::init(false), - llvm::cl::desc("Generate SVFG after Andersen's Analysis") - ); - - const llvm::cl::opt Options::SABERFULLSVFG( - "saber-full-svfg", - llvm::cl::init(false), - llvm::cl::desc("When using SABER for bug detection pass, enable full svfg on top of the pointer-only one") - ); - - const llvm::cl::opt Options::PrintAliases( - "print-aliases", - llvm::cl::init(false), - llvm::cl::desc("Print results for all pair aliases") - ); - - llvm::cl::bits Options::PASelected( - llvm::cl::desc("Select pointer analysis"), - llvm::cl::values( - clEnumValN(PointerAnalysis::Andersen_WPA, "nander", "Standard inclusion-based analysis"), - clEnumValN(PointerAnalysis::AndersenLCD_WPA, "lander", "Lazy cycle detection inclusion-based analysis"), - clEnumValN(PointerAnalysis::AndersenHCD_WPA, "hander", "Hybrid cycle detection inclusion-based analysis"), - clEnumValN(PointerAnalysis::AndersenHLCD_WPA, "hlander", "Hybrid lazy cycle detection inclusion-based analysis"), - clEnumValN(PointerAnalysis::AndersenSCD_WPA, "sander", "Selective cycle detection inclusion-based analysis"), - clEnumValN(PointerAnalysis::AndersenSFR_WPA, "sfrander", "Stride-based field representation includion-based analysis"), - clEnumValN(PointerAnalysis::AndersenWaveDiff_WPA, "ander", "Diff wave propagation inclusion-based analysis"), - clEnumValN(PointerAnalysis::Steensgaard_WPA, "steens", "Steensgaard's pointer analysis"), - // Disabled till further work is done. - // clEnumValN(PointerAnalysis::AndersenWaveDiffWithType_WPA, "andertype", "Diff wave propagation with type inclusion-based analysis"), - clEnumValN(PointerAnalysis::FSSPARSE_WPA, "fspta", "Sparse flow sensitive pointer analysis"), - clEnumValN(PointerAnalysis::FSTBHC_WPA, "fstbhc", "Sparse flow-sensitive type-based heap cloning pointer analysis"), - clEnumValN(PointerAnalysis::VFS_WPA, "vfspta", "Versioned sparse flow-sensitive points-to analysis"), - clEnumValN(PointerAnalysis::TypeCPP_WPA, "type", "Type-based fast analysis for Callgraph, SVFIR and CHA") - )); +); + +const llvm::cl::opt Options::PrintCGGraph( + "print-constraint-graph", + llvm::cl::init(false), + llvm::cl::desc("Print Constraint Graph to Terminal") +); + +const llvm::cl::opt Options::WriteAnder( + "write-ander", + llvm::cl::init(""), + llvm::cl::desc("-write-ander=ir_annotator (Annotated IR with Andersen's results) or write Andersen's analysis results to a user-specified text file") +); + +const llvm::cl::opt Options::ReadAnder( + "read-ander", + llvm::cl::init(""), + llvm::cl::desc("-read-ander=ir_annotator (Read Andersen's analysis results from the annotated IR, e.g., *.pre.bc) or from a text file") +); + +const llvm::cl::opt Options::PtsDiff( + "diff", + llvm::cl::init(true), + llvm::cl::desc("Disable diff pts propagation") +); + +const llvm::cl::opt Options::MergePWC( + "merge-pwc", + llvm::cl::init(true), + llvm::cl::desc("Enable PWC in graph solving") +); + + +// FlowSensitive.cpp +const llvm::cl::opt Options::CTirAliasEval( + "ctir-alias-eval", + llvm::cl::init(false), + llvm::cl::desc("Prints alias evaluation of ctir instructions in FS analyses") +); + + +// FlowSensitiveTBHC.cpp +/// Whether we allow reuse for TBHC. +const llvm::cl::opt Options::TBHCStoreReuse( + "tbhc-store-reuse", + llvm::cl::init(false), + llvm::cl::desc("Allow for object reuse in at stores in FSTBHC") +); + +const llvm::cl::opt Options::TBHCAllReuse( + "tbhc-all-reuse", + llvm::cl::init(false), + llvm::cl::desc("Allow for object reuse everywhere in FSTBHC") +); + + +// TypeAnalysis.cpp +const llvm::cl::opt Options::GenICFG( + "gen-icfg", + llvm::cl::init(true), + llvm::cl::desc("Generate ICFG graph") +); + + +//WPAPass.cpp +const llvm::cl::opt Options::AnderSVFG( + "svfg", + llvm::cl::init(false), + llvm::cl::desc("Generate SVFG after Andersen's Analysis") +); + +const llvm::cl::opt Options::SABERFULLSVFG( + "saber-full-svfg", + llvm::cl::init(false), + llvm::cl::desc("When using SABER for bug detection pass, enable full svfg on top of the pointer-only one") +); + +const llvm::cl::opt Options::PrintAliases( + "print-aliases", + llvm::cl::init(false), + llvm::cl::desc("Print results for all pair aliases") +); + +llvm::cl::bits Options::PASelected( + llvm::cl::desc("Select pointer analysis"), + llvm::cl::values( + clEnumValN(PointerAnalysis::Andersen_WPA, "nander", "Standard inclusion-based analysis"), + clEnumValN(PointerAnalysis::AndersenLCD_WPA, "lander", "Lazy cycle detection inclusion-based analysis"), + clEnumValN(PointerAnalysis::AndersenHCD_WPA, "hander", "Hybrid cycle detection inclusion-based analysis"), + clEnumValN(PointerAnalysis::AndersenHLCD_WPA, "hlander", "Hybrid lazy cycle detection inclusion-based analysis"), + clEnumValN(PointerAnalysis::AndersenSCD_WPA, "sander", "Selective cycle detection inclusion-based analysis"), + clEnumValN(PointerAnalysis::AndersenSFR_WPA, "sfrander", "Stride-based field representation includion-based analysis"), + clEnumValN(PointerAnalysis::AndersenWaveDiff_WPA, "ander", "Diff wave propagation inclusion-based analysis"), + clEnumValN(PointerAnalysis::Steensgaard_WPA, "steens", "Steensgaard's pointer analysis"), + // Disabled till further work is done. + // clEnumValN(PointerAnalysis::AndersenWaveDiffWithType_WPA, "andertype", "Diff wave propagation with type inclusion-based analysis"), + clEnumValN(PointerAnalysis::FSSPARSE_WPA, "fspta", "Sparse flow sensitive pointer analysis"), + clEnumValN(PointerAnalysis::FSTBHC_WPA, "fstbhc", "Sparse flow-sensitive type-based heap cloning pointer analysis"), + clEnumValN(PointerAnalysis::VFS_WPA, "vfspta", "Versioned sparse flow-sensitive points-to analysis"), + clEnumValN(PointerAnalysis::TypeCPP_WPA, "type", "Type-based fast analysis for Callgraph, SVFIR and CHA") + )); llvm::cl::bits Options::AliasRule(llvm::cl::desc("Select alias check rule"), @@ -803,50 +803,50 @@ namespace SVF clEnumValN(WPAPass::Veto, "veto", "return NoAlias if any pta says no alias") )); - const llvm::cl::opt Options::ShowHiddenNode( - "show-hidden-nodes", - llvm::cl::init(false), - llvm::cl::desc("Show hidden nodes on DOT Graphs (e.g., isolated node on a graph)") - ); - - const llvm::cl::opt Options::InputFilename( - llvm::cl::Positional, - llvm::cl::desc(""), - llvm::cl::init("-") - ); - - const llvm::cl::opt Options::ConditionType( - "cond-type", - llvm::cl::init(CondManager::CondMgrKind::BDDMgrK), - llvm::cl::desc("condition type used in path-sensitive analysis"), - llvm::cl::values( - clEnumValN(CondManager::CondMgrKind::BDDMgrK, "bdd", "BDD condition"), - clEnumValN(CondManager::CondMgrKind::Z3MgrK, "z3", "z3 condition") - ) - ); - - const llvm::cl::opt Options::GrammarFilename( - llvm::cl::Positional, - llvm::cl::desc(""), - llvm::cl::init("-") - ); - - const llvm::cl::opt Options::GraphIsFromDot( - "dot-graph", - llvm::cl::init(false), - llvm::cl::desc("Dot text as graph input") - ); - - const llvm::cl::opt Options::GrammarIsEBNF( - "ebnf-grammar", - llvm::cl::init(false), - llvm::cl::desc("EBNF grammar as grammar input") - ); - - const llvm::cl::opt Options::FlexSymMap( - "flex-symmap", - llvm::cl::init(false), - llvm::cl::desc("extend exist sym map while read graph from dot if sym not in map.") - ); +const llvm::cl::opt Options::ShowHiddenNode( + "show-hidden-nodes", + llvm::cl::init(false), + llvm::cl::desc("Show hidden nodes on DOT Graphs (e.g., isolated node on a graph)") +); + +const llvm::cl::opt Options::InputFilename( + llvm::cl::Positional, + llvm::cl::desc(""), + llvm::cl::init("-") +); + +const llvm::cl::opt Options::ConditionType( + "cond-type", + llvm::cl::init(CondManager::CondMgrKind::BDDMgrK), + llvm::cl::desc("condition type used in path-sensitive analysis"), + llvm::cl::values( + clEnumValN(CondManager::CondMgrKind::BDDMgrK, "bdd", "BDD condition"), + clEnumValN(CondManager::CondMgrKind::Z3MgrK, "z3", "z3 condition") + ) +); + +const llvm::cl::opt Options::GrammarFilename( + llvm::cl::Positional, + llvm::cl::desc(""), + llvm::cl::init("-") +); + +const llvm::cl::opt Options::GraphIsFromDot( + "dot-graph", + llvm::cl::init(false), + llvm::cl::desc("Dot text as graph input") +); + +const llvm::cl::opt Options::GrammarIsEBNF( + "ebnf-grammar", + llvm::cl::init(false), + llvm::cl::desc("EBNF grammar as grammar input") +); + +const llvm::cl::opt Options::FlexSymMap( + "flex-symmap", + llvm::cl::init(false), + llvm::cl::desc("extend exist sym map while read graph from dot if sym not in map.") +); } // namespace SVF.