llvm-mc: Make MCSymbolData symbol member const.

llvm-svn: 80573
This commit is contained in:
Daniel Dunbar 2009-08-31 08:08:06 +00:00
parent 1689464a71
commit be245a258c
3 changed files with 9 additions and 9 deletions

View File

@ -437,7 +437,7 @@ public:
// FIXME: Same concerns as with SectionData.
class MCSymbolData : public ilist_node<MCSymbolData> {
public:
MCSymbol &Symbol;
const MCSymbol &Symbol;
/// Fragment - The fragment this symbol's value is relative to, if any.
MCFragment *Fragment;
@ -474,13 +474,13 @@ public:
public:
// Only for use as sentinel.
MCSymbolData();
MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment, uint64_t _Offset,
MCAssembler *A = 0);
/// @name Accessors
/// @{
MCSymbol &getSymbol() const { return Symbol; }
const MCSymbol &getSymbol() const { return Symbol; }
MCFragment *getFragment() const { return Fragment; }
void setFragment(MCFragment *Value) { Fragment = Value; }

View File

@ -331,7 +331,7 @@ public:
void WriteNlist32(MachSymbolData &MSD) {
MCSymbolData &Data = *MSD.SymbolData;
MCSymbol &Symbol = Data.getSymbol();
const MCSymbol &Symbol = Data.getSymbol();
uint8_t Type = 0;
uint16_t Flags = Data.getFlags();
uint32_t Address = 0;
@ -592,7 +592,7 @@ public:
// files.
for (MCAssembler::symbol_iterator it = Asm.symbol_begin(),
ie = Asm.symbol_end(); it != ie; ++it) {
MCSymbol &Symbol = it->getSymbol();
const MCSymbol &Symbol = it->getSymbol();
// Ignore assembler temporaries.
if (it->getSymbol().isTemporary())
@ -628,7 +628,7 @@ public:
// Now add the data for local symbols.
for (MCAssembler::symbol_iterator it = Asm.symbol_begin(),
ie = Asm.symbol_end(); it != ie; ++it) {
MCSymbol &Symbol = it->getSymbol();
const MCSymbol &Symbol = it->getSymbol();
// Ignore assembler temporaries.
if (it->getSymbol().isTemporary())
@ -926,9 +926,9 @@ MCSectionData::LookupFixup(const MCFragment *Fragment, uint64_t Offset) const {
/* *** */
MCSymbolData::MCSymbolData() : Symbol(*(MCSymbol*)0) {}
MCSymbolData::MCSymbolData() : Symbol(*(const MCSymbol*)0) {}
MCSymbolData::MCSymbolData(MCSymbol &_Symbol, MCFragment *_Fragment,
MCSymbolData::MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment,
uint64_t _Offset, MCAssembler *A)
: Symbol(_Symbol), Fragment(_Fragment), Offset(_Offset),
IsExternal(false), IsPrivateExtern(false),

View File

@ -72,7 +72,7 @@ private:
return *Entry;
}
MCSymbolData &getSymbolData(MCSymbol &Symbol) {
MCSymbolData &getSymbolData(const MCSymbol &Symbol) {
MCSymbolData *&Entry = SymbolMap[&Symbol];
if (!Entry)