Skip to content

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804: lacking () for clarity #85868

@dcb314

Description

@dcb314

Static analyser cppcheck says:

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp:3804:47: style: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]

Source code is

for (unsigned i = TSFlags & X86II::EVEX_K ? 2 : 1; 

I am guessing that

for (unsigned i = (TSFlags & X86II::EVEX_K) ? 2 : 1; 

was intended. Suggest add () for clarity of intention.
Not all of us know all the C precedence rules well.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions