"v > 0", // comment,
"default", // assertion_level,
"default", // assertion_role,
- CCS_MAYBE, // continuation_mode
+ MAYBE_CONTINUE, // continuation_mode
);
}
if the contract should not continue on violation. This prevents requiring
including <contract> and simplifies building the call.
+ FIXME the overhead would be lower if we write out the contract_violation
+ object statically and pass it directly to the handler. Though the current
+ way is more tolerant of layout changes, so maybe leave it alone until the
+ feature is more mature.
+
Assumed contracts have a similar transformation that results the body of the
if being __builtin_unreachable ();
+ FIXME use build_assume_call.
+
Parsing of pre and post contract conditions need to be deferred when the
contracts are attached to a member function. The postcondition identifier
cannot be used before the deduced return type of an auto function is used,
for each return, or a goto epilogue would need generated similarly to cdtors.
For this initial implementation, generating function calls and letting
later optimizations decide whether to inline and duplicate the actual
- checks or whether to collapse the shared epilogue was chosen. */
+ checks or whether to collapse the shared epilogue was chosen.
+
+ FIXME the compiler already handles sharing cleanup code on multiple exit
+ paths properly, this outlining isn't necessary if we represent the
+ postcondition as a cleanup (like I already did for dtors). */
#include "config.h"
#include "system.h"
int x_processing_template_decl;
int x_processing_specialization;
int x_processing_constraint;
+ int x_processing_contract_condition;
int suppress_location_wrappers;
BOOL_BITFIELD x_processing_explicit_instantiation : 1;
BOOL_BITFIELD need_pop_function_context : 1;
- int x_processing_contract_condition;
-
/* Nonzero if we are parsing the discarded statement of a constexpr
if-statement. */
BOOL_BITFIELD discarded_stmt : 1;
(DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (NODE) \
|| DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (NODE))
-/* Nonzero if NODE (a FUNCTION_DECL) is a ctor or dtor that needs the cdtor
- label and associated goto built. */
-#define DECL_CDTOR_NEEDS_LABLED_EXIT_P(NODE) \
- (DECL_DESTRUCTOR_P (NODE) \
- || (DECL_CONSTRUCTOR_P (NODE) \
- && (targetm.cxx.cdtor_returns_this () \
- || contract_any_active_p (DECL_CONTRACTS (NODE)))))
-
/* Nonzero if NODE (a _DECL) is a cloned constructor or
destructor. */
#define DECL_CLONED_FUNCTION_P(NODE) \