mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03:00
Lookup runtime function before constructing the call args
To retain the LoC information in case TypeInfo declarations are missing.
This commit is contained in:
parent
4c1154703e
commit
9ff736bf0f
3 changed files with 17 additions and 17 deletions
|
@ -360,12 +360,12 @@ DValue *DtoDynamicCastObject(Loc &loc, DValue *val, Type *_to) {
|
|||
// call:
|
||||
// Object _d_dynamic_cast(Object o, ClassInfo c)
|
||||
|
||||
resolveObjectAndClassInfoClasses();
|
||||
|
||||
llvm::Function *func =
|
||||
getRuntimeFunction(loc, gIR->module, "_d_dynamic_cast");
|
||||
LLFunctionType *funcTy = func->getFunctionType();
|
||||
|
||||
resolveObjectAndClassInfoClasses();
|
||||
|
||||
// Object o
|
||||
LLValue *obj = DtoRVal(val);
|
||||
obj = DtoBitCast(obj, funcTy->getParamType(0));
|
||||
|
@ -397,12 +397,12 @@ DValue *DtoDynamicCastInterface(Loc &loc, DValue *val, Type *_to) {
|
|||
// call:
|
||||
// Object _d_interface_cast(void* p, ClassInfo c)
|
||||
|
||||
resolveObjectAndClassInfoClasses();
|
||||
|
||||
llvm::Function *func =
|
||||
getRuntimeFunction(loc, gIR->module, "_d_interface_cast");
|
||||
LLFunctionType *funcTy = func->getFunctionType();
|
||||
|
||||
resolveObjectAndClassInfoClasses();
|
||||
|
||||
// void* p
|
||||
LLValue *ptr = DtoRVal(val);
|
||||
ptr = DtoBitCast(ptr, funcTy->getParamType(0));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue