summaryrefslogtreecommitdiff
path: root/mlir/lib/Tools/PDLL/ODS/Operation.cpp
blob: 7e708be1ae4d1146470be71e9f8ded510c2759b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//===- Operation.cpp ------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "mlir/Tools/PDLL/ODS/Operation.h"
#include "mlir/Support/IndentedOstream.h"
#include "llvm/Support/raw_ostream.h"

using namespace mlir;
using namespace mlir::pdll::ods;

//===----------------------------------------------------------------------===//
// Operation
//===----------------------------------------------------------------------===//

Operation::Operation(StringRef name, StringRef summary, StringRef desc,
                     StringRef nativeClassName, bool supportsTypeInferrence,
                     llvm::SMLoc loc)
    : name(name.str()), summary(summary.str()), description(desc.str()),
      nativeClassName(nativeClassName.str()),
      supportsTypeInferrence(supportsTypeInferrence),
      location(loc, llvm::SMLoc::getFromPointer(loc.getPointer() + 1)) {}