From 873a1dd7d679ac9a9a92a93a4d2bbb157878efb4 Mon Sep 17 00:00:00 2001 From: Pedro Artigas Date: Thu, 6 Dec 2012 22:12:44 +0000 Subject: fixed valgrind issues of prior commit, this change applies r169456 changes back to the tree with fixes. on darwin no valgrind issues exist in the tests that used to fail. original change description: change MCContext to work on the doInitialization/doFinalization model reviewed by Evan Cheng git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169553 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineModuleInfo.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/MachineModuleInfo.cpp') diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index 4fbbb05ee6..ad88c51118 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -253,7 +253,7 @@ void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) { MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI, const MCRegisterInfo &MRI, const MCObjectFileInfo *MOFI) - : ImmutablePass(ID), Context(MAI, MRI, MOFI) { + : ImmutablePass(ID), Context(MAI, MRI, MOFI, 0, false) { initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry()); } @@ -270,6 +270,9 @@ MachineModuleInfo::~MachineModuleInfo() { } bool MachineModuleInfo::doInitialization(Module &M) { + + Context.doInitialization(); + ObjFileMMI = 0; CompactUnwindEncoding = 0; CurCallSite = 0; @@ -291,6 +294,8 @@ bool MachineModuleInfo::doFinalization(Module &M) { delete AddrLabelSymbols; AddrLabelSymbols = 0; + Context.doFinalization(); + return false; } -- cgit v1.2.3-18-g5258