CIRCT  19.0.0git
ESICleanMetadata.cpp
Go to the documentation of this file.
1 //===- ESICleanMetadata.cpp - Clean ESI metadata ----------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // ESI clean metadata pass.
9 //===----------------------------------------------------------------------===//
10 
11 #include "../PassDetails.h"
12 
15 
16 using namespace circt;
17 using namespace esi;
18 
19 namespace {
20 struct ESICleanMetadataPass
21  : public ESICleanMetadataBase<ESICleanMetadataPass> {
22  void runOnOperation() override;
23 };
24 } // anonymous namespace
25 
26 void ESICleanMetadataPass::runOnOperation() {
27  auto mod = getOperation();
28 
29  mod.walk([&](Operation *op) {
30  TypeSwitch<Operation *>(op)
31  .Case<ServiceDeclOpInterface, ServiceImplRecordOp,
32  ServiceRequestRecordOp, AppIDHierRootOp, IsManifestData>(
33  [](Operation *op) { op->erase(); });
34  });
35 }
36 
37 std::unique_ptr<OperationPass<ModuleOp>>
39  return std::make_unique<ESICleanMetadataPass>();
40 }
std::unique_ptr< OperationPass< ModuleOp > > createESICleanMetadataPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: esi.py:1