Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// | 1 //===- subzero/src/IceDefs.h - Common Subzero declaraions -------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file declares various useful types and classes that have | 10 // This file declares various useful types and classes that have |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include <cstdio> // snprintf | 22 #include <cstdio> // snprintf |
| 23 #include <functional> // std::less | 23 #include <functional> // std::less |
| 24 #include <list> | 24 #include <list> |
| 25 #include <map> | 25 #include <map> |
| 26 #include <set> | 26 #include <set> |
| 27 #include <string> | 27 #include <string> |
| 28 #include <vector> | 28 #include <vector> |
| 29 | 29 |
| 30 #include "llvm/ADT/BitVector.h" | 30 #include "llvm/ADT/BitVector.h" |
| 31 #include "llvm/ADT/SmallBitVector.h" | 31 #include "llvm/ADT/SmallBitVector.h" |
| 32 #include "llvm/ADT/SmallVector.h" | |
| 32 #include "llvm/ADT/STLExtras.h" | 33 #include "llvm/ADT/STLExtras.h" |
| 33 #include "llvm/Support/Casting.h" | 34 #include "llvm/Support/Casting.h" |
| 34 #include "llvm/Support/Compiler.h" // LLVM_STATIC_ASSERT | 35 #include "llvm/Support/Compiler.h" // LLVM_STATIC_ASSERT |
| 35 #include "llvm/Support/raw_ostream.h" | 36 #include "llvm/Support/raw_ostream.h" |
| 36 #include "llvm/Support/Timer.h" | 37 #include "llvm/Support/Timer.h" |
| 37 | 38 |
| 38 // Roll our own static_assert<> in the absence of C++11. TODO: change | 39 // Roll our own static_assert<> in the absence of C++11. TODO: change |
| 39 // to static_assert<> with C++11. | 40 // to static_assert<> with C++11. |
| 40 template <bool> struct staticAssert; | 41 template <bool> struct staticAssert; |
| 41 template <> struct staticAssert<true> {}; // only true is defined | 42 template <> struct staticAssert<true> {}; // only true is defined |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 57 class Variable; | 58 class Variable; |
| 58 | 59 |
| 59 // TODO: Switch over to LLVM's ADT container classes. | 60 // TODO: Switch over to LLVM's ADT container classes. |
| 60 // http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure- for-a-task | 61 // http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure- for-a-task |
| 61 typedef std::string IceString; | 62 typedef std::string IceString; |
| 62 typedef std::list<Inst *> InstList; | 63 typedef std::list<Inst *> InstList; |
| 63 typedef std::list<InstPhi *> PhiList; | 64 typedef std::list<InstPhi *> PhiList; |
| 64 typedef std::vector<Variable *> VarList; | 65 typedef std::vector<Variable *> VarList; |
| 65 typedef std::vector<CfgNode *> NodeList; | 66 typedef std::vector<CfgNode *> NodeList; |
| 66 typedef std::vector<Constant *> ConstantList; | 67 typedef std::vector<Constant *> ConstantList; |
| 68 typedef std::vector<IceString> StringList; | |
| 69 // TODO(wala): Switch to std::array after C++11 | |
| 70 typedef llvm::SmallVector<char, 16> Vect128; | |
| 71 typedef llvm::SmallVector<bool, 16> BitVect; | |
|
jvoung (off chromium)
2014/06/26 00:45:40
LLVM actually has a separate SmallBitVector<>:
htt
wala
2014/06/26 17:32:42
SmallVector has operator<. SmallBitVector does not
| |
| 67 | 72 |
| 68 // SizeT is for holding small-ish limits like number of source | 73 // SizeT is for holding small-ish limits like number of source |
| 69 // operands in an instruction. It is used instead of size_t (which | 74 // operands in an instruction. It is used instead of size_t (which |
| 70 // may be 64-bits wide) when we want to save space. | 75 // may be 64-bits wide) when we want to save space. |
| 71 typedef uint32_t SizeT; | 76 typedef uint32_t SizeT; |
| 72 | 77 |
| 73 // InstNumberT is for holding an instruction number. Instruction | 78 // InstNumberT is for holding an instruction number. Instruction |
| 74 // numbers are used for representing Variable live ranges. | 79 // numbers are used for representing Variable live ranges. |
| 75 typedef int32_t InstNumberT; | 80 typedef int32_t InstNumberT; |
| 76 | 81 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 | 145 |
| 141 private: | 146 private: |
| 142 const llvm::TimeRecord Start; | 147 const llvm::TimeRecord Start; |
| 143 Timer(const Timer &) LLVM_DELETED_FUNCTION; | 148 Timer(const Timer &) LLVM_DELETED_FUNCTION; |
| 144 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; | 149 Timer &operator=(const Timer &) LLVM_DELETED_FUNCTION; |
| 145 }; | 150 }; |
| 146 | 151 |
| 147 } // end of namespace Ice | 152 } // end of namespace Ice |
| 148 | 153 |
| 149 #endif // SUBZERO_SRC_ICEDEFS_H | 154 #endif // SUBZERO_SRC_ICEDEFS_H |
| OLD | NEW |