soot.toolkits.exceptions.ThrowAnalysis Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robovm-soot Show documentation
Show all versions of robovm-soot Show documentation
RoboVM fork of Soot - A Java optimization framework
/* Soot - a J*va Optimization Framework
* Copyright (C) 2003 John Jorgensen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
package soot.toolkits.exceptions;
import soot.Unit;
import soot.jimple.ThrowStmt;
/**
* A source of information about the exceptions that
* {@link Unit}s might throw.
*
* The Unit
s corresponding to athrow
* instructions may throw exceptions either explicitly—because
* the exception is the athrow
's argument— or
* implicitly—because some error arises in the course of
* executing the instruction (only implicit exceptions are possible
* for bytecode instructions other than athrow
). The
* mightThrowExplicitly()
and
* mightThrowImplicitly()
methods allow analyses to
* exploit any extra precision that may be gained by distinguishing
* between an athrow
's implicit and explicit exceptions.
*/
public interface ThrowAnalysis {
/**
* Returns a set representing the {@link Throwable} types that
* the specified unit might throw.
*
* @param u {@link Unit} whose exceptions are to be returned.
*
* @return a representation of the Throwable
types that
* u
might throw.
*/
ThrowableSet mightThrow(Unit u);
/**
* Returns a set representing the {@link Throwable} types that
* the specified throw statement might throw explicitly, that is,
* the possible types for its Throwable
argument.
*
* @param t {@link ThrowStmt} whose explicit exceptions are
* to be returned.
*
* @return a representation of the possible types of
* t
's Throwable
operand.
*/
ThrowableSet mightThrowExplicitly(ThrowStmt t);
/**
* Returns a set representing the {@link Throwable} types that
* the specified throw statement might throw implicitly, that is,
* the possible types of errors which might arise in the course
* of executing the throw
statement, rather than
* the type of the throw
's operand.
*
* @param t {@link ThrowStmt} whose implicit exceptions are
* to be returned.
*
* @return a representation of the types of exceptions that
* t
might throw implicitly.
*/
ThrowableSet mightThrowImplicitly(ThrowStmt t);
}