llvm.org GIT mirror llvm / a7a35a8
Allow modules to have 'any' pointer size and endianness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8117 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 3 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
3232 static iplist &getList(Module *M);
3333 };
3434
35 class Module : public Annotable {
36 public:
35 struct Module : public Annotable {
3736 typedef iplist GlobalListType;
3837 typedef iplist FunctionListType;
3938
4948 typedef std::reverse_iterator reverse_iterator;
5049 typedef std::reverse_iterator const_reverse_iterator;
5150
52 enum Endianness { LittleEndian, BigEndian };
53 enum PointerSize { Pointer32, Pointer64 };
51 enum Endianness { AnyEndianness, LittleEndian, BigEndian };
52 enum PointerSize { AnyPointerSize, Pointer32, Pointer64 };
5453
5554 private:
5655 GlobalListType GlobalList; // The Global Variables in the module
7877 const std::string &getModuleIdentifier() const { return ModuleID; }
7978
8079 /// Target endian information...
81 bool isLittleEndian() const { return Endian == LittleEndian; }
82 bool isBigEndian() const { return Endian == BigEndian; }
8380 Endianness getEndianness() const { return Endian; }
8481 void setEndianness(Endianness E) { Endian = E; }
8582
8683 /// Target Pointer Size information...
87 bool has32BitPointers() const { return PtrSize == Pointer32; }
88 bool has64BitPointers() const { return PtrSize == Pointer64; }
8984 PointerSize getPointerSize() const { return PtrSize; }
9085 void setPointerSize(PointerSize PS) { PtrSize = PS; }
9186