@@ -665,7 +665,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
665665 return false ;
666666
667667 // Primitive values.
668- if (std::optional<PrimType> T = Ctx.classify (Ty)) {
668+ if (OptPrimType T = Ctx.classify (Ty)) {
669669 TYPE_SWITCH (*T, R = Ptr.deref <T>().toAPValue (ASTCtx));
670670 return true ;
671671 }
@@ -682,7 +682,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
682682 const Pointer &FP = Ptr.atField (F.Offset );
683683 QualType FieldTy = F.Decl ->getType ();
684684 if (FP.isActive ()) {
685- if (std::optional<PrimType> T = Ctx.classify (FieldTy)) {
685+ if (OptPrimType T = Ctx.classify (FieldTy)) {
686686 TYPE_SWITCH (*T, Value = FP.deref <T>().toAPValue (ASTCtx));
687687 } else {
688688 Ok &= Composite (FieldTy, FP, Value);
@@ -705,7 +705,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
705705 const Pointer &FP = Ptr.atField (FD->Offset );
706706 APValue &Value = R.getStructField (I);
707707
708- if (std::optional<PrimType> T = Ctx.classify (FieldTy)) {
708+ if (OptPrimType T = Ctx.classify (FieldTy)) {
709709 TYPE_SWITCH (*T, Value = FP.deref <T>().toAPValue (ASTCtx));
710710 } else {
711711 Ok &= Composite (FieldTy, FP, Value);
@@ -743,7 +743,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
743743 for (unsigned I = 0 ; I < NumElems; ++I) {
744744 APValue &Slot = R.getArrayInitializedElt (I);
745745 const Pointer &EP = Ptr.atIndex (I);
746- if (std::optional<PrimType> T = Ctx.classify (ElemTy)) {
746+ if (OptPrimType T = Ctx.classify (ElemTy)) {
747747 TYPE_SWITCH (*T, Slot = EP.deref <T>().toAPValue (ASTCtx));
748748 } else {
749749 Ok &= Composite (ElemTy, EP.narrow (), Slot);
@@ -757,7 +757,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
757757 QualType ElemTy = CT->getElementType ();
758758
759759 if (ElemTy->isIntegerType ()) {
760- std::optional<PrimType> ElemT = Ctx.classify (ElemTy);
760+ OptPrimType ElemT = Ctx.classify (ElemTy);
761761 assert (ElemT);
762762 INT_TYPE_SWITCH (*ElemT, {
763763 auto V1 = Ptr.elem <T>(0 );
@@ -803,7 +803,7 @@ std::optional<APValue> Pointer::toRValue(const Context &Ctx,
803803 return toAPValue (ASTCtx);
804804
805805 // Just load primitive types.
806- if (std::optional<PrimType> T = Ctx.classify (ResultType)) {
806+ if (OptPrimType T = Ctx.classify (ResultType)) {
807807 TYPE_SWITCH (*T, return this ->deref <T>().toAPValue (ASTCtx));
808808 }
809809
0 commit comments