This add a reset method for WinCOFFObjectWriter, like other MC* classes.

llvm-svn: 217907
This commit is contained in:
Yaron Keren 2014-09-16 21:31:04 +00:00
parent 53a80d3a46
commit cca43c15b5
1 changed files with 16 additions and 0 deletions

View File

@ -113,6 +113,11 @@ public:
StringTable();
size_t size() const;
size_t insert(StringRef String);
void clear() {
Map.clear();
Data.resize(4);
update_length();
}
};
class WinCOFFObjectWriter : public MCObjectWriter {
@ -139,6 +144,17 @@ public:
bool UseBigObj;
WinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW, raw_ostream &OS);
void reset() override {
memset(&Header, 0, sizeof(Header));
Header.Machine = TargetObjectWriter->getMachine();
Sections.clear();
Symbols.clear();
Strings.clear();
SectionMap.clear();
SymbolMap.clear();
MCObjectWriter::reset();
}
COFFSymbol *createSymbol(StringRef Name);
COFFSymbol *GetOrCreateCOFFSymbol(const MCSymbol * Symbol);