C-Breeze
C Compiler Infrastructure

[ Project home page]

pointeroptions.h

Go to the documentation of this file.
00001 // $Id: pointeroptions.h,v 1.13 2003/09/29 13:01:33 toktb Exp $
00002 // ----------------------------------------------------------------------
00003 //
00004 //  C-Breeze
00005 //  C Compiler Framework
00006 // 
00007 //  Copyright (c) 2000 University of Texas at Austin
00008 // 
00009 //  Samuel Z. Guyer
00010 //  Daniel A. Jimenez
00011 //  Calvin Lin
00012 // 
00013 //  Permission is hereby granted, free of charge, to any person
00014 //  obtaining a copy of this software and associated documentation
00015 //  files (the "Software"), to deal in the Software without
00016 //  restriction, including without limitation the rights to use, copy,
00017 //  modify, merge, publish, distribute, sublicense, and/or sell copies
00018 //  of the Software, and to permit persons to whom the Software is
00019 //  furnished to do so, subject to the following conditions:
00020 //  
00021 //  The above copyright notice and this permission notice shall be
00022 //  included in all copies or substantial portions of the Software.
00023 //  
00024 //  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025 //  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026 //  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027 //  NONINFRINGEMENT.  IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT
00028 //  AUSTIN BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
00029 //  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
00030 //  OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00031 //  THE SOFTWARE.
00032 //
00033 //  We acknowledge the C-to-C Translator from MIT Laboratory for
00034 //  Computer Science for inspiring parts of the C-Breeze design.
00035 //
00036 // ----------------------------------------------------------------------
00037 
00038 #ifndef CBZ_POINTEROPTIONS_H
00039 #define CBZ_POINTEROPTIONS_H
00040 
00041 #include <set>
00042 
00043 typedef set< basicblockNode * > basicblock_set;
00044 typedef basicblock_set::iterator basicblock_set_p;
00045 
00046 typedef set< string > str_set;
00047 typedef str_set::iterator str_set_p;
00048 
00049 typedef set< declNode * > decl_set;
00050 typedef decl_set::iterator decl_set_p;
00051 
00052 typedef set< stmtNode * > stmt_set;
00053 typedef stmt_set::iterator stmt_set_p;
00054 
00055 // -- A walker to find callNodes
00056 
00057 /* TB: remove.
00058 class findCallNodeWalker : public Walker
00059 {
00060 public:
00061 
00062   static callNode * find(stmtNode * s)
00063   {
00064     findCallNodeWalker fcnw;
00065     s->walk(fcnw);
00066     return fcnw.call;
00067   }
00068 
00069 private:
00070 
00071   callNode * call;
00072 
00073 public:
00074 
00075   findCallNodeWalker()
00076     : Walker(Preorder, Subtree),
00077       call(0)
00078   {}
00079 
00080   void at_call(callNode * the_call, Order ord)
00081   {
00082     call = the_call;
00083   }
00084 }; */
00085 
00086 // -- Manage flow sensitivity
00087 
00088 class memoryBlock;
00089 
00090 class FSKey
00091 {
00092 public:
00093 
00094   stmtNode * statement;
00095   declNode * decl;
00096   string field_name;
00097 
00098   FSKey(stmtNode * s, declNode * d, string & f)
00099     : statement(s),
00100       decl(d),
00101       field_name(f)
00102   {}
00103 
00104   bool operator==(const FSKey & other) {
00105     if ((statement == other.statement) &&
00106         (decl == other.decl) &&
00107         (field_name == other.field_name))
00108       return true;
00109     else
00110       return false;
00111   }
00112 };
00113 
00114 // typedef pair< stmtNode *, declNode * > flow_sensitive_pair;
00115 typedef list< FSKey > flow_sensitive_set;
00116 typedef flow_sensitive_set::iterator flow_sensitive_set_p;
00117 
00118 class UnifyType;
00119 typedef set<UnifyType*> UnifyTypes;
00120 
00121 class procedureInfo;
00122 
00123 typedef enum { Forward, Backward } Direction;
00124 
00131 class pointerOptions
00132 {
00133 public:
00134 
00137   static bool Context_insensitive;
00138 
00141   static bool Recursion_Context_sensitive; // TB
00142 
00145   static bool Use_multiplicity;
00146 
00153   static bool Verbose;
00154 
00161   static bool Show_memoryblocks;
00162 
00168   static bool Show_procedures;
00169   
00172   static bool Pointer_statistics;
00173 
00179   static bool Ignore_fields;
00180 
00187   static bool One_struct_per_type;
00188 
00191   static bool Show_stack;
00192 
00201   static bool Flow_insensitive;
00202 
00203   // TB_unify
00208   static bool Unification;
00209 
00210   // TB_unify
00213   static bool Unification_use_annotation;
00214 
00215   // TB_unify
00218   static bool Show_Unification;
00219 
00225   static bool Conditional_analysis;
00226 
00235   static bool Bidirectional_assignment;
00236 
00254   static bool Aggressive_multiplicity;
00255 
00262   static bool One_string_constant;
00263 
00270   static bool Context_insensitive_memory;
00271 
00277   static bool Use_escape_analysis;
00278 
00283   static bool Verbose_unification;
00284 
00289   static bool Verbose_constants;
00290 
00295   static bool Verbose_liveness;
00296 
00300   static bool Show_unknown_procedures;
00301 
00307   static bool Show_memory_leaks;
00308 
00314   static bool Monitor_precision;
00315 
00321   static str_set Context_sensitive_procedures;
00322 
00328   static flow_sensitive_set Flow_sensitive_objects;
00329 
00335   static flow_sensitive_set Flow_sensitive_allocation_objects;
00336 
00337   // TB_unify
00343   static UnifyTypes Non_unify_types;
00344 
00346   static int Unify_objects;
00347 
00354   static basicblock_set Path_sensitive_branches;
00355 
00360   static str_set Verbose_procedures;
00361 
00366   static int_list Verbose_call_id;
00367 
00371   static bool Slice_analysis;
00372 
00377   static set<procNode*> Skip_procs;
00378 
00382   static set<procedureInfo*> No_Skip_procs;
00383 
00386   static bool Path_sensitive; // TB
00387 };
00388 
00389 
00390 #endif // CBZ_POINTEROPTIONS_H
00391 

Generated on February 1, 2006
Back to the C-Breeze home page