Avoid a warning on pointer casting, NFC
authorGabor Buella <gabor.buella@intel.com>
Wed, 25 Apr 2018 12:15:34 +0000 (12:15 +0000)
committerGabor Buella <gabor.buella@intel.com>
Wed, 25 Apr 2018 12:15:34 +0000 (12:15 +0000)
Reviewers: philip.pfaffe

Reviewed By: philip.pfaffe

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

llvm-svn: 330817

llvm/unittests/Passes/PluginsTest.cpp

index df1ba1c..ad5c75c 100644 (file)
@@ -19,6 +19,8 @@
 
 #include "TestPlugin.h"
 
+#include <cstdint>
+
 using namespace llvm;
 
 void anchor() {}
@@ -27,7 +29,7 @@ static std::string LibPath(const std::string Name = "TestPlugin") {
   const std::vector<testing::internal::string> &Argvs =
       testing::internal::GetArgvs();
   const char *Argv0 = Argvs.size() > 0 ? Argvs[0].c_str() : "PluginsTests";
-  void *Ptr = (void *)anchor;
+  void *Ptr = (void *)(intptr_t)anchor;
   std::string Path = sys::fs::getMainExecutable(Argv0, Ptr);
   llvm::SmallString<256> Buf{sys::path::parent_path(Path)};
   sys::path::append(Buf, (Name + ".so").c_str());