Fix warnings produced by g++ on Windows.
Scraped non-pragma related warnings from a recent trybot run:
wget -O - 'http://build.chromium.org/p/tryserver.nacl/builders/nacl-toolchain-win7-pnacl-x86_64/builds/3221/steps/llvm_i686_w64_mingw32%20%28build%29/logs/stdio' | grep subzero | grep warning | grep -v pragma
BUG= none
R=ascull@google.com, jpp@chromium.org
Review URL: https://codereview.chromium.org/1315193020.
diff --git a/src/IceAssemblerX86Base.h b/src/IceAssemblerX86Base.h
index ba80fd8..3ff4642 100644
--- a/src/IceAssemblerX86Base.h
+++ b/src/IceAssemblerX86Base.h
@@ -954,7 +954,7 @@
return IsGPR && (Reg & 0x04) != 0 && (Reg & 0x08) == 0 &&
isByteSizedType(Ty);
- };
+ }
// assembleAndEmitRex is used for determining which (if any) rex prefix should
// be emitted for the current instruction. It allows different types for Reg
@@ -970,10 +970,13 @@
? T::Operand::RexW
: T::Operand::RexNone;
const uint8_t R = (Reg & 0x08) ? T::Operand::RexR : T::Operand::RexNone;
- const uint8_t X = (Addr != nullptr) ? Addr->rexX() : T::Operand::RexNone;
+ const uint8_t X = (Addr != nullptr)
+ ? (typename T::Operand::RexBits)Addr->rexX()
+ : T::Operand::RexNone;
const uint8_t B =
- (Addr != nullptr) ? Addr->rexB() : (Rm & 0x08) ? T::Operand::RexB
- : T::Operand::RexNone;
+ (Addr != nullptr)
+ ? (typename T::Operand::RexBits)Addr->rexB()
+ : (Rm & 0x08) ? T::Operand::RexB : T::Operand::RexNone;
const uint8_t Prefix = W | R | X | B;
if (Prefix != T::Operand::RexNone) {
emitUint8(Prefix);