mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170227 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a5ed031fbc
commit
99cbdde619
@ -41,6 +41,9 @@ protected: // Can only create subclasses.
|
||||
public:
|
||||
virtual ~MCAsmBackend();
|
||||
|
||||
/// lifetime management
|
||||
virtual void reset() { }
|
||||
|
||||
/// createObjectWriter - Create a new MCObjectWriter instance for use by the
|
||||
/// assembler backend to emit the final object file.
|
||||
virtual MCObjectWriter *createObjectWriter(raw_ostream &OS) const = 0;
|
||||
|
@ -29,6 +29,9 @@ protected: // Can only create subclasses.
|
||||
public:
|
||||
virtual ~MCCodeEmitter();
|
||||
|
||||
/// Lifetime management
|
||||
virtual void reset() { }
|
||||
|
||||
/// EncodeInstruction - Encode the given \p Inst to bytes on the output
|
||||
/// stream \p OS.
|
||||
virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS,
|
||||
|
@ -45,6 +45,13 @@ protected:
|
||||
public:
|
||||
virtual ~MCMachObjectTargetWriter();
|
||||
|
||||
/// @name Lifetime Management
|
||||
/// @{
|
||||
|
||||
virtual void reset() {};
|
||||
|
||||
/// @}
|
||||
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
@ -111,6 +118,13 @@ public:
|
||||
: MCObjectWriter(_OS, _IsLittleEndian), TargetObjectWriter(MOTW) {
|
||||
}
|
||||
|
||||
/// @name Lifetime management Methods
|
||||
/// @{
|
||||
|
||||
virtual void reset();
|
||||
|
||||
/// @}
|
||||
|
||||
/// @name Utility Methods
|
||||
/// @{
|
||||
|
||||
|
@ -51,6 +51,9 @@ protected: // Can only create subclasses.
|
||||
public:
|
||||
virtual ~MCObjectWriter();
|
||||
|
||||
/// lifetime management
|
||||
virtual void reset() { }
|
||||
|
||||
bool isLittleEndian() const { return IsLittleEndian; }
|
||||
|
||||
raw_ostream &getStream() { return OS; }
|
||||
|
@ -232,6 +232,11 @@ void MCAssembler::reset() {
|
||||
RelaxAll = false;
|
||||
NoExecStack = false;
|
||||
SubsectionsViaSymbols = false;
|
||||
|
||||
// reset objects owned by us
|
||||
getBackend().reset();
|
||||
getEmitter().reset();
|
||||
getWriter().reset();
|
||||
}
|
||||
|
||||
bool MCAssembler::isSymbolLinkerVisible(const MCSymbol &Symbol) const {
|
||||
|
@ -45,7 +45,8 @@ MCObjectStreamer::~MCObjectStreamer() {
|
||||
}
|
||||
|
||||
void MCObjectStreamer::reset() {
|
||||
Assembler->reset();
|
||||
if (Assembler)
|
||||
Assembler->reset();
|
||||
MCStreamer::reset();
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,16 @@
|
||||
using namespace llvm;
|
||||
using namespace llvm::object;
|
||||
|
||||
void MachObjectWriter::reset() {
|
||||
Relocations.clear();
|
||||
IndirectSymBase.clear();
|
||||
StringTable.clear();
|
||||
LocalSymbolData.clear();
|
||||
ExternalSymbolData.clear();
|
||||
UndefinedSymbolData.clear();
|
||||
MCObjectWriter::reset();
|
||||
}
|
||||
|
||||
bool MachObjectWriter::
|
||||
doesSymbolRequireExternRelocation(const MCSymbolData *SD) {
|
||||
// Undefined symbols are always extern.
|
||||
|
Loading…
x
Reference in New Issue
Block a user