mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Removed warnings on ignored aligns. Only do aligment on packed structs, align(1) struct Packed { ... }
Changed the way struct/class fields are added, first small part of cleaning up these... Make struct/class/union fields aware of any anonymous struct/union they might be part of, not yet really useful, but part of getting better union support.
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
#include "gen/llvm.h"
|
||||
|
||||
#include "mtype.h"
|
||||
#include "aggregate.h"
|
||||
#include "declaration.h"
|
||||
|
||||
#include "ir/irstruct.h"
|
||||
#include "gen/irstate.h"
|
||||
#include "gen/tollvm.h"
|
||||
|
||||
IrInterface::IrInterface(BaseClass* b)
|
||||
{
|
||||
@@ -56,3 +60,15 @@ IrStruct::IrStruct(Type* t)
|
||||
IrStruct::~IrStruct()
|
||||
{
|
||||
}
|
||||
|
||||
void IrStruct::addField(VarDeclaration* v)
|
||||
{
|
||||
// might already have its irField, as classes derive each other without getting copies of the VarDeclaration
|
||||
if (!v->ir.irField)
|
||||
{
|
||||
assert(!v->ir.isSet());
|
||||
v->ir.irField = new IrField(v);
|
||||
}
|
||||
const LLType* _type = DtoType(v->type);
|
||||
offsets.insert(std::make_pair(v->offset, IrStruct::Offset(v, _type)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user