Mercurial > projects > ldc
comparison gen/toir.cpp @ 459:9db9099583ca
Implement a rough AddrExp::toConstElem()
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 02 Aug 2008 22:54:36 +0200 |
parents | 30ef3c7bddca |
children | 3a5d6ff8c70f |
comparison
equal
deleted
inserted
replaced
456:b975f29b7256 | 459:9db9099583ca |
---|---|
843 Logger::println("is immediate"); | 843 Logger::println("is immediate"); |
844 return v; | 844 return v; |
845 } | 845 } |
846 Logger::println("is nothing special"); | 846 Logger::println("is nothing special"); |
847 return new DFieldValue(type, v->getLVal(), false); | 847 return new DFieldValue(type, v->getLVal(), false); |
848 } | |
849 | |
850 LLConstant* AddrExp::toConstElem(IRState* p) | |
851 { | |
852 assert(e1->op == TOKvar); | |
853 VarExp* vexp = (VarExp*)e1; | |
854 VarDeclaration* vd = vexp->var->isVarDeclaration(); | |
855 assert(vd); | |
856 LLConstant* llc = llvm::dyn_cast<LLConstant>(vd->ir.getIrValue()); | |
857 assert(llc); | |
858 return llc; | |
848 } | 859 } |
849 | 860 |
850 ////////////////////////////////////////////////////////////////////////////////////////// | 861 ////////////////////////////////////////////////////////////////////////////////////////// |
851 | 862 |
852 DValue* PtrExp::toElem(IRState* p) | 863 DValue* PtrExp::toElem(IRState* p) |