diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-07 09:23:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-07 09:23:04 +0000 |
commit | 2e07494170d5f56805b7a6c1b70808fc2a157052 (patch) | |
tree | 19d8211b5ff52407b9324958afeeb0d094bffa7d /lib/Target/TargetData.cpp | |
parent | 8f9b0f6e881a63875e7c41319eca31751588799a (diff) | |
download | external_llvm-2e07494170d5f56805b7a6c1b70808fc2a157052.zip external_llvm-2e07494170d5f56805b7a6c1b70808fc2a157052.tar.gz external_llvm-2e07494170d5f56805b7a6c1b70808fc2a157052.tar.bz2 |
more cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r-- | lib/Target/TargetData.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
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(); } |