File tree 1 file changed +13
-11
lines changed
1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -30,24 +30,26 @@ Date: April 2017
30
30
31
31
#include " java_string_library_preprocess.h"
32
32
33
+ // / \return tag of a struct prefixed by "java::" or symbolic tag
34
+ // / empty string if not symbol or struct
35
+ irep_idt get_tag (const typet &type)
36
+ {
37
+ if (type.id () == ID_symbol)
38
+ return to_symbol_type (type).get_identifier ();
39
+ else if (type.id () == ID_struct)
40
+ return irep_idt (" java::" + id2string (to_struct_type (type).get_tag ()));
41
+ else
42
+ return " " ;
43
+ }
44
+
33
45
// / \param type: a type
34
46
// / \param tag: a string
35
47
// / \return Boolean telling whether the type is a struct with the given tag or a
36
48
// / symbolic type with the tag prefixed by "java::"
37
49
bool java_string_library_preprocesst::java_type_matches_tag (
38
50
const typet &type, const std::string &tag)
39
51
{
40
- if (type.id ()==ID_symbol)
41
- {
42
- irep_idt tag_id=to_symbol_type (type).get_identifier ();
43
- return tag_id==" java::" +tag;
44
- }
45
- else if (type.id ()==ID_struct)
46
- {
47
- irep_idt tag_id=to_struct_type (type).get_tag ();
48
- return tag_id==tag;
49
- }
50
- return false ;
52
+ return irep_idt (" java::" + tag) == get_tag (type);
51
53
}
52
54
53
55
// / \param type: a type
You can’t perform that action at this time.
0 commit comments