mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
Fix a bug in the X86 ABI. The size of a struct is different from the size of a
pointer to that struct...
This commit is contained in:
parent
1c6c4bc361
commit
5af82ee8d3
4 changed files with 46 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "gen/tollvm.h"
|
||||
#include "gen/abi.h"
|
||||
#include "gen/dvalue.h"
|
||||
#include "gen/logger.h"
|
||||
#include "ir/irfunction.h"
|
||||
|
||||
#include <sstream>
|
||||
|
@ -27,32 +28,44 @@ IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, unsigned a)
|
|||
llvm::Value* IrFuncTy::putRet(Type* dty, DValue* val)
|
||||
{
|
||||
assert(!arg_sret);
|
||||
if (ret->rewrite)
|
||||
if (ret->rewrite) {
|
||||
Logger::println("Rewrite: putRet");
|
||||
LOG_SCOPE
|
||||
return ret->rewrite->put(dty, val);
|
||||
}
|
||||
return val->getRVal();
|
||||
}
|
||||
|
||||
llvm::Value* IrFuncTy::getRet(Type* dty, DValue* val)
|
||||
{
|
||||
assert(!arg_sret);
|
||||
if (ret->rewrite)
|
||||
if (ret->rewrite) {
|
||||
Logger::println("Rewrite: getRet");
|
||||
LOG_SCOPE
|
||||
return ret->rewrite->get(dty, val);
|
||||
}
|
||||
return val->getRVal();
|
||||
}
|
||||
|
||||
llvm::Value* IrFuncTy::putParam(Type* dty, int idx, DValue* val)
|
||||
{
|
||||
assert(idx >= 0 && idx < args.size() && "invalid putParam");
|
||||
if (args[idx]->rewrite)
|
||||
if (args[idx]->rewrite) {
|
||||
Logger::println("Rewrite: putParam");
|
||||
LOG_SCOPE
|
||||
return args[idx]->rewrite->put(dty, val);
|
||||
}
|
||||
return val->getRVal();
|
||||
}
|
||||
|
||||
llvm::Value* IrFuncTy::getParam(Type* dty, int idx, DValue* val)
|
||||
{
|
||||
assert(idx >= 0 && idx < args.size() && "invalid getParam");
|
||||
if (args[idx]->rewrite)
|
||||
if (args[idx]->rewrite) {
|
||||
Logger::println("Rewrite: getParam (get)");
|
||||
LOG_SCOPE
|
||||
return args[idx]->rewrite->get(dty, val);
|
||||
}
|
||||
return val->getRVal();
|
||||
}
|
||||
|
||||
|
@ -62,6 +75,8 @@ void IrFuncTy::getParam(Type* dty, int idx, DValue* val, llvm::Value* lval)
|
|||
|
||||
if (args[idx]->rewrite)
|
||||
{
|
||||
Logger::println("Rewrite: getParam (getL)");
|
||||
LOG_SCOPE
|
||||
args[idx]->rewrite->getL(dty, val, lval);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue