[lld] r325033 - Use reinterpret_cast<> instead of C-style cast. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 10:11:42 PST 2018
Author: ruiu
Date: Tue Feb 13 10:11:42 2018
New Revision: 325033
URL: http://llvm.org/viewvc/llvm-project?rev=325033&view=rev
Log:
Use reinterpret_cast<> instead of C-style cast. NFC.
It is currently interpreted as reinterpret_cast<>. Make it explicit.
Differential Revision: https://reviews.llvm.org/D43247
Modified:
lld/trunk/COFF/SymbolTable.cpp
lld/trunk/ELF/SymbolTable.cpp
Modified: lld/trunk/COFF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/SymbolTable.cpp?rev=325033&r1=325032&r2=325033&view=diff
==============================================================================
--- lld/trunk/COFF/SymbolTable.cpp (original)
+++ lld/trunk/COFF/SymbolTable.cpp Tue Feb 13 10:11:42 2018
@@ -145,7 +145,7 @@ std::pair<Symbol *, bool> SymbolTable::i
Symbol *&Sym = SymMap[CachedHashStringRef(Name)];
if (Sym)
return {Sym, false};
- Sym = (Symbol *)make<SymbolUnion>();
+ Sym = reinterpret_cast<Symbol *>(make<SymbolUnion>());
Sym->IsUsedInRegularObj = false;
Sym->PendingArchiveLoad = false;
return {Sym, true};
Modified: lld/trunk/ELF/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SymbolTable.cpp?rev=325033&r1=325032&r2=325033&view=diff
==============================================================================
--- lld/trunk/ELF/SymbolTable.cpp (original)
+++ lld/trunk/ELF/SymbolTable.cpp Tue Feb 13 10:11:42 2018
@@ -186,7 +186,7 @@ void SymbolTable::applySymbolWrap() {
// First, make a copy of __real_sym.
Symbol *Real = nullptr;
if (W.Real->isDefined()) {
- Real = (Symbol *)make<SymbolUnion>();
+ Real = reinterpret_cast<Symbol *>(make<SymbolUnion>());
memcpy(Real, W.Real, sizeof(SymbolUnion));
}
@@ -234,7 +234,7 @@ std::pair<Symbol *, bool> SymbolTable::i
Symbol *Sym;
if (IsNew) {
- Sym = (Symbol *)make<SymbolUnion>();
+ Sym = reinterpret_cast<Symbol *>(make<SymbolUnion>());
Sym->InVersionScript = false;
Sym->Visibility = STV_DEFAULT;
Sym->IsUsedInRegularObj = false;
More information about the llvm-commits
mailing list