diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-12-06 02:00:13 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2012-12-06 02:00:13 +0000 |
commit | d985d76040100c733fc25dee193640cf45a2bacb (patch) | |
tree | 5bdd72fba8f71318b6bd188f42c6841683b89f32 | |
parent | eab6cc98d7813e3145c8f67958411f9aa996ac81 (diff) | |
download | bcm5719-llvm-d985d76040100c733fc25dee193640cf45a2bacb.tar.gz bcm5719-llvm-d985d76040100c733fc25dee193640cf45a2bacb.zip |
Revert r169456, "change MCContext to work on the doInitialization/doFinalization model"
It broke many builders.
llvm-svn: 169462
-rw-r--r-- | llvm/include/llvm/MC/MCContext.h | 11 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineModuleInfo.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/MC/MCContext.cpp | 37 |
3 files changed, 6 insertions, 47 deletions
diff --git a/llvm/include/llvm/MC/MCContext.h b/llvm/include/llvm/MC/MCContext.h index 766b90a1b1c..78870d9633e 100644 --- a/llvm/include/llvm/MC/MCContext.h +++ b/llvm/include/llvm/MC/MCContext.h @@ -154,17 +154,6 @@ namespace llvm { void setAllowTemporaryLabels(bool Value) { AllowTemporaryLabels = Value; } - /// @name Module Lifetime Management - /// @{ - - /// doInitialization - prepare to process a new module - void doInitialization(); - - /// doFinalization - clean up state from the current module - void doFinalization(); - - /// @} - /// @name Symbol Management /// @{ diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index c5fd4a17c27..4fbbb05ee6b 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -270,9 +270,6 @@ MachineModuleInfo::~MachineModuleInfo() { } bool MachineModuleInfo::doInitialization(Module &M) { - - Context.doInitialization(); - ObjFileMMI = 0; CompactUnwindEncoding = 0; CurCallSite = 0; @@ -294,8 +291,6 @@ bool MachineModuleInfo::doFinalization(Module &M) { delete AddrLabelSymbols; AddrLabelSymbols = 0; - Context.doFinalization(); - return false; } diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index cd95b1161a8..dd9d956088a 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/lib/MC/MCContext.cpp @@ -44,48 +44,23 @@ MCContext::MCContext(const MCAsmInfo &mai, const MCRegisterInfo &mri, SecureLogFile = getenv("AS_SECURE_LOG_FILE"); SecureLog = 0; SecureLogUsed = false; -} - -MCContext::~MCContext() { - // NOTE: The symbols are all allocated out of a bump pointer allocator, - // we don't need to free them here. - - // If the stream for the .secure_log_unique directive was created free it. - delete (raw_ostream*)SecureLog; -} - -//===----------------------------------------------------------------------===// -// Module Lifetime Management -//===----------------------------------------------------------------------===// -void MCContext::doInitialization() { - NextUniqueID = 0; - AllowTemporaryLabels = true; DwarfLocSeen = false; GenDwarfForAssembly = false; GenDwarfFileNumber = 0; } -void MCContext::doFinalization() { - UsedNames.clear(); - Symbols.clear(); - Allocator.Reset(); - Instances.clear(); - MCDwarfFiles.clear(); - MCDwarfDirs.clear(); - MCGenDwarfLabelEntries.clear(); - DwarfDebugFlags = StringRef(); - MCLineSections.clear(); - MCLineSectionOrder.clear(); - CurrentDwarfLoc = MCDwarfLoc(0,0,0,DWARF2_FLAG_IS_STMT,0,0); +MCContext::~MCContext() { + // NOTE: The symbols are all allocated out of a bump pointer allocator, + // we don't need to free them here. // If we have the MachO uniquing map, free it. delete (MachOUniqueMapTy*)MachOUniquingMap; delete (ELFUniqueMapTy*)ELFUniquingMap; delete (COFFUniqueMapTy*)COFFUniquingMap; - MachOUniquingMap = 0; - ELFUniquingMap = 0; - COFFUniquingMap = 0; + + // If the stream for the .secure_log_unique directive was created free it. + delete (raw_ostream*)SecureLog; } //===----------------------------------------------------------------------===// |