mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-15 16:38:41 +00:00
Use the actual .text section, it is less code than building a dummy one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c5b61da308
commit
61e4d529fe
@ -534,31 +534,10 @@ LTOModule::addPotentialUndefinedSymbol(const GlobalValue *decl, bool isFunc) {
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Common infrastructure is allowed to assume the existence of a current
|
|
||||||
// section. Since this streamer doesn't need one itself, we just provide
|
|
||||||
// a dummy one.
|
|
||||||
class DummySection : public MCSection {
|
|
||||||
public:
|
|
||||||
DummySection() : MCSection(SV_ELF, SectionKind::getText()) {}
|
|
||||||
|
|
||||||
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS,
|
|
||||||
const MCExpr *Subsection) const {}
|
|
||||||
|
|
||||||
virtual std::string getLabelBeginName() const { return ""; }
|
|
||||||
|
|
||||||
virtual std::string getLabelEndName() const { return ""; }
|
|
||||||
|
|
||||||
virtual bool UseCodeAlign() const { return false; }
|
|
||||||
|
|
||||||
virtual bool isVirtualSection() const { return false; }
|
|
||||||
};
|
|
||||||
|
|
||||||
class RecordStreamer : public MCStreamer {
|
class RecordStreamer : public MCStreamer {
|
||||||
public:
|
public:
|
||||||
enum State { NeverSeen, Global, Defined, DefinedGlobal, Used };
|
enum State { NeverSeen, Global, Defined, DefinedGlobal, Used };
|
||||||
|
|
||||||
DummySection TheSection;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StringMap<State> Symbols;
|
StringMap<State> Symbols;
|
||||||
|
|
||||||
@ -644,9 +623,7 @@ public:
|
|||||||
return Symbols.end();
|
return Symbols.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordStreamer(MCContext &Context) : MCStreamer(Context, 0) {
|
RecordStreamer(MCContext &Context) : MCStreamer(Context, 0) {}
|
||||||
SwitchSection(&TheSection);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void EmitInstruction(const MCInst &Inst) {
|
virtual void EmitInstruction(const MCInst &Inst) {
|
||||||
// Scan for values.
|
// Scan for values.
|
||||||
@ -686,7 +663,9 @@ public:
|
|||||||
// Noop calls.
|
// Noop calls.
|
||||||
virtual void ChangeSection(const MCSection *Section,
|
virtual void ChangeSection(const MCSection *Section,
|
||||||
const MCExpr *Subsection) {}
|
const MCExpr *Subsection) {}
|
||||||
virtual void InitSections() {}
|
virtual void InitSections() {
|
||||||
|
SwitchSection(getContext().getObjectFileInfo()->getTextSection());
|
||||||
|
}
|
||||||
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
|
virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
|
||||||
virtual void EmitThumbFunc(MCSymbol *Func) {}
|
virtual void EmitThumbFunc(MCSymbol *Func) {}
|
||||||
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
|
virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user