[PATCH] D30613: [APInt] Remove the And/Or/Xor/Not functions from the APIntOps namespace.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 4 23:11:39 PST 2017


craig.topper created this revision.

They aren't used anywhere in tree and its preferable to use the &, |, ^, or ~ operators.

With my patch to add rvalue reference support to &, |, ^ operators it also becomes less performant to use these functions.


https://reviews.llvm.org/D30613

Files:
  include/llvm/ADT/APInt.h


Index: include/llvm/ADT/APInt.h
===================================================================
--- include/llvm/ADT/APInt.h
+++ include/llvm/ADT/APInt.h
@@ -1992,27 +1992,6 @@
 /// Performs subtraction on APInt values.
 inline APInt sub(const APInt &LHS, const APInt &RHS) { return LHS - RHS; }
 
-/// \brief Bitwise AND function for APInt.
-///
-/// Performs bitwise AND operation on APInt LHS and
-/// APInt RHS.
-inline APInt And(const APInt &LHS, const APInt &RHS) { return LHS & RHS; }
-
-/// \brief Bitwise OR function for APInt.
-///
-/// Performs bitwise OR operation on APInt LHS and APInt RHS.
-inline APInt Or(const APInt &LHS, const APInt &RHS) { return LHS | RHS; }
-
-/// \brief Bitwise XOR function for APInt.
-///
-/// Performs bitwise XOR operation on APInt.
-inline APInt Xor(const APInt &LHS, const APInt &RHS) { return LHS ^ RHS; }
-
-/// \brief Bitwise complement function.
-///
-/// Performs a bitwise complement operation on APInt.
-inline APInt Not(const APInt &APIVal) { return ~APIVal; }
-
 } // End of APIntOps namespace
 
 // See friend declaration above. This additional declaration is required in


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30613.90598.patch
Type: text/x-patch
Size: 1132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170305/38ad9cf1/attachment.bin>


More information about the llvm-commits mailing list