mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Create a MCSymbolELF.
This create a MCSymbolELF class and moves SymbolSize since only ELF needs a size expression. This reduces the size of MCSymbol from 56 to 48 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238801 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include "llvm/MC/MCFixupKindInfo.h"
|
||||
#include "llvm/MC/MCObjectWriter.h"
|
||||
#include "llvm/MC/MCSectionELF.h"
|
||||
#include "llvm/MC/MCSymbolELF.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/StringTableBuilder.h"
|
||||
#include "llvm/Support/Compression.h"
|
||||
@@ -79,7 +80,7 @@ class ELFObjectWriter : public MCObjectWriter {
|
||||
|
||||
/// Helper struct for containing some precomputed information on symbols.
|
||||
struct ELFSymbolData {
|
||||
const MCSymbol *Symbol;
|
||||
const MCSymbolELF *Symbol;
|
||||
uint32_t SectionIndex;
|
||||
StringRef Name;
|
||||
|
||||
@@ -451,7 +452,8 @@ void ELFObjectWriter::writeSymbol(SymbolTableWriter &Writer,
|
||||
assert((!Symbol.getFragment() ||
|
||||
(Symbol.getFragment()->getParent() == &Symbol.getSection())) &&
|
||||
"The symbol's section doesn't match the fragment's symbol");
|
||||
const MCSymbol *Base = Layout.getBaseSymbol(Symbol);
|
||||
const MCSymbolELF *Base =
|
||||
cast_or_null<MCSymbolELF>(Layout.getBaseSymbol(Symbol));
|
||||
|
||||
// This has to be in sync with when computeSymbolTable uses SHN_ABS or
|
||||
// SHN_COMMON.
|
||||
@@ -810,7 +812,7 @@ void ELFObjectWriter::computeSymbolTable(
|
||||
continue;
|
||||
|
||||
ELFSymbolData MSD;
|
||||
MSD.Symbol = &Symbol;
|
||||
MSD.Symbol = cast<MCSymbolELF>(&Symbol);
|
||||
|
||||
// Undefined symbols are global, but this is the first place we
|
||||
// are able to set it.
|
||||
|
Reference in New Issue
Block a user