aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-19 16:32:57 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:06:11 -0700
commit03aa6219fd8c79d4872ee88a72d8c16237269782 (patch)
tree2d7eaa9d490d21445f7ed1ed29a2baa504c53732 /example.c
parentMake "fill_reg" do somewhat the right thing when we take the (diff)
downloadsparse-03aa6219fd8c79d4872ee88a72d8c16237269782.tar.gz
sparse-03aa6219fd8c79d4872ee88a72d8c16237269782.tar.bz2
sparse-03aa6219fd8c79d4872ee88a72d8c16237269782.zip
Make output_insn() tell where it was called from, and avoid
doing unnecessary register->sameregister moves.
Diffstat (limited to 'example.c')
-rw-r--r--example.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/example.c b/example.c
index 9b943b7..d4f4c32 100644
--- a/example.c
+++ b/example.c
@@ -262,6 +262,9 @@ static void output_insn(struct bb_state *state, const char *fmt, ...)
output_line(state, "\t%s\n", buffer);
}
+#define output_insn(state, fmt, arg...) \
+ output_insn(state, fmt "\t\t# %s" , ## arg , __FUNCTION__)
+
static void output_comment(struct bb_state *state, const char *fmt, ...)
{
static char buffer[512];
@@ -647,6 +650,10 @@ static struct hardreg *copy_reg(struct bb_state *state, struct hardreg *src, pse
int i;
struct hardreg *reg;
+ /* If the container has been killed off, just re-use it */
+ if (!src->contains)
+ return src;
+
/* If "src" only has one user, and the contents are dead, we can re-use it */
if (src->busy == 1 && src->dead == 1)
return src;