diff --git a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp --- a/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp @@ -626,7 +626,7 @@ unsigned getRegIdx(Register Reg) const { for (unsigned Idx = 0; Idx < Locs.size(); ++Idx) if (Locs[Idx].Kind == MachineLocKind::RegisterKind && - Locs[Idx].Value.RegNo == Reg) + static_cast(Locs[Idx].Value.RegNo) == Reg) return Idx; llvm_unreachable("Could not find given Reg in Locs"); } diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp --- a/llvm/tools/obj2yaml/elf2yaml.cpp +++ b/llvm/tools/obj2yaml/elf2yaml.cpp @@ -201,7 +201,8 @@ if (const ELFYAML::RawContentSection *RawSec = dyn_cast(&S)) { if (RawSec->Type != ELF::SHT_PROGBITS || RawSec->Link || RawSec->Info || - RawSec->AddressAlign != 1 || RawSec->Address || RawSec->EntSize) + RawSec->AddressAlign != static_cast(1) || + RawSec->Address || RawSec->EntSize) return true; ELFYAML::ELF_SHF ShFlags = RawSec->Flags.getValueOr(ELFYAML::ELF_SHF(0)); @@ -209,7 +210,7 @@ if (SecName == "debug_str") return ShFlags != ELFYAML::ELF_SHF(ELF::SHF_MERGE | ELF::SHF_STRINGS); - return ShFlags != 0; + return ShFlags != static_cast(0); } }