@@ -468,10 +468,10 @@ inline bool Mulc(InterpState &S, CodePtr OpPC) {
468468 const Pointer &Result = S.Stk .peek <Pointer>();
469469
470470 if constexpr (std::is_same_v<T, Floating>) {
471- APFloat A = LHS.atIndex ( 0 ). deref <Floating>().getAPFloat ();
472- APFloat B = LHS.atIndex ( 1 ). deref <Floating>().getAPFloat ();
473- APFloat C = RHS.atIndex ( 0 ). deref <Floating>().getAPFloat ();
474- APFloat D = RHS.atIndex ( 1 ). deref <Floating>().getAPFloat ();
471+ APFloat A = LHS.elem <Floating>(0 ).getAPFloat ();
472+ APFloat B = LHS.elem <Floating>(1 ).getAPFloat ();
473+ APFloat C = RHS.elem <Floating>(0 ).getAPFloat ();
474+ APFloat D = RHS.elem <Floating>(1 ).getAPFloat ();
475475
476476 APFloat ResR (A.getSemantics ());
477477 APFloat ResI (A.getSemantics ());
@@ -480,20 +480,20 @@ inline bool Mulc(InterpState &S, CodePtr OpPC) {
480480 // Copy into the result.
481481 Floating RA = S.allocFloat (A.getSemantics ());
482482 RA.copy (ResR);
483- Result.atIndex ( 0 ). deref <Floating>() = RA; // Floating(ResR);
483+ Result.elem <Floating>(0 ) = RA; // Floating(ResR);
484484 Result.atIndex (0 ).initialize ();
485485
486486 Floating RI = S.allocFloat (A.getSemantics ());
487487 RI.copy (ResI);
488- Result.atIndex ( 1 ). deref <Floating>() = RI; // Floating(ResI);
488+ Result.elem <Floating>(1 ) = RI; // Floating(ResI);
489489 Result.atIndex (1 ).initialize ();
490490 Result.initialize ();
491491 } else {
492492 // Integer element type.
493- const T &LHSR = LHS.atIndex ( 0 ). deref <T>();
494- const T &LHSI = LHS.atIndex ( 1 ). deref <T>();
495- const T &RHSR = RHS.atIndex ( 0 ). deref <T>();
496- const T &RHSI = RHS.atIndex ( 1 ). deref <T>();
493+ const T &LHSR = LHS.elem <T>(0 );
494+ const T &LHSI = LHS.elem <T>(1 );
495+ const T &RHSR = RHS.elem <T>(0 );
496+ const T &RHSI = RHS.elem <T>(1 );
497497 unsigned Bits = LHSR.bitWidth ();
498498
499499 // real(Result) = (real(LHS) * real(RHS)) - (imag(LHS) * imag(RHS))
@@ -503,7 +503,7 @@ inline bool Mulc(InterpState &S, CodePtr OpPC) {
503503 T B;
504504 if (T::mul (LHSI, RHSI, Bits, &B))
505505 return false ;
506- if (T::sub (A, B, Bits, &Result.atIndex ( 0 ). deref <T>()))
506+ if (T::sub (A, B, Bits, &Result.elem <T>(0 )))
507507 return false ;
508508 Result.atIndex (0 ).initialize ();
509509
@@ -512,7 +512,7 @@ inline bool Mulc(InterpState &S, CodePtr OpPC) {
512512 return false ;
513513 if (T::mul (LHSI, RHSR, Bits, &B))
514514 return false ;
515- if (T::add (A, B, Bits, &Result.atIndex ( 1 ). deref <T>()))
515+ if (T::add (A, B, Bits, &Result.elem <T>(1 )))
516516 return false ;
517517 Result.atIndex (1 ).initialize ();
518518 Result.initialize ();
@@ -528,10 +528,10 @@ inline bool Divc(InterpState &S, CodePtr OpPC) {
528528 const Pointer &Result = S.Stk .peek <Pointer>();
529529
530530 if constexpr (std::is_same_v<T, Floating>) {
531- APFloat A = LHS.atIndex ( 0 ). deref <Floating>().getAPFloat ();
532- APFloat B = LHS.atIndex ( 1 ). deref <Floating>().getAPFloat ();
533- APFloat C = RHS.atIndex ( 0 ). deref <Floating>().getAPFloat ();
534- APFloat D = RHS.atIndex ( 1 ). deref <Floating>().getAPFloat ();
531+ APFloat A = LHS.elem <Floating>(0 ).getAPFloat ();
532+ APFloat B = LHS.elem <Floating>(1 ).getAPFloat ();
533+ APFloat C = RHS.elem <Floating>(0 ).getAPFloat ();
534+ APFloat D = RHS.elem <Floating>(1 ).getAPFloat ();
535535
536536 APFloat ResR (A.getSemantics ());
537537 APFloat ResI (A.getSemantics ());
@@ -540,21 +540,21 @@ inline bool Divc(InterpState &S, CodePtr OpPC) {
540540 // Copy into the result.
541541 Floating RA = S.allocFloat (A.getSemantics ());
542542 RA.copy (ResR);
543- Result.atIndex ( 0 ). deref <Floating>() = RA; // Floating(ResR);
543+ Result.elem <Floating>(0 ) = RA; // Floating(ResR);
544544 Result.atIndex (0 ).initialize ();
545545
546546 Floating RI = S.allocFloat (A.getSemantics ());
547547 RI.copy (ResI);
548- Result.atIndex ( 1 ). deref <Floating>() = RI; // Floating(ResI);
548+ Result.elem <Floating>(1 ) = RI; // Floating(ResI);
549549 Result.atIndex (1 ).initialize ();
550550
551551 Result.initialize ();
552552 } else {
553553 // Integer element type.
554- const T &LHSR = LHS.atIndex ( 0 ). deref <T>();
555- const T &LHSI = LHS.atIndex ( 1 ). deref <T>();
556- const T &RHSR = RHS.atIndex ( 0 ). deref <T>();
557- const T &RHSI = RHS.atIndex ( 1 ). deref <T>();
554+ const T &LHSR = LHS.elem <T>(0 );
555+ const T &LHSI = LHS.elem <T>(1 );
556+ const T &RHSR = RHS.elem <T>(0 );
557+ const T &RHSI = RHS.elem <T>(1 );
558558 unsigned Bits = LHSR.bitWidth ();
559559 const T Zero = T::from (0 , Bits);
560560
@@ -581,8 +581,8 @@ inline bool Divc(InterpState &S, CodePtr OpPC) {
581581 }
582582
583583 // real(Result) = ((real(LHS) * real(RHS)) + (imag(LHS) * imag(RHS))) / Den
584- T &ResultR = Result.atIndex ( 0 ). deref <T>();
585- T &ResultI = Result.atIndex ( 1 ). deref <T>();
584+ T &ResultR = Result.elem <T>(0 );
585+ T &ResultI = Result.elem <T>(1 );
586586
587587 if (T::mul (LHSR, RHSR, Bits, &A) || T::mul (LHSI, RHSI, Bits, &B))
588588 return false ;
@@ -3103,7 +3103,7 @@ inline bool ArrayElem(InterpState &S, CodePtr OpPC, uint32_t Index) {
31033103 return false ;
31043104
31053105 assert (Ptr.atIndex (Index).getFieldDesc ()->getPrimType () == Name);
3106- S.Stk .push <T>(Ptr.atIndex (Index). deref <T>());
3106+ S.Stk .push <T>(Ptr.elem <T>(Index ));
31073107 return true ;
31083108}
31093109
@@ -3115,7 +3115,7 @@ inline bool ArrayElemPop(InterpState &S, CodePtr OpPC, uint32_t Index) {
31153115 return false ;
31163116
31173117 assert (Ptr.atIndex (Index).getFieldDesc ()->getPrimType () == Name);
3118- S.Stk .push <T>(Ptr.atIndex (Index). deref <T>());
3118+ S.Stk .push <T>(Ptr.elem <T>(Index ));
31193119 return true ;
31203120}
31213121
0 commit comments