mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 00:53:23 +01:00
Merge the 2.063 frontend.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user