Author: Timm Baeder Date: 2026-08-24T16:10:58+02:00 New Revision: 2b660275bdabe26dfc389d6b0321e1007e0fe8da
URL: https://github.com/llvm/llvm-project/commit/2b660275bdabe26dfc389d6b0321e1007e0fe8da DIFF: https://github.com/llvm/llvm-project/commit/2b660275bdabe26dfc389d6b0321e1007e0fe8da.diff LOG: [clang][bytecode][NFC] Remove unnecessary rvalue reference parameters (#218395) DeclOrExpr is just pointer-sized, so copy them. Added: Modified: clang/lib/AST/ByteCode/Compiler.cpp clang/lib/AST/ByteCode/Compiler.h Removed: ################################################################################ diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp index afcc125f7e1ec..f40d736e225ac 100644 --- a/clang/lib/AST/ByteCode/Compiler.cpp +++ b/clang/lib/AST/ByteCode/Compiler.cpp @@ -5330,8 +5330,8 @@ bool Compiler<Emitter>::emitConst(const APSInt &Value, const Expr *E) { } template <class Emitter> -unsigned Compiler<Emitter>::allocateLocalPrimitive(DeclOrExpr &&Src, - PrimType Ty, bool IsConst, +unsigned Compiler<Emitter>::allocateLocalPrimitive(DeclOrExpr Src, PrimType Ty, + bool IsConst, bool IsVolatile, ScopeKind SC) { // FIXME: There are cases where Src.isExpr() is wrong, e.g. @@ -5348,7 +5348,7 @@ unsigned Compiler<Emitter>::allocateLocalPrimitive(DeclOrExpr &&Src, } template <class Emitter> -UnsignedOrNone Compiler<Emitter>::allocateLocal(DeclOrExpr &&Src, QualType Ty, +UnsignedOrNone Compiler<Emitter>::allocateLocal(DeclOrExpr Src, QualType Ty, ScopeKind SC) { const ValueDecl *Key = nullptr; const Expr *Init = nullptr; diff --git a/clang/lib/AST/ByteCode/Compiler.h b/clang/lib/AST/ByteCode/Compiler.h index 40589b45fa051..f34809cd0f14c 100644 --- a/clang/lib/AST/ByteCode/Compiler.h +++ b/clang/lib/AST/ByteCode/Compiler.h @@ -346,12 +346,12 @@ class Compiler : public ConstStmtVisitor<Compiler<Emitter>, bool>, bool Activate, bool IsOperatorCall); /// Creates a local primitive value. - unsigned allocateLocalPrimitive(DeclOrExpr &&Decl, PrimType Ty, bool IsConst, + unsigned allocateLocalPrimitive(DeclOrExpr Decl, PrimType Ty, bool IsConst, bool IsVolatile = false, ScopeKind SC = ScopeKind::Block); /// Allocates a space storing a local given its type. - UnsignedOrNone allocateLocal(DeclOrExpr &&Decl, QualType Ty = QualType(), + UnsignedOrNone allocateLocal(DeclOrExpr Decl, QualType Ty = QualType(), ScopeKind = ScopeKind::Block); UnsignedOrNone allocateTemporary(const Expr *E); _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
