Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum LegalizeAction {
- Legal,
- Promote,
- Expand,
- Custom
- };
- enum LegalizeTypeAction {
- TypeLegal,
- TypePromoteInteger,
- TypeExpandInteger,
- TypeSoftenFloat,
- TypeExpandFloat,
- TypeScalarizeVector,
- TypeSplitVector,
- TypeWidenVector
- };
- LegalizeTypeAction getTypeAction(LLVMContext &Context,
- EVT VT) const;
- EVT getTypeToExpandTo(LLVMContext &Context, EVT VT) const {
- ...
- switch (getTypeAction(Context, VT)) {
- case Legal:
- return VT;
- case Expand:
- ...
- }
- It works because the values coincide, but that's strange.
- This suspicious code was found in Clang project by PVS-Studio static code analyzer.
- Warning message is:
- V556 The values of different enum types are compared: switch(ENUM_TYPE_A) { case ENUM_TYPE_B: ... }. LLVMAsmPrinter targetlowering.h 268
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment