CIRCT  20.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 namespace circt {
17 namespace esi {
18 #define GEN_PASS_DEF_ESICLEANMETADATA
19 #include "circt/Dialect/ESI/ESIPasses.h.inc"
20 } // namespace esi
21 } // namespace circt
22 
23 using namespace circt;
24 using namespace esi;
25 
26 namespace {
27 struct ESICleanMetadataPass
28  : public circt::esi::impl::ESICleanMetadataBase<ESICleanMetadataPass> {
29  void runOnOperation() override;
30 };
31 } // anonymous namespace
32 
33 void ESICleanMetadataPass::runOnOperation() {
34  auto mod = getOperation();
35 
36  mod.walk([&](Operation *op) {
37  TypeSwitch<Operation *>(op)
38  .Case<ServiceDeclOpInterface, ServiceImplRecordOp,
39  ServiceRequestRecordOp, AppIDHierRootOp, IsManifestData>(
40  [](Operation *op) { op->erase(); });
41  });
42 }
43 
44 std::unique_ptr<OperationPass<ModuleOp>>
46  return std::make_unique<ESICleanMetadataPass>();
47 }
std::unique_ptr< OperationPass< ModuleOp > > createESICleanMetadataPass()
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: esi.py:1