CIRCT 20.0.0git
Loading...
Searching...
No Matches
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
16namespace circt {
17namespace esi {
18#define GEN_PASS_DEF_ESICLEANMETADATA
19#include "circt/Dialect/ESI/ESIPasses.h.inc"
20} // namespace esi
21} // namespace circt
22
23using namespace circt;
24using namespace esi;
25
26namespace {
27struct ESICleanMetadataPass
28 : public circt::esi::impl::ESICleanMetadataBase<ESICleanMetadataPass> {
29 void runOnOperation() override;
30};
31} // anonymous namespace
32
33void 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
44std::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 esi.py:1