[clang] c61686e - [clang][NFC] Use no-param version of skipRValueSubobjectAdjustments

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 02:25:42 PST 2024


Author: Timm Bäder
Date: 2024-01-30T11:25:28+01:00
New Revision: c61686e8abc2aee6e2e0ad09c6d1ade534e497b3

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

LOG: [clang][NFC] Use no-param version of skipRValueSubobjectAdjustments

when possible.

Added: 
    

Modified: 
    clang/lib/Analysis/CFG.cpp
    clang/lib/CodeGen/CGExprConstant.cpp
    clang/lib/Sema/JumpDiagnostics.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index 03ab4c6fdf29c..de70cbbf6cdb3 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -1788,10 +1788,7 @@ static QualType getReferenceInitTemporaryType(const Expr *Init,
     }
 
     // Skip sub-object accesses into rvalues.
-    SmallVector<const Expr *, 2> CommaLHSs;
-    SmallVector<SubobjectAdjustment, 2> Adjustments;
-    const Expr *SkippedInit =
-        Init->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
+    const Expr *SkippedInit = Init->skipRValueSubobjectAdjustments();
     if (SkippedInit != Init) {
       Init = SkippedInit;
       continue;

diff  --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index afadef7c4c105..a054f38e860b7 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -2080,10 +2080,7 @@ ConstantLValue
 ConstantLValueEmitter::VisitMaterializeTemporaryExpr(
                                             const MaterializeTemporaryExpr *E) {
   assert(E->getStorageDuration() == SD_Static);
-  SmallVector<const Expr *, 2> CommaLHSs;
-  SmallVector<SubobjectAdjustment, 2> Adjustments;
-  const Expr *Inner =
-      E->getSubExpr()->skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
+  const Expr *Inner = E->getSubExpr()->skipRValueSubobjectAdjustments();
   return CGM.GetAddrOfGlobalTemporary(E, Inner);
 }
 

diff  --git a/clang/lib/Sema/JumpDiagnostics.cpp b/clang/lib/Sema/JumpDiagnostics.cpp
index 45ff36d5fe237..ec3892e92f3c3 100644
--- a/clang/lib/Sema/JumpDiagnostics.cpp
+++ b/clang/lib/Sema/JumpDiagnostics.cpp
@@ -577,11 +577,8 @@ void JumpScopeChecker::BuildScopeInformation(Stmt *S,
     // automatic storage duration.
     MaterializeTemporaryExpr *MTE = cast<MaterializeTemporaryExpr>(S);
     if (MTE->getStorageDuration() == SD_Automatic) {
-      SmallVector<const Expr *, 4> CommaLHS;
-      SmallVector<SubobjectAdjustment, 4> Adjustments;
       const Expr *ExtendedObject =
-          MTE->getSubExpr()->skipRValueSubobjectAdjustments(CommaLHS,
-                                                            Adjustments);
+          MTE->getSubExpr()->skipRValueSubobjectAdjustments();
       if (ExtendedObject->getType().isDestructedType()) {
         Scopes.push_back(GotoScope(ParentScope, 0,
                                    diag::note_exits_temporary_dtor,


        


More information about the cfe-commits mailing list