-
Notifications
You must be signed in to change notification settings - Fork 273
[depends: #1063] Use nullptr to represent null pointers (targets master) #1159
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
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 |
---|---|---|
|
@@ -22,6 +22,8 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "interval_template.h" | ||
|
||
#define nullptr_exceptiont(str) str | ||
|
||
class inv_object_storet | ||
{ | ||
public: | ||
|
@@ -98,9 +100,9 @@ class invariant_sett | |
invariant_sett(): | ||
threaded(false), | ||
is_false(false), | ||
value_sets(NULL), | ||
object_store(NULL), | ||
ns(NULL) | ||
value_sets(nullptr), | ||
object_store(nullptr), | ||
ns(nullptr) | ||
{ | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -26,6 +26,9 @@ class is_threadedt; | |
class dirtyt; | ||
class reaching_definitions_analysist; | ||
|
||
#define bad_cast_exceptiont(str) str | ||
#define nullptr_exceptiont(str) str | ||
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. Now I'm convinced this isn't the right place. |
||
|
||
// requirement: V has a member "identifier" of type irep_idt | ||
template<typename V> | ||
class sparse_bitvector_analysist | ||
|
@@ -102,7 +105,7 @@ class rd_range_domaint:public ai_domain_baset | |
rd_range_domaint(): | ||
ai_domain_baset(), | ||
has_values(false), | ||
bv_container(0) | ||
bv_container(nullptr) | ||
{ | ||
} | ||
|
||
|
@@ -243,9 +246,9 @@ class reaching_definitions_analysist: | |
explicit reaching_definitions_analysist(const namespacet &_ns): | ||
concurrency_aware_ait<rd_range_domaint>(), | ||
ns(_ns), | ||
value_sets(0), | ||
is_threaded(0), | ||
is_dirty(0) | ||
value_sets(nullptr), | ||
is_threaded(nullptr), | ||
is_dirty(nullptr) | ||
{ | ||
} | ||
|
||
|
@@ -259,7 +262,9 @@ class reaching_definitions_analysist: | |
statet &s=concurrency_aware_ait<rd_range_domaint>::get_state(l); | ||
|
||
rd_range_domaint *rd_state=dynamic_cast<rd_range_domaint*>(&s); | ||
assert(rd_state!=0); | ||
INVARIANT( | ||
rd_state!=nullptr, | ||
bad_cast_exceptiont("rd_state has type rd_range_domaint")); | ||
|
||
rd_state->set_bitvector_container(*this); | ||
|
||
|
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
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ Author: Daniel Kroening, [email protected] | |
#include <iosfwd> | ||
|
||
#include <util/expr.h> | ||
#include <util/invariant.h> | ||
#include <util/std_types.h> | ||
|
||
class cpp_scopet; | ||
|
@@ -81,7 +82,7 @@ class cpp_idt | |
|
||
cpp_idt &get_parent() const | ||
{ | ||
assert(parent!=NULL); | ||
PRECONDITION(parent!=nullptr); | ||
return *parent; | ||
} | ||
|
||
|
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 |
---|---|---|
|
@@ -30,6 +30,8 @@ Author: Daniel Kroening, [email protected] | |
#include "cpp_template_type.h" | ||
#include "cpp_util.h" | ||
|
||
#define nullptr_exceptiont(str) str | ||
|
||
bool cpp_typecheck( | ||
cpp_parse_treet &cpp_parse_tree, | ||
symbol_tablet &symbol_table, | ||
|
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.
I am wondering whether this is the best approach and right place to put?
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.
This is temporary, until #1063 gets merged. Of course this should be a custom exception type derived from
invariant_failedt
, and these common exception types should probably live inutil
. Should I add a "util/standard_exceptions.h" header and just put macros in it for now?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.
Would it be ok to wait for #1063 to get merged and then do it properly?
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.
Yes, that's fine with me.
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.
Changed the PR title in a desperate attempt to introduce dependency tracking into github...