The code after a noreturn call doesn't execute.
The pattern in the testcase is pretty common in LLVM (a switch with a default case that calls llvm_unreachable).
Differential D36250
[coverage] Special-case calls to noreturn functions. efriedma on Aug 2 2017, 4:40 PM. Authored by
Details
The code after a noreturn call doesn't execute. The pattern in the testcase is pretty common in LLVM (a switch with a default case that calls llvm_unreachable).
Diff Detail
Event TimelineComment Actions 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. Comment Actions Add missing call to handleFileExit(). Not sure I'm really calling it in the right place, but this seems to work. Comment Actions I tested this out on clang's ItaniumMangle.cpp and the crash is resolved.
|