Support new 'any' support for pointer size and endianness

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8119 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-08-24 13:48:48 +00:00
parent d445c6b64a
commit eb5d3a1526
2 changed files with 12 additions and 4 deletions

View File

@ -553,9 +553,17 @@ void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType,
void AssemblyWriter::printModule(const Module *M) {
Out << "target endian = " << (M->isLittleEndian() ? "little" : "big") << "\n";
Out << "target pointersize = " << (M->has32BitPointers() ? 32 : 64) << "\n";
switch (M->getEndianness()) {
case Module::LittleEndian: Out << "target endian = little\n"; break;
case Module::BigEndian: Out << "target endian = big\n"; break;
case Module::AnyEndianness: break;
}
switch (M->getPointerSize()) {
case Module::Pointer32: Out << "target pointersize = 32\n"; break;
case Module::Pointer64: Out << "target pointersize = 64\n"; break;
case Module::AnyPointerSize: break;
}
// Loop over the symbol table, emitting all named constants...
printSymbolTable(M->getSymbolTable());

View File

@ -53,7 +53,7 @@ struct GlobalValueRefMap {
Module::Module(const std::string &MID)
: ModuleID(MID), Endian(BigEndian), PtrSize(Pointer64) {
: ModuleID(MID), Endian(AnyEndianness), PtrSize(AnyPointerSize) {
FunctionList.setItemParent(this);
FunctionList.setParent(this);
GlobalList.setItemParent(this);