]> granicus.if.org Git - llvm/commitdiff
Use a two-level cast through an intptr_t, and make them C-style casts.
authorChandler Carruth <chandlerc@gmail.com>
Sat, 11 Jun 2016 08:19:59 +0000 (08:19 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 11 Jun 2016 08:19:59 +0000 (08:19 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272461 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/Registry.h

index 45ba77000d8c450a1f9fba4d14a3934bab2931f7..27f025fcd080b73d4d6a5d9e325905ad1d727699 100644 (file)
@@ -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