-
Notifications
You must be signed in to change notification settings - Fork 273
Initial additional information about the invariant macros and hierarchy. #3388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial additional information about the invariant macros and hierarchy. #3388
Conversation
src/util/invariant.h
Outdated
@@ -82,6 +82,9 @@ Author: Martin Brain, [email protected] | |||
/// family of macros, allowing constructs like | |||
/// `INVARIANT(x==y, my_invariantt, (T1)actual1, (T2)actual2, ...)` | |||
/// | |||
/// \ref invariant_failedt is also the base class of any 'structured | |||
/// exceptions' - as found in file base_exceptions.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\ref base_exceptions.h
src/util/invariant.h
Outdated
@@ -196,6 +199,9 @@ std::string get_backtrace(); | |||
|
|||
void report_exception_to_stderr(const invariant_failedt &); | |||
|
|||
/// This class is the backbone of all the invariant types. Every instance of an | |||
/// invariant is ultimately generated by this class, which is at times called | |||
/// via a wrapper function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this comment is in the right place? It's now part of the documentation of a method, not a class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - whoops! Function.
src/util/invariant.h
Outdated
@@ -230,8 +236,9 @@ CBMC_NORETURN | |||
abort(); | |||
} | |||
|
|||
/// Takes a backtrace, constructs an invariant_violatedt from reason and the | |||
/// backtrace, aborts printing the invariant's description. | |||
/// This is a wrapper class used by the macro 'INVARIANT(CONDITION, REASON)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I am wondering whether this is in the right place - it's documenting a method, but talks about a class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh! Fixed.
src/util/invariant.h
Outdated
@@ -342,6 +349,8 @@ std::string assemble_diagnostics(Diagnostics &&... args) | |||
} | |||
} // namespace detail | |||
|
|||
|
|||
/// This is a wrapper class, used by the macro 'INVARIANT_WITH_DIAGNOSTICS' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it just be "wrapper function"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Function.
6a6b304
to
def20b5
Compare
@sonodtt, can you fix the overlong lines please: https://travis-ci.org/diffblue/cbmc/jobs/455518975#L493 |
def20b5
to
250255f
Compare
@sonodtt, clang-format is still complaining: https://travis-ci.org/diffblue/cbmc/jobs/455856034#L536 |
250255f
to
6717df3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 6717df3).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/91681970
Initial additional information about the invariant macros and hierarchy.