This is an archive of the discontinued LLVM Phabricator instance.

[coverage] Special-case calls to noreturn functions.
ClosedPublic

Authored by efriedma on Aug 2 2017, 4:40 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Aug 2 2017, 4:40 PM
vsk accepted this revision.Aug 2 2017, 5:20 PM

Thanks, lgtm.

This revision is now accepted and ready to land.Aug 2 2017, 5:20 PM
This revision was automatically updated to reflect the committed changes.
efriedma reopened this revision.Aug 4 2017, 4:51 PM

This was reverted.

Failing function, from include/clang/AST/Type.h:

inline bool Type::isImageType() const {
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) is##Id##Type() ||
  return
#include "clang/Basic/OpenCLImageTypes.def"
      0; // end boolean or operation
}

There are no noreturn calls here. I think the problem is that we're missing a call to handleFileExit() somewhere. I'll post an updated patch soon.

This revision is now accepted and ready to land.Aug 4 2017, 4:51 PM
efriedma updated this revision to Diff 109838.Aug 4 2017, 5:03 PM

Add missing call to handleFileExit().

Not sure I'm really calling it in the right place, but this seems to work.

vsk added a comment.Aug 4 2017, 5:50 PM

I tested this out on clang's ItaniumMangle.cpp and the crash is resolved.

lib/CodeGen/CoverageMappingGen.cpp
723 ↗(On Diff #109838)

This is doing the right thing. I think it should just be replaced by a call to VisitStmt(E), though, as that's clearer.

efriedma updated this revision to Diff 110249.Aug 8 2017, 12:04 PM

Update to call VisitStmt(E)

vsk accepted this revision.Aug 8 2017, 12:15 PM

Thanks, lgtm.

This revision was automatically updated to reflect the committed changes.