@@ -34,7 +34,7 @@ namespace mlir {
3434
3535namespace patchestry ::passes { // NOLINT
3636
37- struct PatchOptions ;
37+ struct InstrumentationOptions ;
3838
3939 /* *
4040 * @brief Registers instrumentation passes with the MLIR pass registry.
@@ -45,7 +45,7 @@ namespace patchestry::passes { // NOLINT
4545 * instrumentation rules.
4646 *
4747 * @param configuration_file Path to the YAML Patchestry configuration file containing
48- * instrumentation rules
48+ * instrumentation rules for applying patches, contracts, or both
4949 */
5050 void registerInstrumentationPasses (std::string configuration_file);
5151
@@ -56,18 +56,18 @@ namespace patchestry::passes { // NOLINT
5656 * instance.
5757 *
5858 * @param configuration_file Path to the YAML configuration file
59- * @param patch_options Configuration options for controlling function inlining behavior
59+ * @param options Configuration options for controlling how instrumentation is generally applied
6060 * @return std::unique_ptr<mlir::Pass> A unique pointer to the created InstrumentationPass
6161 */
6262 std::unique_ptr< mlir::Pass >
63- createInstrumentationPass (const std::string &configuration_file, const PatchOptions &patch_options );
63+ createInstrumentationPass (const std::string &configuration_file, const InstrumentationOptions &options );
6464
6565 /* *
66- * @brief Configuration options for controlling patching behavior.
66+ * @brief Configuration options for controlling instrumentation behavior.
6767 */
68- struct PatchOptions
68+ struct InstrumentationOptions
6969 {
70- /* * @brief Flag to enable or disable function inlining of patch functions */
70+ /* * @brief Flag to enable or disable function inlining of instrumentation functions */
7171 bool enable_inlining;
7272 };
7373
@@ -81,9 +81,9 @@ namespace patchestry::passes { // NOLINT
8181 * @brief MLIR pass that applies code instrumentation based on configuration.
8282 *
8383 * The InstrumentationPass is an MLIR transformation pass that modifies MLIR modules
84- * by applying patches according to specifications defined in a YAML configuration file.
85- * It can instrument function calls and operations by inserting patch code before, after,
86- * or replacing the original operations entirely.
84+ * by instrumenting according to specifications defined in a YAML configuration file.
85+ * It can instrument function calls and operations by inserting patch or contract code
86+ * before or after, or by replacing an original operation entirely with a patch .
8787 *
8888 * The pass supports three main instrumentation modes:
8989 * - APPLY_BEFORE: Insert patch code before the matched operation
@@ -100,28 +100,28 @@ namespace patchestry::passes { // NOLINT
100100 /* * @brief Path to the YAML Patchestry configuration file */
101101 std::string configuration_file;
102102
103- /* * @brief Parsed patch configuration from the file */
103+ /* * @brief Parsed patch- or contract-specific configuration from the file */
104104 std::optional< Configuration > config;
105105
106106 /* * @brief List of operations to be inlined after instrumentation */
107107 std::vector< mlir::Operation * > inline_worklists;
108108
109109 /* * @brief Reference to inlining configuration options */
110- const PatchOptions &patch_options ;
110+ const InstrumentationOptions &options ;
111111
112112 public:
113113 /* *
114114 * @brief Constructs an InstrumentationPass with the given configuration file and
115115 * options.
116116 *
117- * The constructor loads and parses the configuration YAML file, validates patch files,
118- * and prepares the pass for execution. If a file cannot be loaded or
119- * parsed, appropriate error messages are logged.
117+ * The constructor loads and parses the configuration YAML file, validates the indicated
118+ * patches and/or contracts, and prepares the pass for execution. If a file cannot be
119+ * loaded or parsed, appropriate error messages are logged.
120120 *
121121 * @param configuration_file Path to the YAML configuration file
122122 * @param inline_options Reference to inlining configuration options
123123 */
124- explicit InstrumentationPass (std::string configuration_file, const PatchOptions &patch_options );
124+ explicit InstrumentationPass (std::string configuration_file, const InstrumentationOptions &options );
125125
126126 /* *
127127 * @brief Main entry point for the pass execution.
0 commit comments