Class ValueAnalyzer
- java.lang.Object
-
- proguard.analysis.cpa.util.ValueAnalyzer
-
public class ValueAnalyzer extends java.lang.Object
Helper class to analyze values (e.g., function parameters) in a program inter-procedurally.The analyzer can be configured in several ways via
ValueAnalyzer.Builder
.The
analyze(MethodSignature)
method can be called to perform the configured analysis starting from a given method in the program.The same analyzer can be used to analyze several methods in sequence, in this case the analysis
BamCache
will be shared between the sequential analyses making them potentially avoid recalculating the results when a method is called again with known parameters.This might sometimes not be the desired behavior, since the cache might take a lot of memory. If this is a concern rebuilding the
ValueAnalyzer
from the originalValueAnalyzer.Builder
will provide a fresh cache.ValueAnalyzer
is currently not designed to be thread safe. Among the known reasons, the currently availableBamCache
s are not designed for concurrent access and a differentExecutingInvocationUnit
(used byJvmValueTransferRelation
) should be used by each thread.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ValueAnalyzer.Builder
Class to configure and build aValueAnalyzer
.static class
ValueAnalyzer.ValueAnalysisResult
Provides results for the analysis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueAnalyzer.ValueAnalysisResult
analyze(MethodSignature mainSignature)
Run the value analysis on the given method.
-
-
-
Method Detail
-
analyze
public ValueAnalyzer.ValueAnalysisResult analyze(MethodSignature mainSignature)
Run the value analysis on the given method.The results are not intended as just for the last execution, but as a view on the full analysis' cache.
Since the cache at the moment has no capability to remember the last execution, the result will change as the cache changes (i.e., after calling this again on a new method, old instances of
ValueAnalyzer.ValueAnalysisResult
will also be updated).- Parameters:
mainSignature
- the signature of the method to analyze.- Returns:
- the result of the analysis.
-
-