Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 373:d1574e142e93 trunk
[svn r394] Fixed the new DtoNullValue function
author | lindquist |
---|---|
date | Tue, 15 Jul 2008 15:16:56 +0200 |
parents | 83ade4f4025a |
children | 0e6b4d65d3f8 |
comparison
equal
deleted
inserted
replaced
372:83ade4f4025a | 373:d1574e142e93 |
---|---|
651 return new DConstValue(type, LLConstant::getNullValue(lltype)); | 651 return new DConstValue(type, LLConstant::getNullValue(lltype)); |
652 } | 652 } |
653 // dynamic array | 653 // dynamic array |
654 else if (basety == Tarray) | 654 else if (basety == Tarray) |
655 { | 655 { |
656 //TODO: What types do the constants here need to have? | 656 LLValue* len = DtoConstSize_t(0); |
657 return new DSliceValue(type, NULL, NULL); | 657 LLValue* ptr = getNullPtr(getPtrToType(DtoType(basetype->next))); |
658 return new DSliceValue(type, len, ptr); | |
658 } | 659 } |
659 // delegate | 660 // delegate |
660 else if (basety == Tdelegate) | 661 else if (basety == Tdelegate) |
661 { | 662 { |
662 //TODO: Is this correct? | |
663 return new DNullValue(type, LLConstant::getNullValue(lltype)); | 663 return new DNullValue(type, LLConstant::getNullValue(lltype)); |
664 } | 664 } |
665 | 665 |
666 // unknown | 666 // unknown |
667 std::cout << "unsupported: null value for " << type->toChars() << '\n'; | 667 std::cout << "unsupported: null value for " << type->toChars() << '\n'; |