summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-09 23:08:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-09 23:08:35 +0000
commitd66e65df037b6db9c6af09c3752f707f1fc4f6b5 (patch)
tree8687cf188fc9f33bcbb679ecc2a6beab31d3bf8f /llvm/lib/MC/MCDwarf.cpp
parent2eeba63215803596826737d581e7dabf91e6aaa5 (diff)
downloadbcm5719-llvm-d66e65df037b6db9c6af09c3752f707f1fc4f6b5.tar.gz
bcm5719-llvm-d66e65df037b6db9c6af09c3752f707f1fc4f6b5.zip
Use const references.
llvm-svn: 121426
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index 3e10f9502db..d7540ce077d 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -101,20 +101,21 @@ void MCLineEntry::Make(MCStreamer *MCOS, const MCSection *Section) {
//
// This helper routine returns an expression of End - Start + IntVal .
//
-static inline const MCExpr *MakeStartMinusEndExpr(MCStreamer *MCOS,
- MCSymbol *Start,
- MCSymbol *End, int IntVal) {
+static inline const MCExpr *MakeStartMinusEndExpr(const MCStreamer &MCOS,
+ const MCSymbol &Start,
+ const MCSymbol &End,
+ int IntVal) {
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
const MCExpr *Res =
- MCSymbolRefExpr::Create(End, Variant, MCOS->getContext());
+ MCSymbolRefExpr::Create(&End, Variant, MCOS.getContext());
const MCExpr *RHS =
- MCSymbolRefExpr::Create(Start, Variant, MCOS->getContext());
+ MCSymbolRefExpr::Create(&Start, Variant, MCOS.getContext());
const MCExpr *Res1 =
- MCBinaryExpr::Create(MCBinaryExpr::Sub, Res, RHS, MCOS->getContext());
+ MCBinaryExpr::Create(MCBinaryExpr::Sub, Res, RHS, MCOS.getContext());
const MCExpr *Res2 =
- MCConstantExpr::Create(IntVal, MCOS->getContext());
+ MCConstantExpr::Create(IntVal, MCOS.getContext());
const MCExpr *Res3 =
- MCBinaryExpr::Create(MCBinaryExpr::Sub, Res1, Res2, MCOS->getContext());
+ MCBinaryExpr::Create(MCBinaryExpr::Sub, Res1, Res2, MCOS.getContext());
return Res3;
}
@@ -213,7 +214,7 @@ void MCDwarfFileTable::Emit(MCStreamer *MCOS,
// The first 4 bytes is the total length of the information for this
// compilation unit (not including these 4 bytes for the length).
- MCOS->EmitAbsValue(MakeStartMinusEndExpr(MCOS, LineStartSym, LineEndSym,4),
+ MCOS->EmitAbsValue(MakeStartMinusEndExpr(*MCOS, *LineStartSym, *LineEndSym,4),
4);
// Next 2 bytes is the Version, which is Dwarf 2.
@@ -226,7 +227,7 @@ void MCDwarfFileTable::Emit(MCStreamer *MCOS,
// section to the end of the prologue. Not including the 4 bytes for the
// total length, the 2 bytes for the version, and these 4 bytes for the
// length of the prologue.
- MCOS->EmitAbsValue(MakeStartMinusEndExpr(MCOS, LineStartSym, ProEndSym,
+ MCOS->EmitAbsValue(MakeStartMinusEndExpr(*MCOS, *LineStartSym, *ProEndSym,
(4 + 2 + 4)),
4, 0);
OpenPOWER on IntegriCloud