@@ -984,11 +984,10 @@ class ToElemVisitor : public Visitor {
984984 // function pointers are special
985985 if (e->type ->toBasetype ()->ty == TY::Tfunction) {
986986 DValue *dv = toElem (e->e1 );
987- LLValue *llVal = DtoRVal (dv);
988987 if (DFuncValue *dfv = dv->isFunc ()) {
989- result = new DFuncValue (e->type , dfv->func , llVal );
988+ result = new DFuncValue (e->type , dfv->func , dfv-> funcPtr );
990989 } else {
991- result = new DImValue (e->type , llVal );
990+ result = new DImValue (e->type , DtoRVal (dv) );
992991 }
993992 return ;
994993 }
@@ -1072,18 +1071,18 @@ class ToElemVisitor : public Visitor {
10721071 fdecl->visibility .kind != Visibility::package_;
10731072
10741073 // Get the actual function value to call.
1075- LLValue *funcval = nullptr ;
1074+ LLValue *funcPtr = nullptr ;
10761075 LLValue *vtable = nullptr ;
10771076 if (nonFinal) {
10781077 DtoResolveFunction (fdecl);
1079- std::tie (funcval , vtable) = DtoVirtualFunctionPointer (l, fdecl);
1078+ std::tie (funcPtr , vtable) = DtoVirtualFunctionPointer (l, fdecl);
10801079 } else {
1081- funcval = DtoCallee (fdecl);
1080+ funcPtr = DtoCallee (fdecl);
10821081 }
1083- assert (funcval );
1082+ assert (funcPtr );
10841083
10851084 LLValue *vthis = (DtoIsInMemoryOnly (l->type ) ? DtoLVal (l) : DtoRVal (l));
1086- result = new DFuncValue (fdecl, funcval , vthis, vtable);
1085+ result = new DFuncValue (fdecl, funcPtr , vthis, vtable);
10871086 } else {
10881087 llvm_unreachable (" Unknown target for VarDeclaration." );
10891088 }
0 commit comments