ELFObjectFile.h: Silence warning on Windows
authorHans Wennborg <hans@hanshq.net>
Fri, 9 Aug 2013 16:48:21 +0000 (16:48 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 9 Aug 2013 16:48:21 +0000 (16:48 +0000)
The compiler was warning about using | on a uintptr_t and bool:

  Object/ELFObjectFile.h(131) : warning C4805: '|' : unsafe
  mix of type 'uintptr_t' and type 'bool' in operation

I think the warning might be useful in other cases, so I added
a cast instead of disabling it altogether.

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

include/llvm/Object/ELFObjectFile.h

index f0be8abb09fa4b844f3ba08178eeff3f5e18da13..08cac04ac6d28ab697de0b91228ce6955c1a879f 100644 (file)
@@ -128,7 +128,8 @@ protected: // ELF specific protected members.
 
   DataRefImpl toDRI(Elf_Sym_Iter Symb) const {
     DataRefImpl DRI;
-    DRI.p = reinterpret_cast<uintptr_t>(Symb.get()) | Symb.isDynamic();
+    DRI.p = reinterpret_cast<uintptr_t>(Symb.get()) |
+      static_cast<uintptr_t>(Symb.isDynamic());
     return DRI;
   }