Skip to content

Introduce union tag type #2697

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

Merged
merged 2 commits into from
Sep 7, 2018
Merged

Introduce union tag type #2697

merged 2 commits into from
Sep 7, 2018

Conversation

kroening
Copy link
Member

@kroening kroening commented Aug 8, 2018

This replaces the overloaded use of ID_symbol for union tags.

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, let's try to move to a model where one pull request has one feature clearly described in its commit message. It will make reviewing, approving, and merging so much easier and quicker!

type=symbol.type;
rename(type, l1_identifier, ns, level);
}
else if(type.id()==ID_struct_tag)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's beyond what's claimed in the commit message.

static bool have_to_rewrite_union(
const exprt &expr,
const namespacet &ns)
static bool have_to_rewrite_union(const exprt &expr)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit should really be in a separate pull request. It's likely the second commit that breaks things, while this one ought to have no impact at all. Also: the commit message could be much clearer because all that happens is removing the unused namespace parameter.

@kroening kroening force-pushed the union_tag branch 4 times, most recently from 36888b6 to d43ed19 Compare August 16, 2018 09:53
@kroening kroening force-pushed the union_tag branch 3 times, most recently from d7da536 to 2b5277e Compare September 7, 2018 10:05
@kroening
Copy link
Member Author

kroening commented Sep 7, 2018

I've turned the last commit into a separate PR (#2915).

Copy link
Collaborator

@tautschnig tautschnig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for factoring out the additional changes! Looks good module the below nit-picks, and of course also CI passing.

@@ -135,6 +135,7 @@ void cpp_typecheckt::typecheck_compound_type(
cpp_scopet *dest_scope=nullptr;
bool has_body=type.find(ID_body).is_not_nil();
bool tag_only_declaration=type.get_bool(ID_C_tag_only_declaration);
bool is_union=type.id()==ID_union;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const and clang-format style spacing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

union_tag_typet tag_type(identifier);
tag_type.add_source_location() = type.source_location();

c_qualifierst original_qualifiers(type);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems common to both branches and could be done beforehand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


c_qualifierst original_qualifiers(type);
type.swap(tag_type);
original_qualifiers.write(type);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems common to both branches and could be done afterwards.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also done

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR failed Diffblue compatibility checks (cbmc commit: 2b5277e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84111556
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

@tautschnig
Copy link
Collaborator

The TG failure is worrying. Otherwise it would be ready to go and unblock #2915.

Copy link
Contributor

@allredj allredj left a 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: 7f12c59).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/84113136

@tautschnig tautschnig merged commit 2542d0d into develop Sep 7, 2018
@tautschnig tautschnig deleted the union_tag branch September 7, 2018 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants