[llvm-commits] [llvm] r169462 - in /llvm/trunk: include/llvm/MC/MCContext.h lib/CodeGen/MachineModuleInfo.cpp lib/MC/MCContext.cpp

NAKAMURA Takumi geek4civic at gmail.com
Wed Dec 5 18:00:13 PST 2012


Author: chapuni
Date: Wed Dec  5 20:00:13 2012
New Revision: 169462

URL: http://llvm.org/viewvc/llvm-project?rev=169462&view=rev
Log:
Revert r169456, "change MCContext to work on the doInitialization/doFinalization model"

It broke many builders.

Modified:
    llvm/trunk/include/llvm/MC/MCContext.h
    llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
    llvm/trunk/lib/MC/MCContext.cpp

Modified: llvm/trunk/include/llvm/MC/MCContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCContext.h?rev=169462&r1=169461&r2=169462&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCContext.h (original)
+++ llvm/trunk/include/llvm/MC/MCContext.h Wed Dec  5 20:00:13 2012
@@ -154,17 +154,6 @@
 
     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
     /// @{
 

Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=169462&r1=169461&r2=169462&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Wed Dec  5 20:00:13 2012
@@ -270,9 +270,6 @@
 }
 
 bool MachineModuleInfo::doInitialization(Module &M) {
-  
-  Context.doInitialization();
-
   ObjFileMMI = 0;
   CompactUnwindEncoding = 0;
   CurCallSite = 0;
@@ -294,8 +291,6 @@
   delete AddrLabelSymbols;
   AddrLabelSymbols = 0;
 
-  Context.doFinalization();
-
   return false;
 }
 

Modified: llvm/trunk/lib/MC/MCContext.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCContext.cpp?rev=169462&r1=169461&r2=169462&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCContext.cpp (original)
+++ llvm/trunk/lib/MC/MCContext.cpp Wed Dec  5 20:00:13 2012
@@ -44,48 +44,23 @@
   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;
 }
 
 //===----------------------------------------------------------------------===//





More information about the llvm-commits mailing list