[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / mlir / test / lib / Analysis / TestLiveness.cpp
blobe4ea521484bf2ff0d686ab74d53fc7320ebf6386
1 //===- TestLiveness.cpp - Test liveness construction and information ------===//
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 //
9 // This file contains test passes for constructing and resolving liveness
10 // information.
12 //===----------------------------------------------------------------------===//
14 #include "mlir/Analysis/Liveness.h"
15 #include "mlir/IR/SymbolTable.h"
16 #include "mlir/Pass/Pass.h"
18 using namespace mlir;
20 namespace {
22 struct TestLivenessPass
23 : public PassWrapper<TestLivenessPass, InterfacePass<SymbolOpInterface>> {
24 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestLivenessPass)
26 StringRef getArgument() const final { return "test-print-liveness"; }
27 StringRef getDescription() const final {
28 return "Print the contents of a constructed liveness information.";
30 void runOnOperation() override {
31 llvm::errs() << "Testing : " << getOperation().getName() << "\n";
32 getAnalysis<Liveness>().print(llvm::errs());
36 } // namespace
38 namespace mlir {
39 namespace test {
40 void registerTestLivenessPass() { PassRegistration<TestLivenessPass>(); }
41 } // namespace test
42 } // namespace mlir