-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[P4Testgen] Refactor the P4Testgen extern implementation. (#4728)
* Refactor the P4Testgen extern implementation. Signed-off-by: fruffy <fruffy@nyu.edu> * Add if directive for unused code. Signed-off-by: fruffy <fruffy@nyu.edu> --------- Signed-off-by: fruffy <fruffy@nyu.edu>
- Loading branch information
Showing
24 changed files
with
1,460 additions
and
1,522 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_EXTERN_INFO_H_ | ||
#define BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_EXTERN_INFO_H_ | ||
|
||
#include <sys/types.h> | ||
|
||
#include "ir/id.h" | ||
#include "ir/ir.h" | ||
#include "ir/vector.h" | ||
|
||
namespace P4Tools::P4Testgen { | ||
|
||
/// This class defines parameters useful for the invocation of P4 extern and P4Testgen-internal | ||
/// functions. | ||
class ExternInfo { | ||
public: | ||
/// Reference to the original P4 extern call. | ||
const IR::MethodCallExpression &originalCall; | ||
/// Name of the extern object the call was a member of, if any. | ||
const IR::PathExpression &externObjectRef; | ||
/// Name of the extern method. | ||
const IR::ID &methodName; | ||
/// Arguments to the extern method. | ||
const IR::Vector<IR::Argument> &externArguments; | ||
|
||
ExternInfo(const IR::MethodCallExpression &originalCall, | ||
const IR::PathExpression &externObjectRef, const IR::ID &methodName, | ||
const IR::Vector<IR::Argument> &externArguments) | ||
: originalCall(originalCall), | ||
externObjectRef(externObjectRef), | ||
methodName(methodName), | ||
externArguments(externArguments) {} | ||
|
||
/// Do not accidentally copy-assign the extern info. It is only passed as reference. | ||
ExternInfo &operator=(const ExternInfo &) = delete; | ||
ExternInfo &operator=(ExternInfo &&) = delete; | ||
}; | ||
|
||
} // namespace P4Tools::P4Testgen | ||
|
||
#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_CORE_EXTERN_INFO_H_ */ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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.