Mercurial > projects > ldc
comparison gen/arrays.cpp @ 193:aca17e55b7a5 trunk
[svn r209] Fixed: exotic array to pointer casts were broken.
Changed: classes now have opaque vtables.
author | lindquist |
---|---|
date | Mon, 12 May 2008 18:44:11 +0200 |
parents | 6526cf5bb2be |
children | e881c9b1c738 |
comparison
equal
deleted
inserted
replaced
192:67ed21bf16af | 193:aca17e55b7a5 |
---|---|
932 bool isslice = false; | 932 bool isslice = false; |
933 | 933 |
934 Logger::cout() << "from array or sarray" << '\n'; | 934 Logger::cout() << "from array or sarray" << '\n'; |
935 if (totype->ty == Tpointer) { | 935 if (totype->ty == Tpointer) { |
936 Logger::cout() << "to pointer" << '\n'; | 936 Logger::cout() << "to pointer" << '\n'; |
937 assert(fromtype->next == totype->next || totype->next->ty == Tvoid); | |
938 rval = DtoArrayPtr(u); | 937 rval = DtoArrayPtr(u); |
939 if (fromtype->next != totype->next) | 938 if (rval->getType() != tolltype) |
940 rval = gIR->ir->CreateBitCast(rval, getPtrToType(llvm::Type::Int8Ty), "tmp"); | 939 rval = gIR->ir->CreateBitCast(rval, tolltype, "tmp"); |
941 } | 940 } |
942 else if (totype->ty == Tarray) { | 941 else if (totype->ty == Tarray) { |
943 Logger::cout() << "to array" << '\n'; | 942 Logger::cout() << "to array" << '\n'; |
944 const llvm::Type* ptrty = DtoType(totype->next); | 943 const llvm::Type* ptrty = DtoType(totype->next); |
945 if (ptrty == llvm::Type::VoidTy) | 944 if (ptrty == llvm::Type::VoidTy) |