Fix static analyzer reports issue, add assert to avoid analyzer report.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp | ||
---|---|---|
1039 | If there are Muls and they are not processed, then there is no point to continue analysing Addends. Therefore it is better to have an early exit here. Also Collect function, if it returns true, always would fill either Addends or Muls. That's why there is no way for the control flow to miss either FinalNode check in the original code. So, FinalNode can't be nullptr by that point |
llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp | ||
---|---|---|
1039 | Thanks for explanation, make sense here. I want to add assert instead to mute the static analyzer check. Does this look good to you? |
If there are Muls and they are not processed, then there is no point to continue analysing Addends. Therefore it is better to have an early exit here.
Also Collect function, if it returns true, always would fill either Addends or Muls. That's why there is no way for the control flow to miss either FinalNode check in the original code. So, FinalNode can't be nullptr by that point