Mercurial > projects > ldc
comparison ir/irtypestruct.cpp @ 1234:9201e0d41ee5
Fixed forward referenced structs.
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 16 Apr 2009 20:41:27 +0200 |
parents | 212ec2d9d176 |
children | 465a77c904d4 |
comparison
equal
deleted
inserted
replaced
1233:1e699a4e9759 | 1234:9201e0d41ee5 |
---|---|
64 | 64 |
65 const llvm::Type* IrTypeStruct::buildType() | 65 const llvm::Type* IrTypeStruct::buildType() |
66 { | 66 { |
67 IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars()); | 67 IF_LOG Logger::println("Building struct type %s @ %s", sd->toPrettyChars(), sd->locToChars()); |
68 LOG_SCOPE; | 68 LOG_SCOPE; |
69 | |
70 // if it's a forward declaration, all bets are off, stick with the opaque | |
71 if (sd->sizeok != 1) | |
72 return pa.get(); | |
69 | 73 |
70 // find the fields that contribute to the default initializer. | 74 // find the fields that contribute to the default initializer. |
71 // these will define the default type. | 75 // these will define the default type. |
72 | 76 |
73 std::vector<const llvm::Type*> defaultTypes; | 77 std::vector<const llvm::Type*> defaultTypes; |