mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-14 11:53:13 +01:00
[svn r115] Implemented the ClassInfo.defaultConstructor member.
This commit is contained in:
@@ -632,13 +632,19 @@ L2:
|
||||
inits.push_back(c);
|
||||
|
||||
// offset typeinfo
|
||||
// TODO
|
||||
c = build_offti_array(cd, cinfo->llvmInitZ->getOperand(10));
|
||||
inits.push_back(c);
|
||||
|
||||
// default constructor
|
||||
// TODO
|
||||
c = cinfo->llvmInitZ->getOperand(11);
|
||||
if (cd->defaultCtor) {
|
||||
DtoForceDeclareDsymbol(cd->defaultCtor);
|
||||
c = isaConstant(cd->defaultCtor->llvmValue);
|
||||
//const llvm::Type* toTy = cinfo->llvmInitZ->getOperand(11)->getType();
|
||||
c = llvm::ConstantExpr::getBitCast(c, llvm::PointerType::get(llvm::Type::Int8Ty)); // toTy);
|
||||
}
|
||||
else {
|
||||
c = cinfo->llvmInitZ->getOperand(11);
|
||||
}
|
||||
inits.push_back(c);
|
||||
|
||||
/*size_t n = inits.size();
|
||||
|
||||
@@ -337,6 +337,7 @@ test/classes8.d
|
||||
test/classinfo1.d
|
||||
test/classinfo2.d
|
||||
test/classinfo3.d
|
||||
test/classinfo4.d
|
||||
test/comma.d
|
||||
test/complex1.d
|
||||
test/complex2.d
|
||||
|
||||
18
test/classinfo4.d
Normal file
18
test/classinfo4.d
Normal file
@@ -0,0 +1,18 @@
|
||||
module classinfo4;
|
||||
|
||||
class C
|
||||
{
|
||||
}
|
||||
|
||||
class D
|
||||
{
|
||||
this()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
assert(C.classinfo.defaultConstructor is null);
|
||||
assert(D.classinfo.defaultConstructor !is null);
|
||||
}
|
||||
Reference in New Issue
Block a user