This is an archive of the discontinued LLVM Phabricator instance.

Fix assertion failure in thread safety analysis (PR34800).
ClosedPublic

Authored by alexfh on Oct 2 2017, 7:11 AM.

Details

Summary

Fix an assertion failure (http://llvm.org/PR34800) and clean up unused code relevant to the fixed logic.

A bit of context: when SExprBuilder::translateMemberExpr is called on a member expression that involves a conversion operator, for example, til::Project constructor can't just call getName() on it, since the name is not a simple identifier. In order to handle this case I've introduced an optional string to print the member name to. I discovered that the other two til::Project constructors are not used, so it was better to delete them instead of ensuring they work correctly with the new logic.

Diff Detail

Repository
rL LLVM

Event Timeline

alexfh created this revision.Oct 2 2017, 7:11 AM
alexfh edited the summary of this revision. (Show Details)Oct 2 2017, 7:22 AM
alexfh added inline comments.Oct 2 2017, 7:26 AM
include/clang/Analysis/Analyses/ThreadSafetyTIL.h
931–936 ↗(On Diff #117343)

BTW, alternatively, I could do:

if (!SlotName) {
  SlotName = "";
  llvm::raw_string_ostream OS(*SlotName);
  Cvdecl->printName(OS);
}

Not sure which of these would be preferred in this code.

This revision is now accepted and ready to land.Oct 2 2017, 9:33 AM
alexfh updated this revision to Diff 117650.Oct 4 2017, 3:21 AM

Get rid of a local string variable.

This revision was automatically updated to reflect the committed changes.