mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Add and update reset() and doInitialization() methods to MC* and passes.
This enables reusing a PassManager instead of re-constructing it every time. llvm-svn: 217948
This commit is contained in:
parent
c4a433d332
commit
3f7cc6b0fe
@ -118,6 +118,12 @@ public:
|
||||
|
||||
StackMaps(AsmPrinter &AP);
|
||||
|
||||
void reset() {
|
||||
CSInfos.clear();
|
||||
ConstPool.clear();
|
||||
FnStackSize.clear();
|
||||
}
|
||||
|
||||
/// \brief Generate a stackmap record for a stackmap instruction.
|
||||
///
|
||||
/// MI must be a raw STACKMAP, not a PATCHPOINT.
|
||||
|
@ -41,6 +41,14 @@ public:
|
||||
|
||||
virtual ~MCELFStreamer();
|
||||
|
||||
/// state management
|
||||
void reset() override {
|
||||
LocalCommons.clear();
|
||||
BindingExplicitlySet.clear();
|
||||
SeenIdent = false;
|
||||
MCObjectStreamer::reset();
|
||||
}
|
||||
|
||||
/// @name MCStreamer Interface
|
||||
/// @{
|
||||
|
||||
|
@ -30,6 +30,12 @@ public:
|
||||
MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE,
|
||||
raw_ostream &OS);
|
||||
|
||||
/// state management
|
||||
void reset() override {
|
||||
CurSymbol = nullptr;
|
||||
MCObjectStreamer::reset();
|
||||
}
|
||||
|
||||
/// \name MCStreamer interface
|
||||
/// \{
|
||||
|
||||
|
@ -364,11 +364,16 @@ void MCAssembler::reset() {
|
||||
SymbolMap.clear();
|
||||
IndirectSymbols.clear();
|
||||
DataRegions.clear();
|
||||
LinkerOptions.clear();
|
||||
FileNames.clear();
|
||||
ThumbFuncs.clear();
|
||||
BundleAlignSize = 0;
|
||||
RelaxAll = false;
|
||||
NoExecStack = false;
|
||||
SubsectionsViaSymbols = false;
|
||||
ELFHeaderEFlags = 0;
|
||||
LOHContainer.reset();
|
||||
VersionMinInfo.Major = 0;
|
||||
|
||||
// reset objects owned by us
|
||||
getBackend().reset();
|
||||
|
@ -73,7 +73,10 @@ void MCContext::reset() {
|
||||
Symbols.clear();
|
||||
Allocator.Reset();
|
||||
Instances.clear();
|
||||
CompilationDir.clear();
|
||||
MainFileName.clear();
|
||||
MCDwarfLineTablesCUMap.clear();
|
||||
SectionStartEndSyms.clear();
|
||||
MCGenDwarfLabelEntries.clear();
|
||||
DwarfDebugFlags = StringRef();
|
||||
DwarfCompileUnitID = 0;
|
||||
|
@ -55,6 +55,12 @@ public:
|
||||
: MCObjectStreamer(Context, MAB, OS, Emitter),
|
||||
LabelSections(label) {}
|
||||
|
||||
/// state management
|
||||
void reset() override {
|
||||
HasSectionLabel.clear();
|
||||
MCObjectStreamer::reset();
|
||||
}
|
||||
|
||||
/// @name MCStreamer Interface
|
||||
/// @{
|
||||
|
||||
|
@ -48,6 +48,7 @@ MCStreamer::~MCStreamer() {
|
||||
}
|
||||
|
||||
void MCStreamer::reset() {
|
||||
DwarfFrameInfos.clear();
|
||||
for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
|
||||
delete WinFrameInfos[i];
|
||||
WinFrameInfos.clear();
|
||||
|
@ -116,6 +116,12 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
|
||||
/// \brief Return the symbol for the specified constant pool entry.
|
||||
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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user