summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-24 16:59:40 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-24 16:59:40 +0000
commit908f4d4bf5ae85715f9a9e14bd63538c4482b27b (patch)
tree980f5a98752c167d8ea6347b8b06832c4ffe2e5f /llvm/lib/MC
parent583a13cf3636ccf41413899385e057898457217b (diff)
downloadbcm5719-llvm-908f4d4bf5ae85715f9a9e14bd63538c4482b27b.tar.gz
bcm5719-llvm-908f4d4bf5ae85715f9a9e14bd63538c4482b27b.zip
Spread some const around for non-mutating uses of MCSymbolData.
I discovered this const-hole while attempting to coalesnce the Symbol and SymbolMap data structures. There's some pending issues with that, but I figured this change was easy to flush early. llvm-svn: 207124
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/ELFObjectWriter.cpp2
-rw-r--r--llvm/lib/MC/MCExpr.cpp4
-rw-r--r--llvm/lib/MC/WinCOFFObjectWriter.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index f11ec79210a..06f295c249e 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -925,7 +925,7 @@ void ELFObjectWriter::RecordRelocation(const MCAssembler &Asm,
uint64_t
ELFObjectWriter::getSymbolIndexInSymbolTable(const MCAssembler &Asm,
const MCSymbol *S) {
- MCSymbolData &SD = Asm.getSymbolData(*S);
+ const MCSymbolData &SD = Asm.getSymbolData(*S);
return SD.getIndex();
}
diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp
index 5b06104bf73..300613530ae 100644
--- a/llvm/lib/MC/MCExpr.cpp
+++ b/llvm/lib/MC/MCExpr.cpp
@@ -506,8 +506,8 @@ static void AttemptToFoldSymbolOffsetDifference(const MCAssembler *Asm,
if (!Asm->getWriter().IsSymbolRefDifferenceFullyResolved(*Asm, A, B, InSet))
return;
- MCSymbolData &AD = Asm->getSymbolData(SA);
- MCSymbolData &BD = Asm->getSymbolData(SB);
+ const MCSymbolData &AD = Asm->getSymbolData(SA);
+ const MCSymbolData &BD = Asm->getSymbolData(SB);
if (AD.getFragment() == BD.getFragment()) {
Addend += (AD.getOffset() - BD.getOffset());
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp
index 46af32ba639..60e046ec4fe 100644
--- a/llvm/lib/MC/WinCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp
@@ -686,7 +686,7 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
Fixup.getLoc(),
Twine("symbol '") + A.getName() + "' can not be undefined");
- MCSymbolData &A_SD = Asm.getSymbolData(A);
+ const MCSymbolData &A_SD = Asm.getSymbolData(A);
MCSectionData const *SectionData = Fragment->getParent();
@@ -703,7 +703,7 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
if (SymB) {
const MCSymbol *B = &SymB->getSymbol();
- MCSymbolData &B_SD = Asm.getSymbolData(*B);
+ const MCSymbolData &B_SD = Asm.getSymbolData(*B);
if (!B_SD.getFragment())
Asm.getContext().FatalError(
Fixup.getLoc(),
OpenPOWER on IntegriCloud