File tree 2 files changed +62
-7
lines changed
2 files changed +62
-7
lines changed Original file line number Diff line number Diff line change 15
15
#include < iomanip>
16
16
17
17
#include < util/std_expr.h>
18
+ #include < util/validate.h>
18
19
19
20
#include < langapi/language_util.h>
20
21
@@ -668,6 +669,62 @@ bool goto_programt::instructiont::equals(const instructiont &other) const
668
669
// clang-format on
669
670
}
670
671
672
+ void goto_programt::instructiont::validate (
673
+ const namespacet &ns,
674
+ const validation_modet vm) const
675
+ {
676
+ validate_code_full_pick (code, ns, vm);
677
+ validate_expr_full_pick (guard, ns, vm);
678
+
679
+ switch (type)
680
+ {
681
+ case NO_INSTRUCTION_TYPE:
682
+ break ;
683
+ case GOTO:
684
+ break ;
685
+ case ASSUME:
686
+ break ;
687
+ case ASSERT:
688
+ break ;
689
+ case OTHER:
690
+ break ;
691
+ case SKIP:
692
+ break ;
693
+ case START_THREAD:
694
+ break ;
695
+ case END_THREAD:
696
+ break ;
697
+ case LOCATION:
698
+ break ;
699
+ case END_FUNCTION:
700
+ break ;
701
+ case ATOMIC_BEGIN:
702
+ break ;
703
+ case ATOMIC_END:
704
+ break ;
705
+ case RETURN:
706
+ break ;
707
+ case ASSIGN:
708
+ DATA_CHECK (
709
+ code.get_statement () == ID_assign,
710
+ " assign instruction should contain an assign statement" );
711
+ DATA_CHECK (targets.empty (), " assign instruction should not have a target" );
712
+ break ;
713
+ case DECL:
714
+ break ;
715
+ case DEAD:
716
+ break ;
717
+ case FUNCTION_CALL:
718
+ break ;
719
+ case THROW:
720
+ break ;
721
+ case CATCH:
722
+ break ;
723
+ case INCOMPLETE_GOTO:
724
+ break ;
725
+ }
726
+ }
727
+
671
728
bool goto_programt::equals (const goto_programt &other) const
672
729
{
673
730
if (instructions.size () != other.instructions .size ())
Original file line number Diff line number Diff line change 20
20
21
21
#include < util/invariant.h>
22
22
#include < util/namespace.h>
23
- #include < util/symbol_table.h>
24
23
#include < util/source_location.h>
25
- #include < util/std_expr.h>
26
24
#include < util/std_code.h>
25
+ #include < util/std_expr.h>
26
+ #include < util/symbol_table.h>
27
+
28
+ enum class validation_modet ;
27
29
28
30
// / The type of an instruction in a GOTO program.
29
31
enum goto_program_instruction_typet
@@ -403,11 +405,7 @@ class goto_programt
403
405
// /
404
406
// / The validation mode indicates whether well-formedness check failures are
405
407
// / reported via DATA_INVARIANT violations or exceptions.
406
- void validate (const namespacet &ns, const validation_modet vm) const
407
- {
408
- validate_code_full_pick (code, ns, vm);
409
- validate_expr_full_pick (guard, ns, vm);
410
- }
408
+ void validate (const namespacet &ns, const validation_modet vm) const ;
411
409
};
412
410
413
411
// Never try to change this to vector-we mutate the list while iterating
You can’t perform that action at this time.
0 commit comments