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

2025-06-11 Thread Shafik Yaghmour via cfe-commits

https://github.com/shafik closed 
https://github.com/llvm/llvm-project/pull/143578
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-06-11 Thread Timm Baeder via cfe-commits

https://github.com/tbaederr approved this pull request.


https://github.com/llvm/llvm-project/pull/143578
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-06-11 Thread Aaron Ballman via cfe-commits

https://github.com/AaronBallman approved this pull request.

LGTM

https://github.com/llvm/llvm-project/pull/143578
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2025-06-11 Thread Shafik Yaghmour via cfe-commits

https://github.com/shafik updated 
https://github.com/llvm/llvm-project/pull/143578

>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 10:41:04 -0700
Subject: [PATCH 1/3] [Clang][ByteCode][NFC] Move APInt into pushInteger since
 it is being passed by value

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.
---
 clang/lib/AST/ByteCode/InterpBuiltin.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
 }
 

>From 13a3055b7a180f218bad55d426db8958a410fd1d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 13:16:45 -0700
Subject: [PATCH 2/3] Trigger Build


>From 7f622a463e6cd84a7711d826db067601cb7ff050 Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 23:39:55 -0700
Subject: [PATCH 3/3] Trigger Build


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


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

2025-06-10 Thread Shafik Yaghmour via cfe-commits

https://github.com/shafik updated 
https://github.com/llvm/llvm-project/pull/143578

>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 10:41:04 -0700
Subject: [PATCH 1/2] [Clang][ByteCode][NFC] Move APInt into pushInteger since
 it is being passed by value

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.
---
 clang/lib/AST/ByteCode/InterpBuiltin.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
 }
 

>From 13a3055b7a180f218bad55d426db8958a410fd1d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 13:16:45 -0700
Subject: [PATCH 2/2] Trigger Build


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


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

2025-06-10 Thread Shafik Yaghmour via cfe-commits

https://github.com/shafik created 
https://github.com/llvm/llvm-project/pull/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.

>From 09060e9a91842346f106d55b32141b16efe7378d Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour 
Date: Tue, 10 Jun 2025 10:41:04 -0700
Subject: [PATCH] [Clang][ByteCode][NFC] Move APInt into pushInteger since it
 is being passed by value

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.
---
 clang/lib/AST/ByteCode/InterpBuiltin.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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


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

2025-06-10 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Shafik Yaghmour (shafik)


Changes

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/143578.diff


1 Files Affected:

- (modified) clang/lib/AST/ByteCode/InterpBuiltin.cpp (+2-2) 


``diff
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;
 }
 

``




https://github.com/llvm/llvm-project/pull/143578
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits