[clang] 93373c3 - [clang][Interp][NFC] Use a const reference in IncDecHelper

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 19 05:24:34 PDT 2023


Author: Timm Bäder
Date: 2023-10-19T14:21:52+02:00
New Revision: 93373c3da9416e52d3f516435500e04a7d142370

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

LOG: [clang][Interp][NFC] Use a const reference in IncDecHelper

Added: 
    

Modified: 
    clang/lib/AST/Interp/Interp.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Interp.h b/clang/lib/AST/Interp/Interp.h
index 4b081301655cfb2..7ef1e344224a3c3 100644
--- a/clang/lib/AST/Interp/Interp.h
+++ b/clang/lib/AST/Interp/Interp.h
@@ -522,7 +522,7 @@ enum class IncDecOp {
 
 template <typename T, IncDecOp Op, PushVal DoPush>
 bool IncDecHelper(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
-  T Value = Ptr.deref<T>();
+  const T &Value = Ptr.deref<T>();
   T Result;
 
   if constexpr (DoPush == PushVal::Yes)


        


More information about the cfe-commits mailing list