Author: Timm Bäder
Date: 2022-10-26T08:49:44+02:00
New Revision: caa83d23295ae42334ea692a300e9acc77a30449

URL: 
https://github.com/llvm/llvm-project/commit/caa83d23295ae42334ea692a300e9acc77a30449
DIFF: 
https://github.com/llvm/llvm-project/commit/caa83d23295ae42334ea692a300e9acc77a30449.diff

LOG: [clang][Interp][NFC] Simplify InterpFrame::describe

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpFrame.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpFrame.cpp 
b/clang/lib/AST/Interp/InterpFrame.cpp
index 1a97e2ad02b4..781b6d8a845a 100644
--- a/clang/lib/AST/Interp/InterpFrame.cpp
+++ b/clang/lib/AST/Interp/InterpFrame.cpp
@@ -157,12 +157,7 @@ void InterpFrame::describe(llvm::raw_ostream &OS) {
   for (unsigned I = 0, N = F->getNumParams(); I < N; ++I) {
     QualType Ty = F->getParamDecl(I)->getType();
 
-    PrimType PrimTy;
-    if (llvm::Optional<PrimType> T = S.Ctx.classify(Ty)) {
-      PrimTy = *T;
-    } else {
-      PrimTy = PT_Ptr;
-    }
+    PrimType PrimTy = S.Ctx.classify(Ty).value_or(PT_Ptr);
 
     TYPE_SWITCH(PrimTy, print(OS, stackRef<T>(Off), S.getCtx(), Ty));
     Off += align(primSize(PrimTy));


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to