diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-08 21:26:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-08 21:26:26 +0000 |
commit | 5418dd5fdaa218e6f83b289d0a7bbeaa908eddc1 (patch) | |
tree | e4b7466edc74fc90e1febcab62c776100ed6b6ce /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 75f82345c4a4411a1d59340def27a305959255e3 (diff) | |
download | bcm5719-llvm-5418dd5fdaa218e6f83b289d0a7bbeaa908eddc1.tar.gz bcm5719-llvm-5418dd5fdaa218e6f83b289d0a7bbeaa908eddc1.zip |
move elf section uniquing to MCContext. Along the way
merge XCore's section into MCSectionELF
llvm-svn: 100812
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 8381ebb59c9..427338b7579 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/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 = |