From 2e07494170d5f56805b7a6c1b70808fc2a157052 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 7 Nov 2009 09:23:04 +0000 Subject: more cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86369 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/TargetData.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'lib/Target') diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp index 664cbb2..06c493f 100644 --- a/lib/Target/TargetData.cpp +++ b/lib/Target/TargetData.cpp @@ -258,6 +258,15 @@ void TargetData::init(StringRef Desc) { } } +/// Default ctor. +/// +/// @note This has to exist, because this is a pass, but it should never be +/// used. +TargetData::TargetData() : ImmutablePass(&ID) { + llvm_report_error("Bad TargetData ctor used. " + "Tool did not specify a TargetData to use?"); +} + TargetData::TargetData(const Module *M) : ImmutablePass(&ID) { init(M->getDataLayout()); @@ -405,10 +414,11 @@ std::string TargetData::getStringRepresentation() const { OS << (LittleEndian ? "e" : "E") << "-p:" << PointerMemSize*8 << ':' << PointerABIAlign*8 << ':' << PointerPrefAlign*8; - for (align_const_iterator I = Alignments.begin(), E = Alignments.end(); - I != E; ++I) - OS << '-' << (char)I->AlignType << I->TypeBitWidth << ':' - << I->ABIAlign*8 << ':' << I->PrefAlign*8; + for (unsigned i = 0, e = Alignments.size(); i != e; ++i) { + const TargetAlignElem &AI = Alignments[i]; + OS << '-' << (char)AI.AlignType << AI.TypeBitWidth << ':' + << AI.ABIAlign*8 << ':' << AI.PrefAlign*8; + } return OS.str(); } -- cgit v1.1