aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Given <dg@cowlark.com>2008-12-17 22:01:16 +0300
committerAlexey Zaytsev <alexey.zaytsev@gmail.com>2008-12-18 20:29:35 +0300
commit8f0331093ca506931f39a6cfbc3ae288a2e14b98 (patch)
tree7410f554074b4db550f60d06f0a8ef3000e64137
parenteb800bdc37916dc96dfbd5b424dea3e6cde2409b (diff)
downloadsparse-8f0331093ca506931f39a6cfbc3ae288a2e14b98.tar.gz
Add type information to struct instruction.
Currently there is no generic way to derive phy type information from the instruction flow. Signed-off-by: David Given <dg@cowlark.com>
-rw-r--r--linearize.c4
-rw-r--r--linearize.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/linearize.c b/linearize.c
index fce1ae8b..526a7101 100644
--- a/linearize.c
+++ b/linearize.c
@@ -55,7 +55,9 @@ static inline int type_size(struct symbol *type)
static struct instruction *alloc_typed_instruction(int opcode, struct symbol *type)
{
- return alloc_instruction(opcode, type_size(type));
+ struct instruction *insn = alloc_instruction(opcode, type_size(type));
+ insn->type = type;
+ return insn;
}
static struct entrypoint *alloc_entrypoint(void)
diff --git a/linearize.h b/linearize.h
index 32b1c1aa..0c5e4ef2 100644
--- a/linearize.h
+++ b/linearize.h
@@ -71,6 +71,7 @@ struct instruction {
size:24;
struct basic_block *bb;
struct position pos;
+ struct symbol *type;
union {
pseudo_t target;
pseudo_t cond; /* for branch and switch */