summaryrefslogtreecommitdiff
path: root/includes/compiler/CopyPropagation.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/compiler/CopyPropagation.h')
-rw-r--r--includes/compiler/CopyPropagation.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/includes/compiler/CopyPropagation.h b/includes/compiler/CopyPropagation.h
index 841f8dc..8d80067 100644
--- a/includes/compiler/CopyPropagation.h
+++ b/includes/compiler/CopyPropagation.h
@@ -2,5 +2,51 @@
#define COMPILER_COPYPROPAGATION_H
#include "compiler/common.h"
+#include "compiler/UseDefChains.h"
+
+typedef int (*IsCandidateFunc)(PCode *);
+typedef int (*PropagatesToUseFunc)(int a, int b);
+typedef void (*PropagateAndFinishFunc)(int id);
+
+#ifdef __MWERKS__
+#pragma options align=mac68k
+#endif
+typedef struct Propagation {
+ IsCandidateFunc is_candidate;
+ PropagatesToUseFunc propagatestouse;
+ PropagateAndFinishFunc propagateandfinish;
+ char *name;
+ char *nameplural;
+ char *format;
+ Boolean computesUseDefChains;
+} Propagation;
+
+typedef struct Candidate {
+ PCode *pcode;
+ RegUseOrDef *list;
+} Candidate;
+
+typedef struct PropInfo {
+ UInt32 *vec0;
+ UInt32 *vec4;
+ UInt32 *vec8;
+ UInt32 *vecC;
+} PropInfo;
+#ifdef __MWERKS__
+#pragma options align=reset
+#endif
+
+extern int propagatedcopies;
+extern int propagated_instructions;
+extern int recursive_propagation;
+extern int number_of_candidates;
+extern Candidate *Candidates;
+extern PropInfo *propinfo;
+extern int *ncandidatesinblock;
+extern int *firstcandidateinblock;
+
+extern int precedes(PCode *a, PCode *b);
+extern void propagateinstructions(Object *proc, Propagation *config, int passCount, Boolean localflag);
+extern void propagatecopyinstructions(Object *proc, int flag);
#endif