[PATCH] D43247: Use reinterpret_cast<> instead of C-style cast. NFC.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 10:14:03 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL325033: Use reinterpret_cast<> instead of C-style cast. NFC. (authored by ruiu, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D43247?vs=134067&id=134074#toc

Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43247

Files:
  lld/trunk/COFF/SymbolTable.cpp
  lld/trunk/ELF/SymbolTable.cpp


Index: lld/trunk/COFF/SymbolTable.cpp
===================================================================
--- lld/trunk/COFF/SymbolTable.cpp
+++ lld/trunk/COFF/SymbolTable.cpp
@@ -145,7 +145,7 @@
   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: lld/trunk/ELF/SymbolTable.cpp
===================================================================
--- lld/trunk/ELF/SymbolTable.cpp
+++ lld/trunk/ELF/SymbolTable.cpp
@@ -186,7 +186,7 @@
     // 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 @@
 
   Symbol *Sym;
   if (IsNew) {
-    Sym = (Symbol *)make<SymbolUnion>();
+    Sym = reinterpret_cast<Symbol *>(make<SymbolUnion>());
     Sym->InVersionScript = false;
     Sym->Visibility = STV_DEFAULT;
     Sym->IsUsedInRegularObj = false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43247.134074.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180213/179e3fc5/attachment.bin>


More information about the llvm-commits mailing list