# HG changeset patch # User lindquist # Date 1215998623 -7200 # Node ID f273f5c58a9a83d202a1ecda9d9992085a5abfae # Parent b85cf5faccfc30342bf429c9dc36223a91d0345c [svn r372] Fixed extern(C++) handling now same as DMD, which is to treat it like extern(C). Fixed a problem in resolving struct types where the size of elements might not yet be known. Switched to using DMD size() instead of LLVM ABI size (TargetData). diff -r b85cf5faccfc -r f273f5c58a9a gen/structs.cpp --- a/gen/structs.cpp Mon Jul 14 01:03:53 2008 +0200 +++ b/gen/structs.cpp Mon Jul 14 03:23:43 2008 +0200 @@ -188,12 +188,12 @@ assert(lastoffset == 0); fieldtype = i->second.type; fieldinit = i->second.var; - prevsize = getABITypeSize(fieldtype); + prevsize = fieldinit->type->size(); i->second.var->ir.irField->index = idx; } // colliding offset? else if (lastoffset == i->first) { - size_t s = getABITypeSize(i->second.type); + size_t s = i->second.var->type->size(); if (s > prevsize) { fieldpad += s - prevsize; prevsize = s; @@ -203,7 +203,7 @@ } // intersecting offset? else if (i->first < (lastoffset + prevsize)) { - size_t s = getABITypeSize(i->second.type); + size_t s = i->second.var->type->size(); assert((i->first + s) <= (lastoffset + prevsize)); // this holds because all types are aligned to their size sd->ir.irStruct->hasUnions = true; i->second.var->ir.irField->index = idx; @@ -226,7 +226,7 @@ lastoffset = i->first; fieldtype = i->second.type; fieldinit = i->second.var; - prevsize = getABITypeSize(fieldtype); + prevsize = fieldinit->type->size(); i->second.var->ir.irField->index = idx; fieldpad = 0; } diff -r b85cf5faccfc -r f273f5c58a9a gen/tollvm.cpp --- a/gen/tollvm.cpp Mon Jul 14 01:03:53 2008 +0200 +++ b/gen/tollvm.cpp Mon Jul 14 03:23:43 2008 +0200 @@ -281,7 +281,7 @@ unsigned DtoCallingConv(LINK l) { - if (l == LINKc) + if (l == LINKc || l == LINKcpp) return llvm::CallingConv::C; else if (l == LINKd || l == LINKdefault) return llvm::CallingConv::Fast;