[llvm-commits] [llvm] r79253 - /llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Aug 17 10:05:44 PDT 2009
Author: d0k
Date: Mon Aug 17 12:05:44 2009
New Revision: 79253
URL: http://llvm.org/viewvc/llvm-project?rev=79253&view=rev
Log:
Clear the uniquing table when initializing TLOF to avoid a crash when the TLOF is reinitialized with a different MCContext.
Modified:
llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
Modified: llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp?rev=79253&r1=79252&r2=79253&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/TargetLoweringObjectFile.cpp Mon Aug 17 12:05:44 2009
@@ -304,6 +304,8 @@
void TargetLoweringObjectFileELF::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
+ if (UniquingMap != 0)
+ ((ELFUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
BSSSection =
@@ -666,6 +668,8 @@
void TargetLoweringObjectFileMachO::Initialize(MCContext &Ctx,
const TargetMachine &TM) {
+ if (UniquingMap != 0)
+ ((MachOUniqueMapTy*)UniquingMap)->clear();
TargetLoweringObjectFile::Initialize(Ctx, TM);
TextSection // .text
@@ -946,6 +950,8 @@
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());
More information about the llvm-commits
mailing list