aboutsummaryrefslogtreecommitdiff
path: root/flow.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-11-27 12:11:41 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:06 -0700
commit8ce4e40bb9079182fed94c2ec434af3a6bf6d04f (patch)
treedc484e2fe3a77e4d12bc3498f5124d0ee1b6f24e /flow.c
parentExport the load instruction conversion functions. (diff)
downloadsparse-8ce4e40bb9079182fed94c2ec434af3a6bf6d04f.tar.gz
sparse-8ce4e40bb9079182fed94c2ec434af3a6bf6d04f.tar.bz2
sparse-8ce4e40bb9079182fed94c2ec434af3a6bf6d04f.zip
Expose "dominates()" function for memop domination checking.
And rename the argument.
Diffstat (limited to 'flow.c')
-rw-r--r--flow.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/flow.c b/flow.c
index 4255546..966a8f0 100644
--- a/flow.c
+++ b/flow.c
@@ -184,28 +184,27 @@ static inline int same_memop(struct instruction *a, struct instruction *b)
*
* Return 0 if it doesn't, and -1 if you don't know.
*/
-static int dominates(pseudo_t pseudo, struct instruction *insn,
- struct instruction *one, int local)
+int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom, int local)
{
- int opcode = one->opcode;
+ int opcode = dom->opcode;
if (opcode == OP_CALL)
return local ? 0 : -1;
if (opcode != OP_LOAD && opcode != OP_STORE)
return 0;
- if (one->src != pseudo) {
+ if (dom->src != pseudo) {
if (local)
return 0;
/* We don't think two explicitly different symbols ever alias */
- if (one->src->type == PSEUDO_SYM)
+ if (dom->src->type == PSEUDO_SYM)
return 0;
/* We could try to do some alias analysis here */
return -1;
}
- if (!same_memop(insn, one)) {
- if (one->opcode == OP_LOAD)
+ if (!same_memop(insn, dom)) {
+ if (dom->opcode == OP_LOAD)
return 0;
- if (!overlapping_memop(insn, one))
+ if (!overlapping_memop(insn, dom))
return 0;
return -1;
}