diff 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
line wrap: on
line diff
--- a/gen/abi.h	Wed Mar 04 16:13:16 2009 +0100
+++ b/gen/abi.h	Wed Mar 04 17:24:25 2009 +0100
@@ -5,6 +5,8 @@
 
 struct Type;
 struct IrFuncTyArg;
+struct DValue;
+
 namespace llvm
 {
     class Type;
@@ -14,13 +16,17 @@
 // return rewrite rule
 struct ABIRewrite
 {
-    // get original value from rewritten one
-    virtual LLValue* get(Type* dty, LLValue* v) = 0;
+    /// get a rewritten value back to its original form
+    virtual LLValue* get(Type* dty, DValue* v) = 0;
 
-    // rewrite original value
-    virtual LLValue* put(Type* dty, LLValue* v) = 0;
+    /// get a rewritten value back to its original form and store result in provided lvalue
+    /// this one is optional and defaults to calling the one above
+    virtual void getL(Type* dty, DValue* v, llvm::Value* lval);
 
-    // returns target type of this rewrite
+    /// put out rewritten value
+    virtual LLValue* put(Type* dty, DValue* v) = 0;
+
+    /// should return the transformed type for this rewrite
     virtual const LLType* type(Type* dty, const LLType* t) = 0;
 };