Skip to content

Commit

Permalink
[NFC] Fix Werror=extra warning related to mismatched enum type (#112808)
Browse files Browse the repository at this point in the history
This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on.
Built by GCC 11.

Fix warnings:

llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp: In member
function ‘void llvm::AsmPrinter::emitJumpTableSizesSection(const
llvm::MachineJumpTableInfo*, const llvm::Function&) const’:
llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:2852:31: error:
enumerated and non-enumerated type in conditional expression
[-Werror=extra]
 2852 |     int Flags = F.hasComdat() ? ELF::SHF_GROUP : 0;
      |                 ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
  • Loading branch information
jsji authored Oct 18, 2024
1 parent a24a420 commit 6c60ead
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,

if (isElf) {
MCSymbolELF *LinkedToSym = dyn_cast<MCSymbolELF>(CurrentFnSym);
int Flags = F.hasComdat() ? ELF::SHF_GROUP : 0;
int Flags = F.hasComdat() ? (unsigned)ELF::SHF_GROUP : 0;

JumpTableSizesSection = OutContext.getELFSection(
sectionName, ELF::SHT_LLVM_JT_SIZES, Flags, 0, GroupName, F.hasComdat(),
Expand Down

0 comments on commit 6c60ead

Please sign in to comment.