llvm.org GIT mirror llvm / e8b13a5
Fix -Wsign-compare warnings on Windows These arise because enums are 'int' by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321887 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 2 years ago
4 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
124124 DW_OP_LLVM_fragment = 0x1000 ///< Only used in LLVM metadata.
125125 };
126126
127 enum TypeKind {
127 enum TypeKind : uint8_t {
128128 #define HANDLE_DW_ATE(ID, NAME, VERSION, VENDOR) DW_ATE_##NAME = ID,
129129 #include "llvm/BinaryFormat/Dwarf.def"
130130 DW_ATE_lo_user = 0x80,
7575
7676 // Pinned metadata names, which always have the same value. This is a
7777 // compile-time performance optimization, not a correctness optimization.
78 enum {
78 enum : unsigned {
7979 MD_dbg = 0, // "dbg"
8080 MD_tbaa = 1, // "tbaa"
8181 MD_prof = 2, // "prof"
107107 /// operand bundle tags that LLVM has special knowledge of are listed here.
108108 /// Additionally, this scheme allows LLVM to efficiently check for specific
109109 /// operand bundle tags without comparing strings.
110 enum {
110 enum : unsigned {
111111 OB_deopt = 0, // "deopt"
112112 OB_funclet = 1, // "funclet"
113113 OB_gc_transition = 2, // "gc-transition"
276276 // same as the second operand. In this case, we will generate a "long"
277277 // version of the widening instruction.
278278 if (auto *Cast = dyn_cast(SingleUser->getOperand(1)))
279 if (I->getOpcode() == Cast->getOpcode() &&
279 if (I->getOpcode() == unsigned(Cast->getOpcode()) &&
280280 cast(I)->getSrcTy() == Cast->getSrcTy())
281281 return 0;
282282 }
62496249 // The instruction must be predicable.
62506250 if (!MCID.isPredicable())
62516251 return Error(Loc, "instructions in IT block must be predicable");
6252 unsigned Cond = Inst.getOperand(MCID.findFirstPredOperandIdx()).getImm();
6252 ARMCC::CondCodes Cond = ARMCC::CondCodes(
6253 Inst.getOperand(MCID.findFirstPredOperandIdx()).getImm());
62536254 if (Cond != currentITCond()) {
62546255 // Find the condition code Operand to get its SMLoc information.
62556256 SMLoc CondLoc;
62576258 if (static_cast(*Operands[I]).isCondCode())
62586259 CondLoc = Operands[I]->getStartLoc();
62596260 return Error(CondLoc, "incorrect condition in IT block; got '" +
6260 StringRef(ARMCondCodeToString(ARMCC::CondCodes(Cond))) +
6261 "', but expected '" +
6262 ARMCondCodeToString(ARMCC::CondCodes(currentITCond())) + "'");
6261 StringRef(ARMCondCodeToString(Cond)) +
6262 "', but expected '" +
6263 ARMCondCodeToString(currentITCond()) + "'");
62636264 }
62646265 // Check for non-'al' condition codes outside of the IT block.
62656266 } else if (isThumbTwo() && MCID.isPredicable() &&