* as/z80/z80mch.c: fixed bug #1704376: missing as-z80 errors
[fw/sdcc] / src / SDCCBBlock.h
index b8ad1aab53372c8ddbfa232e4f5ca587d52f70f2..1f853df87d61af37a5e8aaa9092e3453b6b67e94 100644 (file)
 #define SDCCBBLOCK_H 1
 
 /* definition of a basic block */
-typedef struct eBasicBlock {
-    int dfnum ;             /* depth first number */
-    int bbnum ;             /* index into array of numbers */
-    int depth ;             /* loop depth of this block */
-    int fSeq  ;             /* sequence number of first iCode */
-    int lSeq  ;             /* sequence number of the last iCode */
-    unsigned int visited:1; /* visitied flag      */    
-    unsigned int hasFcall:1;/* has a function call */
-    unsigned int noPath :1; /* there is no path from _entry to this block */
-    unsigned int isLastInLoop:1; /* is the last block in a loop */
-    symbol *entryLabel ;    /* entry label */
-    
-    iCode *sch ;            /* pointer to start of code chain */
-    iCode *ech ;            /* pointer to last of code chain  */
-
-    struct eBasicBlock *preHeader ; /* preheader if this is a loop entry */
-    struct region      *partOfLoop; /* pointer to the loop region this block is part of */
+typedef struct eBBlock
+  {
+    int dfnum;                 /* depth first number */
+    int bbnum;                 /* index into array of numbers */
+    int depth;                 /* loop depth of this block */
+    int fSeq;                  /* sequence number of first iCode */
+    int lSeq;                  /* sequence number of the last iCode */
+    unsigned int visited:1;    /* visitied flag      */
+    unsigned int hasFcall:1;   /* has a function call */
+    unsigned int noPath:1;     /* there is no path from _entry to this block */
+    unsigned int isLastInLoop:1;       /* is the last block in a loop */
+    struct eBBlock *isConditionalExitFrom; /* this block ends with a return or goto from a conditional block*/
+    symbol *entryLabel;                /* entry label */
+
+    iCode *sch;                        /* pointer to start of code chain */
+    iCode *ech;                        /* pointer to last of code chain  */
+
+    struct eBBlock *preHeader; /* preheader if this is a loop entry */
+    struct region *partOfLoop; /* pointer to the loop region this block is part of */
 
     /* control flow analysis */
-    set *succList ;       /* list eBBlocks which are successors  */
-    bitVect *succVect ;   /* bitVector of successors             */
-    set *predList ;       /* predecessors of this basic block    */
-    bitVect *domVect  ;   /* list of nodes this is dominated by  */
+    set *succList;             /* list eBBlocks which are successors  */
+    bitVect *succVect;         /* bitVector of successors (index is bbnum) */
+    set *predList;             /* predecessors of this basic block    */
+    bitVect *domVect;          /* list of nodes this is dominated by (index is bbnum) */
 
     /* data flow analysis */
-    set *inExprs   ;  /* in coming common expressions    */
-    set *outExprs  ;  /* out going common expressions    */
-    bitVect *inDefs;  /* in coming defintions            */
-    bitVect *outDefs; /* out going defintions            */
-    bitVect *defSet;  /* symbols defined in block        */
-    bitVect *ldefs ;  /* local definitions only          */
-    bitVect *usesDefs;/* which definitions are used in this block */
-    bitVect *ptrsSet; /* pointers assigned values in the block */
-    bitVect *inPtrsSet;/* in coming pointers assigned values */
-    set     *addrOf ; /* symbols for which addres has been taken in the block */
-    bitVect *linds ;  /* if loop exit this contains defNumbers
-                        for the inductions */
-} eBBlock ;
-
-typedef struct edge {
-    
-    eBBlock *from  ;            /* from basic block */
-    eBBlock *to    ;            /* to Basic Block   */
-} edge ;
-
-extern int eBBNum ;
-extern set *graphEdges ;
-
-
-DEFSETFUNC(printEntryLabel) ;
-eBBlock    *neweBBlock () ;
-edge       *newEdge (eBBlock *, eBBlock *) ;
-eBBlock    *eBBWithEntryLabel ( eBBlock **, symbol *, int);
-DEFSETFUNC(ifFromIs) ;
-set        *edgesTo ( eBBlock *);
-void        remiCodeFromeBBlock (eBBlock *, iCode *);
-void        addiCodeToeBBlock ( eBBlock *,iCode *,iCode *);
-eBBlock   **iCodeBreakDown (iCode *, int *);
-void        replaceSymBySym (set *, operand *, operand *);
-iCode      *iCodeFromeBBlock ( eBBlock **,int);
-int         otherPathsPresent (eBBlock **,eBBlock *);
-void        replaceLabel(eBBlock *,symbol *,symbol *);
-void        dumpEbbsToFileExt (char *,eBBlock **,int);
+    set *inExprs;              /* in coming common expressions    */
+    set *outExprs;             /* out going common expressions    */
+    set *killedExprs;          /* killed common expressions       */
+    bitVect *inDefs;           /* in coming defintions            */
+    bitVect *outDefs;          /* out going defintions            */
+    bitVect *defSet;           /* symbols defined in block        */
+    bitVect *ldefs;            /* local definitions only          */
+    bitVect *usesDefs;         /* which definitions are used in this block */
+    bitVect *ptrsSet;          /* pointers assigned values in the block */
+    bitVect *inPtrsSet;                /* in coming pointers assigned values */
+    bitVect *ndompset;         /* pointers set by non-dominating basic blocks */
+    set *addrOf;               /* symbols for which addres has been taken in the block */
+    bitVect *linds;            /* if loop exit this contains defNumbers
+                                  for the inductions */
+  }
+eBBlock;
+
+typedef struct ebbIndex
+  {
+    int count;                 /* number of blocks in the index */
+    eBBlock **bbOrder;         /* blocks in bbnum order */
+    eBBlock **dfOrder;         /* blocks in dfnum (depth first) order */
+  }
+ebbIndex;
+
+typedef struct edge
+  {
+
+    eBBlock *from;             /* from basic block */
+    eBBlock *to;               /* to Basic Block   */
+  }
+edge;
+
+
+extern int eBBNum;
+extern set *graphEdges;
+
+
+DEFSETFUNC (printEntryLabel);
+eBBlock *neweBBlock ();
+edge *newEdge (eBBlock *, eBBlock *);
+eBBlock *eBBWithEntryLabel (ebbIndex *, symbol *);
+DEFSETFUNC (ifFromIs);
+set *edgesTo (eBBlock *);
+void remiCodeFromeBBlock (eBBlock *, iCode *);
+void addiCodeToeBBlock (eBBlock *, iCode *, iCode *);
+ebbIndex *iCodeBreakDown (iCode *);
+void replaceSymBySym (set *, operand *, operand *);
+iCode *iCodeFromeBBlock (eBBlock **, int);
+int otherPathsPresent (eBBlock **, eBBlock *);
+void replaceLabel (eBBlock *, symbol *, symbol *);
+void dumpEbbsToFileExt (int, ebbIndex *);
+void dumpLiveRanges (int, hTab * liveRanges);
+void closeDumpFiles();
+
 #endif