-
Notifications
You must be signed in to change notification settings - Fork 273
Use irep id defs for all #comments #2590
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -426,7 +426,7 @@ void cpp_typecheckt::typecheck_compound_declarator( | |
if(cpp_name.is_operator()) | ||
{ | ||
component.set("is_operator", true); | ||
component.type().set("#is_operator", true); | ||
component.type().set(ID_C_is_operator, true); | ||
} | ||
|
||
if(is_cast_operator) | ||
|
@@ -442,7 +442,7 @@ void cpp_typecheckt::typecheck_compound_declarator( | |
if(is_static) | ||
{ | ||
component.set(ID_is_static, true); | ||
component.type().set("#is_static", true); | ||
component.type().set(ID_C_is_static, true); | ||
} | ||
|
||
if(is_typedef) | ||
|
@@ -517,7 +517,7 @@ void cpp_typecheckt::typecheck_compound_declarator( | |
else // virtual | ||
{ | ||
component.type().set(ID_C_is_virtual, true); | ||
component.type().set("#virtual_name", virtual_name); | ||
component.type().set(ID_C_virtual_name, virtual_name); | ||
|
||
// Check if it is a pure virtual method | ||
if(value.is_not_nil() && value.id() == ID_constant) | ||
|
@@ -888,9 +888,9 @@ void cpp_typecheckt::typecheck_friend_declaration( | |
// typecheck ftype | ||
|
||
// TODO | ||
// typecheck_type(ftype); | ||
// assert(ftype.id()==ID_symbol); | ||
// symbol.type.add("#friends").move_to_sub(ftype); | ||
// typecheck_type(ftype); | ||
// assert(ftype.id()==ID_symbol); | ||
// symbol.type.add("ID_C_friends").move_to_sub(ftype); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if updating commented out TODO code is better or worse than not updating it. Hmmm... I think updating is probably the right thing to do. |
||
|
||
return; | ||
} | ||
|
@@ -914,7 +914,7 @@ void cpp_typecheckt::typecheck_friend_declaration( | |
declaration.type(), declaration.storage_spec(), | ||
declaration.member_spec(), sub_it); | ||
exprt symb_expr=cpp_symbol_expr(conv_symb); | ||
symbol.type.add("#friends").move_to_sub(symb_expr); | ||
symbol.type.add(ID_C_friends).move_to_sub(symb_expr); | ||
} | ||
else | ||
{ | ||
|
@@ -929,7 +929,7 @@ void cpp_typecheckt::typecheck_friend_declaration( | |
|
||
exprt symb_expr=cpp_symbol_expr(conv_symb); | ||
|
||
symbol.type.add("#friends").move_to_sub(symb_expr); | ||
symbol.type.add(ID_C_friends).move_to_sub(symb_expr); | ||
} | ||
} | ||
} | ||
|
@@ -1462,7 +1462,7 @@ void cpp_typecheckt::convert_anon_struct_union_member( | |
|
||
put_compound_into_scope(component); | ||
|
||
struct_union_symbol.type.set("#unnamed_object", base_name); | ||
struct_union_symbol.type.set(ID_C_unnamed_object, base_name); | ||
} | ||
|
||
bool cpp_typecheckt::get_component( | ||
|
@@ -1496,7 +1496,7 @@ bool cpp_typecheckt::get_component( | |
{ | ||
if(disable_access_control) | ||
{ | ||
member.set("#not_accessible", true); | ||
member.set(ID_C_not_accessible, true); | ||
member.set(ID_C_access, component.get(ID_access)); | ||
} | ||
else | ||
|
@@ -1520,8 +1520,7 @@ bool cpp_typecheckt::get_component( | |
|
||
return true; // component found | ||
} | ||
else if( | ||
follow(component.type()).find("#unnamed_object").is_not_nil()) | ||
else if(follow(component.type()).find(ID_C_unnamed_object).is_not_nil()) | ||
{ | ||
// could be anonymous union or struct | ||
|
||
|
@@ -1597,8 +1596,7 @@ bool cpp_typecheckt::check_component_access( | |
} | ||
|
||
// check friendship | ||
const irept::subt &friends= | ||
struct_union_type.find("#friends").get_sub(); | ||
const irept::subt &friends = struct_union_type.find(ID_C_friends).get_sub(); | ||
|
||
forall_irep(f_it, friends) | ||
{ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 the C++ front-end be generating ID_C_* things for C++ features?
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.
That
_C_
isn't C the language, it's "Comment". C the language seems to usually use a lowercase 'c' in irep identifiers.