From: Bill Wendling Date: Thu, 30 May 2013 18:52:57 +0000 (+0000) Subject: Use the const_cast only where necessary. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=79b40f10c00d38f81272bc683bd94e24607f3897;p=oota-llvm.git Use the const_cast only where necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182950 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp index efe0c46db86..90221a15f00 100644 --- a/lib/MC/MCDwarf.cpp +++ b/lib/MC/MCDwarf.cpp @@ -1438,8 +1438,7 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer, bool UsingCFI, bool IsEH) { MCContext &Context = Streamer.getContext(); - MCObjectFileInfo *MOFI = - const_cast(Context.getObjectFileInfo()); + const MCObjectFileInfo *MOFI = Context.getObjectFileInfo(); FrameEmitterImpl Emitter(UsingCFI, IsEH); ArrayRef FrameArray = Streamer.getFrameInfos(); @@ -1458,8 +1457,9 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer, } } - const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() : - *MOFI->getDwarfFrameSection(); + const MCSection &Section = + IsEH ? *const_cast(MOFI)->getEHFrameSection() : + *MOFI->getDwarfFrameSection(); Streamer.SwitchSection(&Section); MCSymbol *SectionStart = Context.CreateTempSymbol(); Streamer.EmitLabel(SectionStart);