[llvm] r182950 - Use the const_cast only where necessary.
Bill Wendling
isanbard at gmail.com
Thu May 30 11:52:57 PDT 2013
Author: void
Date: Thu May 30 13:52:57 2013
New Revision: 182950
URL: http://llvm.org/viewvc/llvm-project?rev=182950&view=rev
Log:
Use the const_cast only where necessary.
Modified:
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=182950&r1=182949&r2=182950&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Thu May 30 13:52:57 2013
@@ -1438,8 +1438,7 @@ void MCDwarfFrameEmitter::Emit(MCStreame
bool UsingCFI,
bool IsEH) {
MCContext &Context = Streamer.getContext();
- MCObjectFileInfo *MOFI =
- const_cast<MCObjectFileInfo*>(Context.getObjectFileInfo());
+ const MCObjectFileInfo *MOFI = Context.getObjectFileInfo();
FrameEmitterImpl Emitter(UsingCFI, IsEH);
ArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getFrameInfos();
@@ -1458,8 +1457,9 @@ void MCDwarfFrameEmitter::Emit(MCStreame
}
}
- const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() :
- *MOFI->getDwarfFrameSection();
+ const MCSection &Section =
+ IsEH ? *const_cast<MCObjectFileInfo*>(MOFI)->getEHFrameSection() :
+ *MOFI->getDwarfFrameSection();
Streamer.SwitchSection(&Section);
MCSymbol *SectionStart = Context.CreateTempSymbol();
Streamer.EmitLabel(SectionStart);
More information about the llvm-commits
mailing list