comparison gen/toir.cpp @ 90:16e88334bba7 trunk

[svn r94] started on complex support calling final class methods was being treated as a virtual call failing an assertion.
author lindquist
date Wed, 07 Nov 2007 03:36:07 +0100
parents 058d3925950e
children 3f949c6e2e9d
comparison
equal deleted inserted replaced
89:ccca1c13e13a 90:16e88334bba7
312 else { 312 else {
313 return llvm::Constant::getNullValue(t); 313 return llvm::Constant::getNullValue(t);
314 } 314 }
315 assert(0); 315 assert(0);
316 return NULL; 316 return NULL;
317 }
318
319 //////////////////////////////////////////////////////////////////////////////////////////
320
321 DValue* ComplexExp::toElem(IRState* p)
322 {
323 Logger::print("ComplexExp::toElem(): %s | %s\n", toChars(), type->toChars());
324 LOG_SCOPE;
325 assert(0);
326 }
327
328 //////////////////////////////////////////////////////////////////////////////////////////
329
330 llvm::Constant* ComplexExp::toConstElem(IRState* p)
331 {
332 Logger::print("ComplexExp::toConstElem(): %s | %s\n", toChars(), type->toChars());
333 LOG_SCOPE;
334 assert(0);
317 } 335 }
318 336
319 ////////////////////////////////////////////////////////////////////////////////////////// 337 //////////////////////////////////////////////////////////////////////////////////////////
320 338
321 DValue* StringExp::toElem(IRState* p) 339 DValue* StringExp::toElem(IRState* p)
1629 llvm::Value* funcval = fdecl->llvmValue; 1647 llvm::Value* funcval = fdecl->llvmValue;
1630 llvm::Value* vthis = l->getRVal(); 1648 llvm::Value* vthis = l->getRVal();
1631 unsigned cc = (unsigned)-1; 1649 unsigned cc = (unsigned)-1;
1632 1650
1633 // virtual call 1651 // virtual call
1634 if (fdecl->isVirtual()) { 1652 if (!fdecl->isFinal() && fdecl->isVirtual()) {
1635 assert(fdecl->vtblIndex > 0); 1653 assert(fdecl->vtblIndex > 0);
1636 assert(e1type->ty == Tclass); 1654 assert(e1type->ty == Tclass);
1637 1655
1638 llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0, false); 1656 llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::Int32Ty, 0, false);
1639 llvm::Value* vtblidx = llvm::ConstantInt::get(llvm::Type::Int32Ty, (size_t)fdecl->vtblIndex, false); 1657 llvm::Value* vtblidx = llvm::ConstantInt::get(llvm::Type::Int32Ty, (size_t)fdecl->vtblIndex, false);
2856 STUB(ScopeExp); 2874 STUB(ScopeExp);
2857 //STUB(AssignExp); 2875 //STUB(AssignExp);
2858 2876
2859 STUB(TypeExp); 2877 STUB(TypeExp);
2860 //STUB(RealExp); 2878 //STUB(RealExp);
2861 STUB(ComplexExp); 2879 //STUB(ComplexExp);
2862 //STUB(StringExp); 2880 //STUB(StringExp);
2863 //STUB(IntegerExp); 2881 //STUB(IntegerExp);
2864 STUB(BoolExp); 2882 STUB(BoolExp);
2865 2883
2866 //STUB(NotExp); 2884 //STUB(NotExp);
2883 #define CONSTSTUB(x) llvm::Constant* x::toConstElem(IRState * p) {error("const Exp type "#x" not implemented: '%s' type: '%s'", toChars(), type->toChars()); fatal(); return NULL; } 2901 #define CONSTSTUB(x) llvm::Constant* x::toConstElem(IRState * p) {error("const Exp type "#x" not implemented: '%s' type: '%s'", toChars(), type->toChars()); fatal(); return NULL; }
2884 CONSTSTUB(Expression); 2902 CONSTSTUB(Expression);
2885 //CONSTSTUB(IntegerExp); 2903 //CONSTSTUB(IntegerExp);
2886 //CONSTSTUB(RealExp); 2904 //CONSTSTUB(RealExp);
2887 //CONSTSTUB(NullExp); 2905 //CONSTSTUB(NullExp);
2906 //CONSTSTUB(ComplexExp);
2888 //CONSTSTUB(StringExp); 2907 //CONSTSTUB(StringExp);
2889 //CONSTSTUB(VarExp); 2908 //CONSTSTUB(VarExp);
2890 //CONSTSTUB(ArrayLiteralExp); 2909 //CONSTSTUB(ArrayLiteralExp);
2891 CONSTSTUB(AssocArrayLiteralExp); 2910 CONSTSTUB(AssocArrayLiteralExp);
2892 //CONSTSTUB(StructLiteralExp); 2911 //CONSTSTUB(StructLiteralExp);