From fc5aa1c93ca5523980516fa55f0ce85545171303 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 24 Aug 2003 13:46:37 +0000 Subject: [PATCH] Allow modules to have 'any' pointer size and endianness. llvm-svn: 8117 --- llvm/include/llvm/Module.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/Module.h b/llvm/include/llvm/Module.h index 3d7d65243a36..28e8b868c83f 100644 --- a/llvm/include/llvm/Module.h +++ b/llvm/include/llvm/Module.h @@ -33,8 +33,7 @@ template<> struct ilist_traits static iplist &getList(Module *M); }; -class Module : public Annotable { -public: +struct Module : public Annotable { typedef iplist GlobalListType; typedef iplist FunctionListType; @@ -50,8 +49,8 @@ public: typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; - enum Endianness { LittleEndian, BigEndian }; - enum PointerSize { Pointer32, Pointer64 }; + enum Endianness { AnyEndianness, LittleEndian, BigEndian }; + enum PointerSize { AnyPointerSize, Pointer32, Pointer64 }; private: GlobalListType GlobalList; // The Global Variables in the module @@ -79,14 +78,10 @@ public: const std::string &getModuleIdentifier() const { return ModuleID; } /// Target endian information... - bool isLittleEndian() const { return Endian == LittleEndian; } - bool isBigEndian() const { return Endian == BigEndian; } Endianness getEndianness() const { return Endian; } void setEndianness(Endianness E) { Endian = E; } /// Target Pointer Size information... - bool has32BitPointers() const { return PtrSize == Pointer32; } - bool has64BitPointers() const { return PtrSize == Pointer64; } PointerSize getPointerSize() const { return PtrSize; } void setPointerSize(PointerSize PS) { PtrSize = PS; }