From 030574fd357b23ceb8def7e7622749b17bd61b16 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 24 Aug 2003 13:49:22 +0000 Subject: [PATCH] Add support for 'any' pointer size and endianness git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8120 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 4a1ba70342d..22efcc598a3 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -112,8 +112,8 @@ TargetData::TargetData(const std::string &ToolName, const Module *M) : AID(AnnotationManager::getID("TargetData::" + ToolName)) { AnnotationManager::registerAnnotationFactory(AID, TypeAnFactory, this); - LittleEndian = M->isLittleEndian(); - PointerSize = M->has32BitPointers() ? 4 : 8; + LittleEndian = M->getEndianness() != Module::BigEndian; + PointerSize = M->getPointerSize() != Module::Pointer64 ? 4 : 8; PointerAlignment = PointerSize; DoubleAlignment = PointerSize; FloatAlignment = 4;