Skip to content

Commit

Permalink
Merge pull request #483 from j2kun:unique-template-names
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 613348219
  • Loading branch information
Copybara-Service committed Mar 6, 2024
2 parents b89c682 + 3578947 commit 77d472b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/Conversion/CGGIToTfheRust/CGGIToTfheRust.cpp
Expand Up @@ -84,9 +84,9 @@ int widthFromEncodingAttr(Attribute encoding) {
});
}

class PassTypeConverter : public TypeConverter {
class CGGIToTfheRustTypeConverter : public TypeConverter {
public:
PassTypeConverter(MLIRContext *ctx) {
CGGIToTfheRustTypeConverter(MLIRContext *ctx) {
addConversion([](Type type) { return type; });
addConversion([ctx](lwe::LWECiphertextType type) -> Type {
int width = widthFromEncodingAttr(type.getEncoding());
Expand Down Expand Up @@ -402,7 +402,7 @@ class CGGIToTfheRust : public impl::CGGIToTfheRustBase<CGGIToTfheRust> {
MLIRContext *context = &getContext();
auto *op = getOperation();

PassTypeConverter typeConverter(context);
CGGIToTfheRustTypeConverter typeConverter(context);
RewritePatternSet patterns(context);
ConversionTarget target(*context);
addStructuralConversionPatterns(typeConverter, patterns, target);
Expand Down
6 changes: 3 additions & 3 deletions templates/Conversion/lib/ConversionPass.cpp.jinja
Expand Up @@ -11,9 +11,9 @@ namespace mlir::heir {
#include "include/Conversion/{{ pass_name }}/{{ pass_name }}.h.inc"

// Remove this class if no type conversions are necessary
class PassTypeConverter : public TypeConverter {
class {{ pass_name }}TypeConverter : public TypeConverter {
public:
PassTypeConverter(MLIRContext *ctx) {
{{ pass_name }}TypeConverter(MLIRContext *ctx) {
addConversion([](Type type) { return type; });
// FIXME: implement, replace FooType with the type that needs
// to be converted or remove this class
Expand Down Expand Up @@ -42,7 +42,7 @@ struct {{ pass_name }} : public impl::{{ pass_name }}Base<{{ pass_name }}> {
void runOnOperation() override {
MLIRContext *context = &getContext();
auto *module = getOperation();
PassTypeConverter typeConverter(context);
{{ pass_name }}TypeConverter typeConverter(context);

RewritePatternSet patterns(context);
ConversionTarget target(*context);
Expand Down

0 comments on commit 77d472b

Please sign in to comment.