mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
The fragment implies the section, don't store both.
This reduces MCSymbol from 64 to 56 bytes on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238747 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -579,6 +579,16 @@ static void writeFragmentContents(const MCFragment &F, MCObjectWriter *OW) {
|
||||
OW->WriteBytes(EF.getContents());
|
||||
}
|
||||
|
||||
void MCAssembler::registerSymbol(const MCSymbol &Symbol, bool *Created) {
|
||||
bool New = !Symbol.isRegistered();
|
||||
if (Created)
|
||||
*Created = New;
|
||||
if (New) {
|
||||
Symbol.setIsRegistered(true);
|
||||
Symbols.push_back(&Symbol);
|
||||
}
|
||||
}
|
||||
|
||||
void MCAssembler::writeFragmentPadding(const MCFragment &F, uint64_t FSize,
|
||||
MCObjectWriter *OW) const {
|
||||
// Should NOP padding be written out before this fragment?
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "llvm/MC/MCELF.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCELFSymbolFlags.h"
|
||||
#include "llvm/MC/MCFixupKindInfo.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
|
||||
@@ -419,11 +419,11 @@ void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol,
|
||||
if (ByteAlignment != 1)
|
||||
new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, Section);
|
||||
|
||||
AssignSection(Symbol, Section);
|
||||
|
||||
MCFragment *F = new MCFillFragment(0, 0, Size, Section);
|
||||
Symbol->setFragment(F);
|
||||
|
||||
AssignSection(Symbol, Section);
|
||||
|
||||
// Update the maximum alignment on the zero fill section if necessary.
|
||||
if (ByteAlignment > Section->getAlignment())
|
||||
Section->setAlignment(ByteAlignment);
|
||||
|
||||
@@ -42,7 +42,8 @@ void MCSymbol::setVariableValue(const MCExpr *Value) {
|
||||
assert(!IsUsed && "Cannot set a variable that has already been used.");
|
||||
assert(Value && "Invalid variable value!");
|
||||
this->Value = Value;
|
||||
this->Section = nullptr;
|
||||
Section = nullptr;
|
||||
HasFragment = false;
|
||||
}
|
||||
|
||||
void MCSymbol::print(raw_ostream &OS) const {
|
||||
|
||||
Reference in New Issue
Block a user