Revert r169456, "change MCContext to work on the doInitialization/doFinalization...
[oota-llvm.git] / lib / MC / MCContext.cpp
index cd95b1161a892977acc6a5234b878fd9c48e408c..dd9d956088a44480c7546c08b92f251384b19d2e 100644 (file)
@@ -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;
 }
 
 //===----------------------------------------------------------------------===//