aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/TargetData.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index e950e56f56..77bb01ebed 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -189,8 +189,8 @@ void TargetData::init(const std::string &TargetDescription) {
}
}
- // Unless explicitly specified, the alignments for longs and doubles is capped by
- // pointer size.
+ // Unless explicitly specified, the alignments for longs and doubles is
+ // capped by pointer size.
if (LongABIAlignment == 0)
LongABIAlignment = LongPrefAlignment = PointerMemSize;
if (DoubleABIAlignment == 0)
@@ -198,25 +198,7 @@ void TargetData::init(const std::string &TargetDescription) {
}
TargetData::TargetData(const Module *M) {
- LittleEndian = M->getEndianness() != Module::BigEndian;
- PointerMemSize = M->getPointerSize() != Module::Pointer64 ? 4 : 8;
- PointerABIAlignment = PointerMemSize;
- DoubleABIAlignment = PointerMemSize;
- FloatABIAlignment = 4;
- LongABIAlignment = PointerMemSize;
- IntABIAlignment = 4;
- ShortABIAlignment = 2;
- ByteABIAlignment = 1;
- BoolABIAlignment = 1;
- BoolPrefAlignment = BoolABIAlignment;
- BytePrefAlignment = ByteABIAlignment;
- ShortPrefAlignment = ShortABIAlignment;
- IntPrefAlignment = IntABIAlignment;
- LongPrefAlignment = LongABIAlignment;
- FloatPrefAlignment = FloatABIAlignment;
- DoublePrefAlignment = DoubleABIAlignment;
- PointerPrefAlignment = PointerABIAlignment;
- AggMinPrefAlignment = 0;
+ init(M->getDataLayout());
}
/// Layouts - The lazy cache of structure layout information maintained by