KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > soot > options > CGOptions


1
2 /* Soot - a J*va Optimization Framework
3  * Copyright (C) 2003 Ondrej Lhotak
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */

20
21 /* THIS FILE IS AUTO-GENERATED FROM soot_options.xml. DO NOT MODIFY. */
22
23 package soot.options;
24 import java.util.*;
25
26 /** Option parser for Call Graph Constructor. */
27 public class CGOptions
28 {
29     private Map options;
30
31     public CGOptions( Map options ) {
32         this.options = options;
33     }
34     
35     /** Enabled --
36     
37      * .
38     
39      *
40      */

41     public boolean enabled() {
42         return soot.PhaseOptions.getBoolean( options, "enabled" );
43     }
44     
45     /** Safe forName --
46     
47      * Handle Class.forName() calls conservatively.
48     
49      * When a program calls Class.forName(), the named class is
50      * resolved, and its static initializer executed. In many cases, it
51      * cannot be determined statically which class will be loaded, and
52      * which static initializer executed. When this option is set to
53      * true, Soot will conservatively assume that any static
54      * initializer could be executed. This may make the call graph very
55      * large. When this option is set to false, any calls to
56      * Class.forName() for which the class cannot be determined
57      * statically are assumed to call no static initializers.
58      */

59     public boolean safe_forname() {
60         return soot.PhaseOptions.getBoolean( options, "safe-forname" );
61     }
62     
63     /** Safe newInstance --
64     
65      * Handle Class.newInstance() calls conservatively.
66     
67      * When a program calls Class.newInstance(), a new object is
68      * created and its constructor executed. Soot does not determine
69      * statically which type of object will be created, and which
70      * constructor executed. When this option is set to true, Soot will
71      * conservatively assume that any constructor could be executed.
72      * This may make the call graph very large. When this option is set
73      * to false, any calls to Class.newInstance() are assumed not to
74      * call the constructor of the created object.
75      */

76     public boolean safe_newinstance() {
77         return soot.PhaseOptions.getBoolean( options, "safe-newinstance" );
78     }
79     
80     /** Verbose --
81     
82      * Print warnings about where the call graph may be incomplete.
83     
84      * Due to the effects of native methods and reflection, it may not
85      * always be possible to construct a fully conservative call graph.
86      * Setting this option to true causes Soot to point out the parts
87      * of the call graph that may be incomplete, so that they can be
88      * checked by hand.
89      */

90     public boolean verbose() {
91         return soot.PhaseOptions.getBoolean( options, "verbose" );
92     }
93     
94     /** All Application Class Methods Reachable --
95     
96      * Assume all methods of application classes are reachable..
97     
98      * When this option is false, the call graph is built starting at a
99      * set of entry points, and only methods reachable from those entry
100      * points are processed. Unreachable methods will not have any call
101      * graph edges generated out of them. Setting this option to true
102      * makes Soot consider all methods of application classes to be
103      * reachable, so call edges are generated for all of them. This
104      * leads to a larger call graph. For program visualization
105      * purposes, it is sometimes desirable to include edges from
106      * unreachable methods; although these methods are unreachable in
107      * the version being analyzed, they may become reachable if the
108      * program is modified.
109      */

110     public boolean all_reachable() {
111         return soot.PhaseOptions.getBoolean( options, "all-reachable" );
112     }
113     
114     /** Implicit Entry Points --
115     
116      * Include methods called implicitly by the VM as entry points.
117     
118      * When this option is true, methods that are called implicitly by
119      * the VM are considered entry points of the call graph. When it is
120      * false, these methods are not considered entry points, leading to
121      * a possibly incomplete call graph.
122      */

123     public boolean implicit_entry() {
124         return soot.PhaseOptions.getBoolean( options, "implicit-entry" );
125     }
126     
127     /** Trim Static Initializer Edges --
128     
129      * Removes redundant static initializer calls.
130     
131      * The call graph contains an edge from each statement that could
132      * trigger execution of a static initializer to that static
133      * initializer. However, each static initializer is triggered only
134      * once. When this option is enabled, after the call graph is
135      * built, an intra-procedural analysis is performed to detect
136      * static initializer edges leading to methods that must have
137      * already been executed. Since these static initializers cannot be
138      * executed again, the corresponding call graph edges are removed
139      * from the call graph.
140      */

141     public boolean trim_clinit() {
142         return soot.PhaseOptions.getBoolean( options, "trim-clinit" );
143     }
144     
145     /** JDK version --
146     
147      * JDK version for native methods.
148     
149      * This option sets the JDK version of the standard library being
150      * analyzed so that Soot can simulate the native methods in the
151      * specific version of the library. The default, 3, refers to Java
152      * 1.3.x.
153      */

154     public int jdkver() {
155         return soot.PhaseOptions.getInt( options, "jdkver" );
156     }
157     
158 }
159         
Popular Tags