mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
Add and update reset() and doInitialization() methods to MC* and passes.
This enables reusing a PassManager instead of re-constructing it every time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4378ff024d
commit
c63035aa56
@ -118,6 +118,12 @@ public:
|
|||||||
|
|
||||||
StackMaps(AsmPrinter &AP);
|
StackMaps(AsmPrinter &AP);
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
CSInfos.clear();
|
||||||
|
ConstPool.clear();
|
||||||
|
FnStackSize.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Generate a stackmap record for a stackmap instruction.
|
/// \brief Generate a stackmap record for a stackmap instruction.
|
||||||
///
|
///
|
||||||
/// MI must be a raw STACKMAP, not a PATCHPOINT.
|
/// MI must be a raw STACKMAP, not a PATCHPOINT.
|
||||||
|
@ -41,6 +41,14 @@ public:
|
|||||||
|
|
||||||
virtual ~MCELFStreamer();
|
virtual ~MCELFStreamer();
|
||||||
|
|
||||||
|
/// state management
|
||||||
|
void reset() override {
|
||||||
|
LocalCommons.clear();
|
||||||
|
BindingExplicitlySet.clear();
|
||||||
|
SeenIdent = false;
|
||||||
|
MCObjectStreamer::reset();
|
||||||
|
}
|
||||||
|
|
||||||
/// @name MCStreamer Interface
|
/// @name MCStreamer Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
@ -30,6 +30,12 @@ public:
|
|||||||
MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE,
|
MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE,
|
||||||
raw_ostream &OS);
|
raw_ostream &OS);
|
||||||
|
|
||||||
|
/// state management
|
||||||
|
void reset() override {
|
||||||
|
CurSymbol = nullptr;
|
||||||
|
MCObjectStreamer::reset();
|
||||||
|
}
|
||||||
|
|
||||||
/// \name MCStreamer interface
|
/// \name MCStreamer interface
|
||||||
/// \{
|
/// \{
|
||||||
|
|
||||||
|
@ -364,11 +364,16 @@ void MCAssembler::reset() {
|
|||||||
SymbolMap.clear();
|
SymbolMap.clear();
|
||||||
IndirectSymbols.clear();
|
IndirectSymbols.clear();
|
||||||
DataRegions.clear();
|
DataRegions.clear();
|
||||||
|
LinkerOptions.clear();
|
||||||
|
FileNames.clear();
|
||||||
ThumbFuncs.clear();
|
ThumbFuncs.clear();
|
||||||
|
BundleAlignSize = 0;
|
||||||
RelaxAll = false;
|
RelaxAll = false;
|
||||||
NoExecStack = false;
|
NoExecStack = false;
|
||||||
SubsectionsViaSymbols = false;
|
SubsectionsViaSymbols = false;
|
||||||
ELFHeaderEFlags = 0;
|
ELFHeaderEFlags = 0;
|
||||||
|
LOHContainer.reset();
|
||||||
|
VersionMinInfo.Major = 0;
|
||||||
|
|
||||||
// reset objects owned by us
|
// reset objects owned by us
|
||||||
getBackend().reset();
|
getBackend().reset();
|
||||||
|
@ -73,7 +73,10 @@ void MCContext::reset() {
|
|||||||
Symbols.clear();
|
Symbols.clear();
|
||||||
Allocator.Reset();
|
Allocator.Reset();
|
||||||
Instances.clear();
|
Instances.clear();
|
||||||
|
CompilationDir.clear();
|
||||||
|
MainFileName.clear();
|
||||||
MCDwarfLineTablesCUMap.clear();
|
MCDwarfLineTablesCUMap.clear();
|
||||||
|
SectionStartEndSyms.clear();
|
||||||
MCGenDwarfLabelEntries.clear();
|
MCGenDwarfLabelEntries.clear();
|
||||||
DwarfDebugFlags = StringRef();
|
DwarfDebugFlags = StringRef();
|
||||||
DwarfCompileUnitID = 0;
|
DwarfCompileUnitID = 0;
|
||||||
|
@ -55,6 +55,12 @@ public:
|
|||||||
: MCObjectStreamer(Context, MAB, OS, Emitter),
|
: MCObjectStreamer(Context, MAB, OS, Emitter),
|
||||||
LabelSections(label) {}
|
LabelSections(label) {}
|
||||||
|
|
||||||
|
/// state management
|
||||||
|
void reset() override {
|
||||||
|
HasSectionLabel.clear();
|
||||||
|
MCObjectStreamer::reset();
|
||||||
|
}
|
||||||
|
|
||||||
/// @name MCStreamer Interface
|
/// @name MCStreamer Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ MCStreamer::~MCStreamer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MCStreamer::reset() {
|
void MCStreamer::reset() {
|
||||||
|
DwarfFrameInfos.clear();
|
||||||
for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
|
for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
|
||||||
delete WinFrameInfos[i];
|
delete WinFrameInfos[i];
|
||||||
WinFrameInfos.clear();
|
WinFrameInfos.clear();
|
||||||
|
@ -116,6 +116,12 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
|
|||||||
/// \brief Return the symbol for the specified constant pool entry.
|
/// \brief Return the symbol for the specified constant pool entry.
|
||||||
MCSymbol *GetCPISymbol(unsigned CPID) const override;
|
MCSymbol *GetCPISymbol(unsigned CPID) const override;
|
||||||
|
|
||||||
|
bool doInitialization(Module &M) override {
|
||||||
|
SMShadowTracker.reset(0);
|
||||||
|
SM.reset();
|
||||||
|
return AsmPrinter::doInitialization(M);
|
||||||
|
}
|
||||||
|
|
||||||
bool runOnMachineFunction(MachineFunction &F) override;
|
bool runOnMachineFunction(MachineFunction &F) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user