[llvm] r215703 - PPC: Clean up pointer casting, no functionality change.
Benjamin Kramer
benny.kra at googlemail.com
Fri Aug 15 04:05:45 PDT 2014
Author: d0k
Date: Fri Aug 15 06:05:45 2014
New Revision: 215703
URL: http://llvm.org/viewvc/llvm-project?rev=215703&view=rev
Log:
PPC: Clean up pointer casting, no functionality change.
Silences GCC's -Wcast-qual.
Modified:
llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
Modified: llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp?rev=215703&r1=215702&r2=215703&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp Fri Aug 15 06:05:45 2014
@@ -662,9 +662,9 @@ public:
// explicitly.
void *Mem = ::operator new(sizeof(PPCOperand) + Str.size());
std::unique_ptr<PPCOperand> Op(new (Mem) PPCOperand(Token));
- Op->Tok.Data = (const char *)(Op.get() + 1);
+ Op->Tok.Data = reinterpret_cast<const char *>(Op.get() + 1);
Op->Tok.Length = Str.size();
- std::memcpy((void *)Op->Tok.Data, Str.data(), Str.size());
+ std::memcpy(const_cast<char *>(Op->Tok.Data), Str.data(), Str.size());
Op->StartLoc = S;
Op->EndLoc = S;
Op->IsPPC64 = IsPPC64;
More information about the llvm-commits
mailing list