From 2c369d22d40e10b4a6edfdd4774faff957968598 Mon Sep 17 00:00:00 2001 From: Hideto Ueno Date: Fri, 15 Nov 2024 00:03:09 +0900 Subject: [PATCH] save --- lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp | 3 ++- lib/Dialect/FIRRTL/Transforms/LowerLayers.cpp | 4 ++-- lib/Dialect/FIRRTL/Transforms/LowerMemory.cpp | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp b/lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp index 54a97fb86849..d976b97e3ec5 100644 --- a/lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp +++ b/lib/Dialect/FIRRTL/Transforms/LowerAnnotations.cpp @@ -298,13 +298,14 @@ applyConventionOrTypeLoweringAnno(const AnnoPathValue &target, auto conventionStrAttr = tryGetAs(anno, anno, "convention", loc, conventionAnnoClass); - if (!conventionStrAttr) return failure(); + auto conventionStr = conventionStrAttr.getValue(); auto conventionOpt = parseConvention(conventionStr); if (!conventionOpt) return error() << "unknown convention " << conventionStr; + auto convention = *conventionOpt; if (convention == Convention::Internal) diff --git a/lib/Dialect/FIRRTL/Transforms/LowerLayers.cpp b/lib/Dialect/FIRRTL/Transforms/LowerLayers.cpp index f3d4a247d9df..699fd552008c 100644 --- a/lib/Dialect/FIRRTL/Transforms/LowerLayers.cpp +++ b/lib/Dialect/FIRRTL/Transforms/LowerLayers.cpp @@ -209,8 +209,8 @@ FModuleOp LowerLayersPass::buildNewModule(OpBuilder &builder, llvm::sys::SmartScopedLock instrumentationLock(*circuitMutex); FModuleOp newModule = builder.create( location, builder.getStringAttr(namehint), - ConventionAttr::get(builder.getContext(), Convention::Internal), - ports, ArrayAttr{}); + ConventionAttr::get(builder.getContext(), Convention::Internal), ports, + ArrayAttr{}); if (auto dir = getOutputFile(layerBlock.getLayerNameAttr())) { assert(dir.isDirectory()); newModule->setAttr("output_file", dir); diff --git a/lib/Dialect/FIRRTL/Transforms/LowerMemory.cpp b/lib/Dialect/FIRRTL/Transforms/LowerMemory.cpp index 96bfbe375614..a8c65793d3d8 100644 --- a/lib/Dialect/FIRRTL/Transforms/LowerMemory.cpp +++ b/lib/Dialect/FIRRTL/Transforms/LowerMemory.cpp @@ -252,8 +252,7 @@ void LowerMemoryPass::lowerMemory(MemOp mem, const FirMemory &summary, OpBuilder b(mem->getParentOfType()); auto wrapper = b.create( mem->getLoc(), wrapperName, - ConventionAttr::get(context, Convention::Internal), - ports); + ConventionAttr::get(context, Convention::Internal), ports); SymbolTable::setSymbolVisibility(wrapper, SymbolTable::Visibility::Private); // Create an instance of the external memory module. The instance has the