From 5399d2502acaf96fe8420e61913e77f0b23650ff Mon Sep 17 00:00:00 2001 From: Pedro Artigas Date: Wed, 12 Dec 2012 22:59:46 +0000 Subject: Make the MCStreamer have a reset method and call that after finalization of the asm printer, also changed MCContext to a single reset only method for simplicity as requested on the list git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170041 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCAssembler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/MC/MCAssembler.cpp') diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp index c47299c..8ca849b 100644 --- a/lib/MC/MCAssembler.cpp +++ b/lib/MC/MCAssembler.cpp @@ -221,6 +221,19 @@ MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_, MCAssembler::~MCAssembler() { } +void MCAssembler::reset() { + Sections.clear(); + Symbols.clear(); + SectionMap.clear(); + SymbolMap.clear(); + IndirectSymbols.clear(); + DataRegions.clear(); + ThumbFuncs.clear(); + RelaxAll = false; + NoExecStack = false; + SubsectionsViaSymbols = false; +} + bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const { // Non-temporary labels should always be visible to the linker. if (!Symbol.isTemporary()) -- cgit v1.1