[llvm] r295505 - [CodeGen] Revert changes in LowLevelType to pre-r295499 to fix broken buildbots.

Eugene Zelenko via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 14:23:35 PST 2017


Author: eugenezelenko
Date: Fri Feb 17 16:23:34 2017
New Revision: 295505

URL: http://llvm.org/viewvc/llvm-project?rev=295505&view=rev
Log:
[CodeGen] Revert changes in LowLevelType to pre-r295499 to fix broken buildbots.

Modified:
    llvm/trunk/include/llvm/CodeGen/LowLevelType.h
    llvm/trunk/lib/CodeGen/LowLevelType.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LowLevelType.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LowLevelType.h?rev=295505&r1=295504&r2=295505&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LowLevelType.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LowLevelType.h Fri Feb 17 16:23:34 2017
@@ -1,4 +1,4 @@
-//===- llvm/CodeGen/GlobalISel/LowLevelType.h -------------------*- C++ -*-===//
+//== llvm/CodeGen/GlobalISel/LowLevelType.h -------------------- -*- C++ -*-==//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -27,21 +27,19 @@
 #ifndef LLVM_CODEGEN_GLOBALISEL_LOWLEVELTYPE_H
 #define LLVM_CODEGEN_GLOBALISEL_LOWLEVELTYPE_H
 
-#include "llvm/ADT/DenseMapInfo.h"
-#include "llvm/CodeGen/MachineValueType.h"
 #include <cassert>
-#include <cstdint>
+#include "llvm/ADT/DenseMapInfo.h"
+#include "llvm/CodeGen/ValueTypes.h"
 
 namespace llvm {
 
 class DataLayout;
-class raw_ostream;
+class LLVMContext;
 class Type;
+class raw_ostream;
 
 class LLT {
 public:
-  friend struct DenseMapInfo<LLT>;
-
   enum TypeKind : uint16_t {
     Invalid,
     Scalar,
@@ -49,19 +47,6 @@ public:
     Vector,
   };
 
-  explicit LLT(TypeKind Kind, uint16_t NumElements, unsigned SizeInBits)
-    : SizeInBits(SizeInBits), ElementsOrAddrSpace(NumElements), Kind(Kind) {
-    assert((Kind != Vector || ElementsOrAddrSpace > 1) &&
-           "invalid number of vector elements");
-  }
-
-  LLT() = default;
-
-  /// Construct a low-level type based on an LLVM type.
-  explicit LLT(Type &Ty, const DataLayout &DL);
-
-  explicit LLT(MVT VT);
-
   /// Get a low-level scalar or aggregate "bag of bits".
   static LLT scalar(unsigned SizeInBits) {
     assert(SizeInBits > 0 && "invalid scalar size");
@@ -87,6 +72,19 @@ public:
     return LLT{Vector, NumElements, ScalarTy.getSizeInBits()};
   }
 
+  explicit LLT(TypeKind Kind, uint16_t NumElements, unsigned SizeInBits)
+    : SizeInBits(SizeInBits), ElementsOrAddrSpace(NumElements), Kind(Kind) {
+    assert((Kind != Vector || ElementsOrAddrSpace > 1) &&
+           "invalid number of vector elements");
+  }
+
+  explicit LLT() : SizeInBits(0), ElementsOrAddrSpace(0), Kind(Invalid) {}
+
+  /// Construct a low-level type based on an LLVM type.
+  explicit LLT(Type &Ty, const DataLayout &DL);
+
+  explicit LLT(MVT VT);
+
   bool isValid() const { return Kind != Invalid; }
 
   bool isScalar() const { return Kind == Scalar; }
@@ -174,10 +172,11 @@ public:
 
   bool operator!=(const LLT &RHS) const { return !(*this == RHS); }
 
+  friend struct DenseMapInfo<LLT>;
 private:
-  unsigned SizeInBits = 0;
-  uint16_t ElementsOrAddrSpace = 0;
-  TypeKind Kind = Invalid;
+  unsigned SizeInBits;
+  uint16_t ElementsOrAddrSpace;
+  TypeKind Kind;
 };
 
 inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) {
@@ -189,22 +188,19 @@ template<> struct DenseMapInfo<LLT> {
   static inline LLT getEmptyKey() {
     return LLT{LLT::Invalid, 0, -1u};
   }
-
   static inline LLT getTombstoneKey() {
     return LLT{LLT::Invalid, 0, -2u};
   }
-
   static inline unsigned getHashValue(const LLT &Ty) {
     uint64_t Val = ((uint64_t)Ty.SizeInBits << 32) |
                    ((uint64_t)Ty.ElementsOrAddrSpace << 16) | (uint64_t)Ty.Kind;
     return DenseMapInfo<uint64_t>::getHashValue(Val);
   }
-
   static bool isEqual(const LLT &LHS, const LLT &RHS) {
     return LHS == RHS;
   }
 };
 
-} // end namespace llvm
+}
 
-#endif // LLVM_CODEGEN_GLOBALISEL_LOWLEVELTYPE_H
+#endif

Modified: llvm/trunk/lib/CodeGen/LowLevelType.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LowLevelType.cpp?rev=295505&r1=295504&r2=295505&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LowLevelType.cpp (original)
+++ llvm/trunk/lib/CodeGen/LowLevelType.cpp Fri Feb 17 16:23:34 2017
@@ -1,4 +1,4 @@
-//===- llvm/CodeGen/GlobalISel/LowLevelType.cpp ---------------------------===//
+//===-- llvm/CodeGen/GlobalISel/LowLevelType.cpp --------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -13,15 +13,9 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/CodeGen/LowLevelType.h"
-#include "llvm/CodeGen/MachineValueType.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
-#include "llvm/IR/Type.h"
-#include "llvm/Support/Casting.h"
-#include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
-#include <cassert>
-
 using namespace llvm;
 
 LLT::LLT(Type &Ty, const DataLayout &DL) {




More information about the llvm-commits mailing list