Author: Shafik Yaghmour
Date: 2025-06-11T08:02:44-07:00
New Revision: 3ca6ea0f3aabcfba318ce9b14e4567f05de3b556

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

LOG: [Clang][ByteCode][NFC] Move APInt into pushInteger since it is being 
passed by value (#143578)

Static analysis flagged that we could move APInt instead of copy, indeed
it has a move constructor and so we should move into values for APInt.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpBuiltin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp 
b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index b678f229d50bb..5fc5034569597 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -1321,7 +1321,7 @@ static bool interp__builtin_ia32_pdep(InterpState &S, 
CodePtr OpPC,
     if (Mask[I])
       Result.setBitVal(I, Val[P++]);
   }
-  pushInteger(S, Result, Call->getType());
+  pushInteger(S, std::move(Result), Call->getType());
   return true;
 }
 
@@ -1344,7 +1344,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, 
CodePtr OpPC,
     if (Mask[I])
       Result.setBitVal(P++, Val[I]);
   }
-  pushInteger(S, Result, Call->getType());
+  pushInteger(S, std::move(Result), Call->getType());
   return true;
 }
 


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

Reply via email to