This is an archive of the discontinued LLVM Phabricator instance.

[VerifyDiagnosticConsumer] Document -verify=<prefixes> in doxygen
ClosedPublic

Authored by jdenny on Apr 17 2019, 4:39 PM.

Diff Detail

Event Timeline

jdenny created this revision.Apr 17 2019, 4:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 17 2019, 4:39 PM
Charusso accepted this revision.Apr 17 2019, 4:49 PM

Thanks you!

I really like live working examples, I hope not just me. Could you link https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/use-after-move.cpp as well as a live example?

This revision is now accepted and ready to land.Apr 17 2019, 4:49 PM
NoQ added a comment.Apr 17 2019, 5:08 PM

Yup, i confirm that this improves discoverability of this feature :) Maybe it deserves its own .rst doc, like FileCheck, but for now doxygen seems to be the best source of truth on how to use -verify and i consult it regularly.

I really like live working examples, I hope not just me. Could you link https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/use-after-move.cpp as well as a live example?

I'd rather reserve an ability for myself to move the test around without breaking links all over the place. Live examples are easy to grep for as soon as you know what to grep for.

NoQ accepted this revision.Apr 17 2019, 5:08 PM
In D60845#1470986, @NoQ wrote:

Yup, i confirm that this improves discoverability of this feature :) Maybe it deserves its own .rst doc, like FileCheck, but for now doxygen seems to be the best source of truth on how to use -verify and i consult it regularly.

I've seen a few projects outside of clang use -verify mode for their own testing of various things. Maybe it's time we promote it from an internal self-testing tool to a full-fledged and supported part of Clang's interface (including adding a driver flag and a proper description in the user manual)?

jdenny updated this revision to Diff 195742.Apr 18 2019, 8:00 AM

Clarify the behavior of multiple -verify options.

Thanks for the accepts.

In D60845#1470986, @NoQ wrote:

I really like live working examples, I hope not just me. Could you link https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/use-after-move.cpp as well as a live example?

I'd rather reserve an ability for myself to move the test around without breaking links all over the place. Live examples are easy to grep for as soon as you know what to grep for.

Agreed.

I've seen a few projects outside of clang use -verify mode for their own testing of various things.

Interesting. What's an example?

I've seen a few projects outside of clang use -verify mode for their own testing of various things.

Interesting. What's an example?

libc++ and absl both use -verify in their test suites.

I've seen a few projects outside of clang use -verify mode for their own testing of various things.

Interesting. What's an example?

libc++ and absl both use -verify in their test suites.

Thanks. I just took a quick glance at libc++. I see checks that the library manages to induce desired compiler diagnostics in code that incorrectly interfaces with the library. That's a nice capability to expose, especially for people writing C++ libraries.

This revision was automatically updated to reflect the committed changes.