diff gen/abi-x86-64.cpp @ 1360:015e00affbb9

Automated merge with http://hg.dsource.org/projects/ldc
author Frits van Bommel <fvbommel wxs.nl>
date Sat, 16 May 2009 13:10:35 +0200
parents 34f2fd925de3
children d1fd46bbbff7
line wrap: on
line diff
--- a/gen/abi-x86-64.cpp	Sat May 16 12:17:33 2009 +0200
+++ b/gen/abi-x86-64.cpp	Sat May 16 13:10:35 2009 +0200
@@ -43,7 +43,7 @@
 #include "gen/llvmhelpers.h"
 #include "gen/abi.h"
 #include "gen/abi-x86-64.h"
-#include "gen/structs.h"
+#include "gen/abi-generic.h"
 #include "ir/irfunction.h"
 
 #include <cassert>
@@ -485,38 +485,6 @@
 };
 
 
-/// Removes padding fields for (non-union-containing!) structs
-struct RemoveStructPadding : ABIRewrite {
-    /// get a rewritten value back to its original form
-    virtual LLValue* get(Type* dty, DValue* v) {
-        LLValue* lval = DtoAlloca(dty, ".rewritetmp");
-        
-        // Make sure the padding is zero, so struct comparisons work.
-        // TODO: Only do this if there's padding, and/or only initialize padding.
-        DtoMemSetZero(lval, DtoConstSize_t(getTypePaddedSize(DtoType(dty))));
-        
-        DtoPaddedStruct(dty, v->getRVal(), lval);
-        return lval;
-    }
-
-    /// 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) {
-        DtoPaddedStruct(dty, v->getRVal(), lval);
-    }
-
-    /// put out rewritten value
-    virtual LLValue* put(Type* dty, DValue* v) {
-        return DtoUnpaddedStruct(dty, v->getRVal());
-    }
-
-    /// return the transformed type for this rewrite
-    virtual const LLType* type(Type* dty, const LLType* t) {
-        return DtoUnpaddedStructType(dty);
-    }
-};
-
-
 struct RegCount {
     unsigned char int_regs, sse_regs;
 };