khazem added a comment.

Thanks for the detailed review Artem!

I think that it's sensible to try merging this with PthreadLockChecker. In 
fact, I could also try merging the SpinLockChecker [1] that I've posted for 
review with PthreadLockChecker also, since they all implement similar 
functionality. This would be in line with what we discussed at the developer 
meeting, where there was a consensus that there could be too many 
domain-specific checkers that were only different in what function names they 
look for.

Here is my proposal: I could try refactoring the PthreadLockChecker into a 
LockChecker class, which would be instantiated as various subclasses (for 
Pthread, XNU, Magenta, and others in the future). The common functionality 
would be implemented in LockChecker, but the user would ask for a specific 
checker using command-line flags. Using subclasses would hopefully prevent the 
class from becoming a mess of if/switch statements, while allowing future 
LockCheckers to be implemented for other lock APIs. Does this seem reasonable?

I could then have a go at the other improvements that you mentioned, and they 
would hopefully apply to all LockCheckers and not just our Magenta one.

[1] https://reviews.llvm.org/D26340


https://reviews.llvm.org/D26342



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to