aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetLoweringObjectFile.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-08-17 17:05:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-08-17 17:05:44 +0000
commit76d5ccf6afd5ae253cf3d5c2cf6acc712643d8cb (patch)
tree8a24e3288b630ff6ee1da7f99bb65e1ef5d256fd /lib/Target/TargetLoweringObjectFile.cpp
parenta10e89f372220a579faac02a1e4bdb0393b878a7 (diff)
downloadexternal_llvm-76d5ccf6afd5ae253cf3d5c2cf6acc712643d8cb.zip
external_llvm-76d5ccf6afd5ae253cf3d5c2cf6acc712643d8cb.tar.gz
external_llvm-76d5ccf6afd5ae253cf3d5c2cf6acc712643d8cb.tar.bz2
Clear the uniquing table when initializing TLOF to avoid a crash when the TLOF is reinitialized with a different MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79253 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r--lib/Target/TargetLoweringObjectFile.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp
index 8e1351b..ff0180b 100644
--- a/lib/Target/TargetLoweringObjectFile.cpp
+++ b/lib/Target/TargetLoweringObjectFile.cpp
@@ -304,6 +304,8 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
+ if (UniquingMap != 0)
+ ((ELFUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
BSSSection =
@@ -666,6 +668,8 @@ getMachOSection(const StringRef &Segment, const StringRef &Section,
void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
+ if (UniquingMap != 0)
+ ((MachOUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
TextSection // .text
@@ -946,6 +950,8 @@ getCOFFSection(const char *Name, bool isDirective, SectionKind Kind) const {
void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
+ if (UniquingMap != 0)
+ ((COFFUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
TextSection = getCOFFSection("\t.text", true, SectionKind::getText());
DataSection = getCOFFSection("\t.data", true, SectionKind::getDataRel());