Skip to content
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

Non Determinism Issue in Def_Use passes #385

Merged
merged 2 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontends/p4/def_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.
#include "frontends/p4/methodInstance.h"
#include "frontends/p4/tableApply.h"
#include "parserCallGraph.h"
#include "lib/ordered_set.h"

namespace P4 {

Expand Down Expand Up @@ -695,7 +696,7 @@ bool ComputeWriteSet::preorder(const IR::P4Parser* parser) {
ComputeParserCG pcg(storageMap->refMap, &transitions);

(void)parser->apply(pcg);
std::set<const IR::ParserState*> toRun; // worklist
ordered_set<const IR::ParserState*> toRun; // worklist
toRun.emplace(startState);

while (!toRun.empty()) {
Expand Down
1 change: 1 addition & 0 deletions lib/ordered_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ordered_set {
bool empty() const noexcept { return data.empty(); }
size_type size() const noexcept { return data_map.size(); }
size_type max_size() const noexcept { return data_map.max_size(); }
void clear() { data.clear(); data_map.clear(); }

iterator find(const T &a) { return tr_iter(data_map.find(&a)); }
const_iterator find(const T &a) const { return tr_iter(data_map.find(&a)); }
Expand Down