From: Chris Lattner Date: Fri, 25 Apr 2003 06:06:43 +0000 (+0000) Subject: Whoops, 32 bit targets have _4_ byte pointers, not _32_ byte pointers! X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=dd7253cc9ff640ad193dcbc97683494e559a5b15;p=oota-llvm.git Whoops, 32 bit targets have _4_ byte pointers, not _32_ byte pointers! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5937 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index a0a3b82d24f..923031c4005 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -104,6 +104,8 @@ TargetData::TargetData(const std::string &TargetName, PointerSize = PtrSize; PointerAlignment = PtrAl; DoubleAlignment = DoubleAl; + assert(DoubleAlignment == PtrAl && + "Double alignment and pointer alignment agree for now!"); FloatAlignment = FloatAl; LongAlignment = LongAl; IntAlignment = IntAl; @@ -118,9 +120,9 @@ TargetData::TargetData(const std::string &ToolName, const Module *M) LittleEndian = M->isLittleEndian(); SubWordDataSize = 1; IntegerRegSize = 8; - PointerSize = M->has32BitPointers() ? 32 : 64; + PointerSize = M->has32BitPointers() ? 4 : 8; PointerAlignment = PointerSize; - DoubleAlignment = 8; + DoubleAlignment = PointerSize; FloatAlignment = 4; LongAlignment = 8; IntAlignment = 4;