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 <evan.cheng@apple.com> llvm-svn: 169553
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user