[llvm] r272461 - Use a two-level cast through an intptr_t, and make them C-style casts.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 11 01:20:00 PDT 2016


Author: chandlerc
Date: Sat Jun 11 03:19:59 2016
New Revision: 272461

URL: http://llvm.org/viewvc/llvm-project?rev=272461&view=rev
Log:
Use a two-level cast through an intptr_t, and make them C-style casts.
This shouldn't have any functional difference, but it appears to be the
pattern used for other methods on DynamicLibrary, and it should avoid
the -Wpedantic warning on one of the build bots about the direct
reinterpret_cast.

Modified:
    llvm/trunk/include/llvm/Support/Registry.h

Modified: llvm/trunk/include/llvm/Support/Registry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Registry.h?rev=272461&r1=272460&r2=272461&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Registry.h (original)
+++ llvm/trunk/include/llvm/Support/Registry.h Sat Jun 11 03:19:59 2016
@@ -128,7 +128,7 @@ namespace llvm {
       std::string Name("LLVMGetRegistry_");
       Name.append(RegistryName);
       GetRegistry Getter =
-          reinterpret_cast<GetRegistry>(DL.getAddressOfSymbol(Name.c_str()));
+          (GetRegistry)(intptr_t)DL.getAddressOfSymbol(Name.c_str());
       if (Getter) {
         // Call the getter function in order to get the full copy of the
         // registry defined in the plugin DLL, and copy them over to the




More information about the llvm-commits mailing list