Quiet VC++ warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17484 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp
index eef01ad..98cd863 100644
--- a/lib/Target/X86/X86CodeEmitter.cpp
+++ b/lib/Target/X86/X86CodeEmitter.cpp
@@ -61,11 +61,11 @@
void *X86JITInfo::getJITStubForFunction(Function *F, MachineCodeEmitter &MCE) {
- return (void*)((unsigned long)getResolver(MCE).getLazyResolver(F));
+ return (void*)(intptr_t)getResolver(MCE).getLazyResolver(F);
}
void X86JITInfo::replaceMachineCodeForFunction (void *Old, void *New) {
- char *OldByte = (char *) Old;
+ unsigned char *OldByte = (char *) Old;
*OldByte++ = 0xE9; // Emit JMP opcode.
int32_t *OldWord = (int32_t *) OldByte;
int32_t NewAddr = (intptr_t) New;
diff --git a/utils/TableGen/InstrSelectorEmitter.cpp b/utils/TableGen/InstrSelectorEmitter.cpp
index 9a2ce4a..e9c6344 100644
--- a/utils/TableGen/InstrSelectorEmitter.cpp
+++ b/utils/TableGen/InstrSelectorEmitter.cpp
@@ -344,7 +344,7 @@
break;
}
- return AnyUnset | N->getType() == MVT::Other;
+ return AnyUnset | (N->getType() == MVT::Other);
}
/// clone - This method is used to make an exact copy of the current pattern,
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index 38e1dff..8c8e7b9 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -67,7 +67,7 @@
if (Value & ~((1LL << Size)-1))
return 0;
} else {
- if ((Value >> Size) != -1 || ((Value & (1 << Size-1)) == 0))
+ if ((Value >> Size) != -1 || ((Value & (1 << (Size-1))) == 0))
return 0;
}