steakhal added a comment.

I have checked only your test, but the readability of the reports should be 
improved.
You frequently refer to previous events, such as `This lock has already been 
unlocked`, `This lock has already been acquired`, etc.
It isn't clear to the reader where do you refer to. IMO you should put a 
//NoteTag// at the interesting locations to achieve more readable diagnostics.

Such as:

  void stms_bad2() {
    stm1.lock();        // expected-note {{Previously locked here}}
    stm1.lock_shared(); // expected-warning {{This lock has already been 
acquired}}
  }

  void stm_bad3() {
    stm1.lock();   // hmm, might be a good idea to put one note here too
    stm2.lock();   // expected-note {{Previously locked mutex}}
    stm1.unlock(); // expected-warning {{This was not the most recently 
acquired lock. Possible lock order reversal}}
    stm2.unlock(); // no-warning
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85984/new/

https://reviews.llvm.org/D85984

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

Reply via email to