CIRCT 20.0.0git
Loading...
Searching...
No Matches
StripEmit.cpp
Go to the documentation of this file.
1//===- StripEmit.cpp ------------------------------------------------------===//
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
11#include "mlir/Pass/Pass.h"
12#include "llvm/Support/Debug.h"
13
14namespace circt {
15namespace emit {
16#define GEN_PASS_DEF_STRIPEMITPASS
17#include "circt/Dialect/Emit/EmitPasses.h.inc"
18} // namespace emit
19} // namespace circt
20
21using namespace mlir;
22using namespace circt;
23
24namespace {
25struct StripEmitPass : public emit::impl::StripEmitPassBase<StripEmitPass> {
26 void runOnOperation() override {
27 for (auto &op : llvm::make_early_inc_range(getOperation().getOps())) {
28 if (isa_and_nonnull<emit::EmitDialect>(op.getDialect())) {
29 op.erase();
30 continue;
31 }
32 op.removeAttr("emit.fragments");
33 }
34 }
35};
36} // namespace
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition emit.py:1