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.Object
Class to configure and build aValueAnalyzer
.Each separate built
ValueAnalyzer
uses 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 aValueAnalyzer
using a defaultExecutingInvocationUnit
.Builder(JvmCfa cfa, ExecutingInvocationUnit.Builder invocationUnitBuilder)
Create a builder for aValueAnalyzer
using a customExecutingInvocationUnit
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAnalyzer
build()
Build aValueAnalyzer
.ValueAnalyzer.Builder
setAbortOperator(AbortOperator abortOperator)
Sets the abort operator to allow premature CPA algorithm termination.ValueAnalyzer.Builder
setMaxCallStackDepth(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 aValueAnalyzer
using a defaultExecutingInvocationUnit
.The
InvocationUnit
defines how to handle invocations ofLibraryMethod
s through customExecutor
s.The only executor for the default invocation unit is
StringReflectionExecutor
.
-
Builder
public Builder(JvmCfa cfa, ExecutingInvocationUnit.Builder invocationUnitBuilder)
Create a builder for aValueAnalyzer
using a customExecutingInvocationUnit
.The
InvocationUnit
defines how to handle invocations ofLibraryMethod
s.
-
-
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 wayLibraryMethod
s 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
ValueAnalyzer
builder.
-
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
ValueAnalyzer
builder.
-
-