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

Move model instances into one source file, so they get initialized in the correct order #467

Merged
merged 1 commit into from
Apr 12, 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: 1 addition & 2 deletions frontends/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ p4_frontend_UNIFIED = \
frontends/p4/evaluator/substituteParameters.cpp \
frontends/p4/parserControlFlow.cpp \
frontends/p4/reservedWords.cpp \
frontends/p4/coreLibrary.cpp \
frontends/p4/modelInstances.cpp \
frontends/p4/externInstance.cpp \
frontends/p4/methodInstance.cpp \
frontends/p4/parserCallGraph.cpp \
Expand All @@ -40,7 +40,6 @@ p4_frontend_UNIFIED = \
frontends/p4/substitution.cpp \
frontends/p4/substitutionVisitor.cpp \
frontends/p4/fromv1.0/programStructure.cpp \
frontends/p4/fromv1.0/v1model.cpp \
frontends/p4/fromv1.0/converters.cpp \
frontends/p4/typeMap.cpp \
frontends/p4/simplifyDefUse.cpp \
Expand Down
23 changes: 0 additions & 23 deletions frontends/p4/fromv1.0/v1model.cpp

This file was deleted.

10 changes: 10 additions & 0 deletions frontends/p4/coreLibrary.cpp → frontends/p4/modelInstances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,19 @@ limitations under the License.
*/

#include "coreLibrary.h"
#include "fromv1.0/v1model.h"

namespace P4 {

P4CoreLibrary P4CoreLibrary::instance;

} // namespace P4

/* These must be in the same compiliation unit to ensure that P4CoreLibrary::instance
* is initialized before V1Model::instance */
namespace P4V1 {

V1Model V1Model::instance;

} // namespace P4V1