summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-08 21:26:26 +0000
committerChris Lattner <sabre@nondot.org>2010-04-08 21:26:26 +0000
commit74aae4726a66733c5872588287535a984f9a94c7 (patch)
tree881707df3911fb308e40f805a973d89773ec36d3 /lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent2d16a67b9466102ae479f0027cedc1a20dd493d1 (diff)
downloadllvm-74aae4726a66733c5872588287535a984f9a94c7.tar.gz
llvm-74aae4726a66733c5872588287535a984f9a94c7.tar.bz2
llvm-74aae4726a66733c5872588287535a984f9a94c7.tar.xz
move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 8381ebb59c..427338b757 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -38,34 +38,16 @@ using namespace dwarf;
//===----------------------------------------------------------------------===//
// ELF
//===----------------------------------------------------------------------===//
-typedef StringMap<const MCSectionELF*> ELFUniqueMapTy;
-
-TargetLoweringObjectFileELF::~TargetLoweringObjectFileELF() {
- // If we have the section uniquing map, free it.
- delete (ELFUniqueMapTy*)UniquingMap;
-}
const MCSection *TargetLoweringObjectFileELF::
getELFSection(StringRef Section, unsigned Type, unsigned Flags,
SectionKind Kind, bool IsExplicit) const {
- if (UniquingMap == 0)
- UniquingMap = new ELFUniqueMapTy();
- ELFUniqueMapTy &Map = *(ELFUniqueMapTy*)UniquingMap;
+ return getContext().getELFSection(Section, Type, Flags, Kind, IsExplicit);
- // Do the lookup, if we have a hit, return it.
- StringMapEntry<const MCSectionELF*> &Entry = Map.GetOrCreateValue(Section);
- if (Entry.getValue()) return Entry.getValue();
-
- MCSectionELF *Result = MCSectionELF::Create(Entry.getKey(), Type, Flags, Kind,
- IsExplicit, getContext());
- Entry.setValue(Result);
- return Result;
}
void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
- if (UniquingMap != 0)
- ((ELFUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
BSSSection =