From 1c6c4bc36131047917427710ac386bd986088d55 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Fri, 6 Mar 2009 19:12:48 +0100 Subject: [PATCH] Two small bugfixes: - See through typedefs and enums in passByVal - Don't depend on TypeFunction::parameters->dim being the actual number of parameters; it contains unexpanded tuples as single elements. --- gen/abi-x86-64.cpp | 1 + gen/functions.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gen/abi-x86-64.cpp b/gen/abi-x86-64.cpp index 8a94af1f..898f266c 100644 --- a/gen/abi-x86-64.cpp +++ b/gen/abi-x86-64.cpp @@ -563,6 +563,7 @@ bool X86_64TargetABI::returnInArg(TypeFunction* tf) { } bool X86_64TargetABI::passByVal(Type* t) { + t = t->toBasetype(); if (linkage() == LINKd) { if (t->ty != Tstruct) return false; diff --git a/gen/functions.cpp b/gen/functions.cpp index 2041e9ac..19023ae0 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -185,7 +185,7 @@ const llvm::FunctionType* DtoFunctionType(Type* type, Type* thistype, Type* nest } // reverse params? - if (f->fty->reverseParams && f->parameters->dim > 1) + if (f->fty->reverseParams && nargs2 > 1) { std::reverse(argtypes.begin() + beg, argtypes.end()); }