From 3015c4c7d4f00326d3a9d88c38a6ab8a158f3e93 Mon Sep 17 00:00:00 2001 From: Ken Dyck Date: Thu, 7 Apr 2011 00:59:42 +0000 Subject: [PATCH] [Reapply r128771. It wasn't the source of the issues Devang saw with debug info.] Use CharUnits for the offset type in the ClassNamesAndOffsets map in dumpLayout(). No change in functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129046 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGVTables.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index ec3f420386..d5eab28e74 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -2173,13 +2173,13 @@ void VTableBuilder::dumpLayout(llvm::raw_ostream& Out) { // We store the virtual base class names and their offsets in a map to get // a stable order. - std::map ClassNamesAndOffsets; + std::map ClassNamesAndOffsets; for (VBaseOffsetOffsetsMapTy::const_iterator I = VBaseOffsetOffsets.begin(), E = VBaseOffsetOffsets.end(); I != E; ++I) { std::string ClassName = I->first->getQualifiedNameAsString(); CharUnits OffsetOffset = I->second; ClassNamesAndOffsets.insert( - std::make_pair(ClassName, OffsetOffset.getQuantity())); + std::make_pair(ClassName, OffsetOffset)); } Out << "Virtual base offset offsets for '"; @@ -2187,10 +2187,10 @@ void VTableBuilder::dumpLayout(llvm::raw_ostream& Out) { Out << ClassNamesAndOffsets.size(); Out << (ClassNamesAndOffsets.size() == 1 ? " entry" : " entries") << ").\n"; - for (std::map::const_iterator I = + for (std::map::const_iterator I = ClassNamesAndOffsets.begin(), E = ClassNamesAndOffsets.end(); I != E; ++I) - Out << " " << I->first << " | " << I->second << '\n'; + Out << " " << I->first << " | " << I->second.getQuantity() << '\n'; Out << "\n"; } -- 2.40.0