Mercurial > projects > ldc
comparison gen/abi.h @ 1042:45af482e3832
Updated ABI handling to be more flexible with regard to reusing lvalues and allocating fewer temporaries.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 04 Mar 2009 17:24:25 +0100 |
parents | 9167d492cbc2 |
children | 6bb04dbee21f |
comparison
equal
deleted
inserted
replaced
1041:9dca7182aa75 | 1042:45af482e3832 |
---|---|
3 | 3 |
4 #include <vector> | 4 #include <vector> |
5 | 5 |
6 struct Type; | 6 struct Type; |
7 struct IrFuncTyArg; | 7 struct IrFuncTyArg; |
8 struct DValue; | |
9 | |
8 namespace llvm | 10 namespace llvm |
9 { | 11 { |
10 class Type; | 12 class Type; |
11 class Value; | 13 class Value; |
12 } | 14 } |
13 | 15 |
14 // return rewrite rule | 16 // return rewrite rule |
15 struct ABIRewrite | 17 struct ABIRewrite |
16 { | 18 { |
17 // get original value from rewritten one | 19 /// get a rewritten value back to its original form |
18 virtual LLValue* get(Type* dty, LLValue* v) = 0; | 20 virtual LLValue* get(Type* dty, DValue* v) = 0; |
19 | 21 |
20 // rewrite original value | 22 /// get a rewritten value back to its original form and store result in provided lvalue |
21 virtual LLValue* put(Type* dty, LLValue* v) = 0; | 23 /// this one is optional and defaults to calling the one above |
24 virtual void getL(Type* dty, DValue* v, llvm::Value* lval); | |
22 | 25 |
23 // returns target type of this rewrite | 26 /// put out rewritten value |
27 virtual LLValue* put(Type* dty, DValue* v) = 0; | |
28 | |
29 /// should return the transformed type for this rewrite | |
24 virtual const LLType* type(Type* dty, const LLType* t) = 0; | 30 virtual const LLType* type(Type* dty, const LLType* t) = 0; |
25 }; | 31 }; |
26 | 32 |
27 // interface called by codegen | 33 // interface called by codegen |
28 struct TargetABI | 34 struct TargetABI |