[llvm] a1daa7d - Avoid std::tie in TypeSize.h

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 17:02:07 PST 2020


Author: Reid Kleckner
Date: 2020-01-31T16:57:33-08:00
New Revision: a1daa7d079aa86589ac7e73e818d4ab95969275f

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

LOG: Avoid std::tie in TypeSize.h

std::tie isn't saving much here, just use == && ==. No numbers to
support this, but std::tie is one of the most expensive instantiations.

Added: 
    

Modified: 
    llvm/include/llvm/Support/TypeSize.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h
index 459ffb742d52..7f05ed359ca6 100644
--- a/llvm/include/llvm/Support/TypeSize.h
+++ b/llvm/include/llvm/Support/TypeSize.h
@@ -16,7 +16,6 @@
 #define LLVM_SUPPORT_TYPESIZE_H
 
 #include <cassert>
-#include <tuple>
 
 namespace llvm {
 
@@ -70,8 +69,7 @@ class TypeSize {
   // not guaranteed to be the same size at runtime, so they are never
   // considered to be equal.
   friend bool operator==(const TypeSize &LHS, const TypeSize &RHS) {
-    return std::tie(LHS.MinSize, LHS.IsScalable) ==
-           std::tie(RHS.MinSize, RHS.IsScalable);
+    return LHS.MinSize == RHS.MinSize && LHS.IsScalable == RHS.IsScalable;
   }
 
   friend bool operator!=(const TypeSize &LHS, const TypeSize &RHS) {


        


More information about the llvm-commits mailing list