This is an archive of the discontinued LLVM Phabricator instance.

[scan-build] fix logic error warnings emitted on llvm code base
AcceptedPublic

Authored by apelete on Apr 27 2016, 3:06 PM.

Details

Summary

Fix the last few "called C++ object pointer is null" warnings emitted
by Clang Static Analyzer on the following files:

  • lib/Transforms/Scalar/LoopStrengthReduce.cpp,
  • lib/Transforms/Scalar/LoadCombine.cpp,
  • lib/Transforms/ObjCARC/ObjCARCContract.cpp,
  • lib/Target/XCore/XCoreInstrInfo.cpp,
  • lib/Target/PowerPC/PPCInstrInfo.cpp,
  • lib/Target/NVPTX/NVPTXISelLowering.cpp,
  • lib/CodeGen/CriticalAntiDepBreaker.cpp.

Signed-off-by: Apelete Seketeli <apelete@seketeli.net>

Diff Detail

Event Timeline

apelete updated this revision to Diff 55335.Apr 27 2016, 3:06 PM
apelete retitled this revision from to [scan-build] fix logic error warnings emitted on llvm code base.
apelete updated this object.
apelete added a subscriber: llvm-commits.
jlebar added a subscriber: jlebar.Apr 27 2016, 4:37 PM

NVPTX changes lgtm.

apelete updated this revision to Diff 55752.May 1 2016, 9:37 AM

[scan-build] fix logic error warnings emitted on llvm code base

Changes since last revision:

  • fast forward rebase on git master branch.

Waiting for review, could someone please have a look at this one ?

atrick accepted this revision.May 2 2016, 9:36 AM
atrick edited edge metadata.

Adding these asserts seems harmless.

This revision is now accepted and ready to land.May 2 2016, 9:36 AM

Adding these asserts seems harmless.

Great, please go ahead and commit this for me as I don't have commit access.
Thanks.

apelete updated this revision to Diff 56343.May 5 2016, 2:00 PM
apelete edited edge metadata.

[scan-build] fix logic error warnings emitted on llvm code base

Changes since last revision:

  • lib/Target/XCore/XCoreInstrInfo.cpp: remove both assert and check against 'SecondLastInst' MachineInstr variable since function would have returned earlier if there was only one terminator.
friedgold accepted this revision.May 5 2016, 2:16 PM
friedgold edited edge metadata.

Thanks for making the update, XCore changes look good to me.

apelete updated this revision to Diff 57112.May 12 2016, 3:50 PM
apelete edited edge metadata.

[scan-build] fix logic error warnings emitted on llvm code base

Changes since last commit:

  • rebased patch on trunk and validated against test suite.

Thanks for making the update, XCore changes look good to me.

I don't have commit access so please go ahead and commit this for me when you're ready.

Looks like patch was not committed.