-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeadassign.h
More file actions
56 lines (47 loc) · 1.64 KB
/
deadassign.h
File metadata and controls
56 lines (47 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#pragma once
/*
*************************************************************************************
DEADASSIGN.H : DECLARATION OF FUNCTIONS ADDED IN DEADASSIGN.C HERE
**************************************************************************************
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "Expression.h"
/*
*****************************I*******************************************************
THIS FLAG VARIBALE WILL BE USEFUL TO ITERATE UNTILL THERE ARE NO UPDATES
i.e. ALL DEAD CODE IS REMOVED.
**************************************************************************************
*/
extern int change;
/*
*************************************************************************************
THIS STRUCTURE CAN BE USED TO STORE THE REFERENCED VARIABLES
**************************************************************************************
*/
typedef struct _refVar {
char* name;
struct _refVar* next;
} refVar;
extern refVar *last, *head;
/*
***********************************************************************
FUNCTION DECLARATIONS
************************************************************************
*/
void init();
void FreeList();
void TrackRef(Node* funcnode);
bool VarExists(char* name);
void UpdateRefVarList(char* name);
void PrintRefVarList();
void UpdateRef(Node* node);
void TrackExpr(Node* node);
NodeList* RemoveDead(NodeList* statements);
bool DeadAssign(NodeList* funcdecls);
/*
***********************************************************************
ADD DECLARATIONS OF ANY FUNCTIONS YOU ADD BELOW THIS LINE
************************************************************************
*/