soot.dava.toolkits.base.AST.structuredAnalysis.MustMayInitialize Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of soot Show documentation
Show all versions of soot Show documentation
A Java Optimization Framework
package soot.dava.toolkits.base.AST.structuredAnalysis;
/*-
* #%L
* Soot - a J*va Optimization Framework
* %%
* Copyright (C) 2006 Nomair A. Naeem ([email protected])
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import soot.Local;
import soot.SootField;
import soot.Value;
import soot.dava.DavaFlowAnalysisException;
import soot.dava.internal.AST.ASTUnaryBinaryCondition;
import soot.jimple.DefinitionStmt;
import soot.jimple.FieldRef;
import soot.jimple.Stmt;
//import soot.dava.internal.javaRep.*;
/*
* The analysis stores all defs of Locals/SootField. The user can then ask whether a local or SootField
isMustInitialized or isMayInitialized
*
MustInitialize/MayInitialize
Step 1:
Set of initialized locals/SootField
Step 2:
A local or SootField is MUST initialized at a program point p if on all paths from the start to this
point the local or SootField is assigned a value.
Similarly a local or SootField is MAY initialized at a program point p if there is a path from the start
to this point on wich the local or SootField is assigned
Step 3:
Forward Analysis
Step 4:
Intersection/Union
Step 5:
x = expr
kill = {}
if x is a local or SootField, gen(x) = {x}
Step 6:
out(start) = {}
newInitialFlow: No copies are available. an empty flow set
remember new InitialFlow is ONLY used for input to catchBodies
*
*
*/
public class MustMayInitialize extends StructuredAnalysis {
HashMap