C-Breeze
C Compiler Infrastructure

[ Project home page]
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

pointeroptions.h

Go to the documentation of this file.
00001 // $Id: pointeroptions.h,v 1.12 2003/08/08 15:16:29 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 typedef enum { Forward, Backward } Direction;
00122 
00129 class pointerOptions
00130 {
00131 public:
00132 
00135   static bool Context_insensitive;
00136 
00139   static bool Recursion_Context_sensitive; // TB
00140 
00143   static bool Use_multiplicity;
00144 
00151   static bool Verbose;
00152 
00159   static bool Show_memoryblocks;
00160 
00166   static bool Show_procedures;
00167   
00170   static bool Pointer_statistics;
00171 
00177   static bool Ignore_fields;
00178 
00185   static bool One_struct_per_type;
00186 
00189   static bool Show_stack;
00190 
00199   static bool Flow_insensitive;
00200 
00201   // TB_unify
00206   static bool Unification;
00207 
00208   // TB_unify
00211   static bool Unification_use_annotation;
00212 
00213   // TB_unify
00216   static bool Show_Unification;
00217 
00223   static bool Conditional_analysis;
00224 
00233   static bool Bidirectional_assignment;
00234 
00252   static bool Aggressive_multiplicity;
00253 
00260   static bool One_string_constant;
00261 
00268   static bool Context_insensitive_memory;
00269 
00275   static bool Use_escape_analysis;
00276 
00281   static bool Verbose_unification;
00282 
00287   static bool Verbose_constants;
00288 
00293   static bool Verbose_liveness;
00294 
00298   static bool Show_unknown_procedures;
00299 
00305   static bool Show_memory_leaks;
00306 
00312   static bool Monitor_precision;
00313 
00319   static str_set Context_sensitive_procedures;
00320 
00326   static flow_sensitive_set Flow_sensitive_objects;
00327 
00333   static flow_sensitive_set Flow_sensitive_allocation_objects;
00334 
00335   // TB_unify
00341   static UnifyTypes Non_unify_types;
00342 
00344   static int Unify_objects;
00345 
00352   static basicblock_set Path_sensitive_branches;
00353 
00358   static str_set Verbose_procedures;
00359 };
00360 
00361 
00362 #endif // CBZ_POINTEROPTIONS_H
00363 

Generated on August 27, 2003
Back to the C-Breeze home page