Merge the 2.063 frontend.

This commit is contained in:
David Nadlinger
2013-06-07 05:17:29 +02:00
parent 981a6af17e
commit 292caa1438
90 changed files with 10179 additions and 8105 deletions

View File

@@ -10,6 +10,7 @@
#include "declaration.h"
#include "id.h"
#include "mtype.h"
#include "target.h"
#include "gen/abi.h"
#include "gen/dvalue.h"
#include "gen/functions.h"
@@ -211,24 +212,24 @@ void DtoBuildDVarArgList(std::vector<LLValue*>& args,
assert(argexp->type->ty != Ttuple);
vtypes.push_back(DtoType(argexp->type));
size_t sz = getTypePaddedSize(vtypes.back());
size_t asz = (sz + PTRSIZE - 1) & ~(PTRSIZE -1);
size_t asz = (sz + Target::ptrsize - 1) & ~(Target::ptrsize -1);
if (sz != asz)
{
if (sz < PTRSIZE)
if (sz < Target::ptrsize)
{
vtypes.back() = DtoSize_t();
}
else
{
// ok then... so we build some type that is big enough
// and aligned to PTRSIZE
// and aligned to Target::ptrsize
std::vector<LLType*> gah;
gah.reserve(asz/PTRSIZE);
gah.reserve(asz/Target::ptrsize);
size_t gah_sz = 0;
while (gah_sz < asz)
{
gah.push_back(DtoSize_t());
gah_sz += PTRSIZE;
gah_sz += Target::ptrsize;
}
vtypes.back() = LLStructType::get(gIR->context(), gah, true);
}