mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-22 03:39:03 +02:00
Implement a rough AddrExp::toConstElem()
This commit is contained in:
11
gen/toir.cpp
11
gen/toir.cpp
@@ -847,6 +847,17 @@ DValue* AddrExp::toElem(IRState* p)
|
||||
return new DFieldValue(type, v->getLVal(), false);
|
||||
}
|
||||
|
||||
LLConstant* AddrExp::toConstElem(IRState* p)
|
||||
{
|
||||
assert(e1->op == TOKvar);
|
||||
VarExp* vexp = (VarExp*)e1;
|
||||
VarDeclaration* vd = vexp->var->isVarDeclaration();
|
||||
assert(vd);
|
||||
LLConstant* llc = llvm::dyn_cast<LLConstant>(vd->ir.getIrValue());
|
||||
assert(llc);
|
||||
return llc;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DValue* PtrExp::toElem(IRState* p)
|
||||
|
||||
Reference in New Issue
Block a user