Use reinterpret_cast<> instead of C-style cast. NFC.
authorRui Ueyama <ruiu@google.com>
Tue, 13 Feb 2018 18:11:42 +0000 (18:11 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 13 Feb 2018 18:11:42 +0000 (18:11 +0000)
It is currently interpreted as reinterpret_cast<>. Make it explicit.

Differential Revision: https://reviews.llvm.org/D43247

llvm-svn: 325033

lld/COFF/SymbolTable.cpp
lld/ELF/SymbolTable.cpp

index ecebe60..81c7b94 100644 (file)
@@ -145,7 +145,7 @@ std::pair<Symbol *, bool> SymbolTable::insert(StringRef Name) {
   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};
index f8725cb..01d43d2 100644 (file)
@@ -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::insert(StringRef Name) {
 
   Symbol *Sym;
   if (IsNew) {
-    Sym = (Symbol *)make<SymbolUnion>();
+    Sym = reinterpret_cast<Symbol *>(make<SymbolUnion>());
     Sym->InVersionScript = false;
     Sym->Visibility = STV_DEFAULT;
     Sym->IsUsedInRegularObj = false;