Package proguard.analysis.cpa.util
Class ValueAnalyzer.Builder
- java.lang.Object
-
- proguard.analysis.cpa.util.ValueAnalyzer.Builder
-
- Enclosing class:
- ValueAnalyzer
public static class ValueAnalyzer.Builder extends java.lang.ObjectClass to configure and build aValueAnalyzer.Each separate built
ValueAnalyzeruses its ownBamCache, so different analyzers won't share results, while all execution ofValueAnalyzer.analyze(MethodSignature)from the same analyzer will use the same cache.
-
-
Constructor Summary
Constructors Constructor Description Builder(JvmCfa cfa, ClassPool programClassPool, ClassPool libraryClassPool)Create a builder for aValueAnalyzerusing a defaultExecutingInvocationUnit.Builder(JvmCfa cfa, ExecutingInvocationUnit.Builder invocationUnitBuilder)Create a builder for aValueAnalyzerusing a customExecutingInvocationUnit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAnalyzerbuild()Build aValueAnalyzer.ValueAnalyzer.BuildersetAbortOperator(AbortOperator abortOperator)Sets the abort operator to allow premature CPA algorithm termination.ValueAnalyzer.BuildersetMaxCallStackDepth(int maxCallStackDepth)Set the max depth call depth of the inter-procedural analysis.
-
-
-
Constructor Detail
-
Builder
public Builder(JvmCfa cfa, ClassPool programClassPool, ClassPool libraryClassPool)
Create a builder for aValueAnalyzerusing a defaultExecutingInvocationUnit.The
InvocationUnitdefines how to handle invocations ofLibraryMethods through customExecutors.The only executor for the default invocation unit is
StringReflectionExecutor.
-
Builder
public Builder(JvmCfa cfa, ExecutingInvocationUnit.Builder invocationUnitBuilder)
Create a builder for aValueAnalyzerusing a customExecutingInvocationUnit.The
InvocationUnitdefines how to handle invocations ofLibraryMethods.
-
-
Method Detail
-
build
public ValueAnalyzer build()
Build aValueAnalyzer.
-
setMaxCallStackDepth
public ValueAnalyzer.Builder setMaxCallStackDepth(int maxCallStackDepth)
Set the max depth call depth of the inter-procedural analysis. After the max depth has been reached, the analysis will provide a default result for the method (i.e., in the same wayLibraryMethods are usually not analyzed).The default value is 10.
- Parameters:
maxCallStackDepth- maximum depth of the call stack analyzed inter-procedurally. 0 means intra-procedural analysis. < 0 means no maximum depth.- Returns:
- this
ValueAnalyzerbuilder.
-
setAbortOperator
public ValueAnalyzer.Builder setAbortOperator(AbortOperator abortOperator)
Sets the abort operator to allow premature CPA algorithm termination.The default operator never aborts the analysis.
- Parameters:
abortOperator- anAbortOperator.- Returns:
- this
ValueAnalyzerbuilder.
-
-