2018-06-22 00:49:33 +08:00
|
|
|
//===- Function.cpp - MLIR Function Classes -------------------------------===//
|
|
|
|
//
|
|
|
|
// Copyright 2019 The MLIR Authors.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
// =============================================================================
|
|
|
|
|
2018-06-24 07:03:42 +08:00
|
|
|
#include "mlir/IR/CFGFunction.h"
|
2018-06-29 08:02:32 +08:00
|
|
|
#include "mlir/IR/MLFunction.h"
|
2018-06-24 07:03:42 +08:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2018-06-22 00:49:33 +08:00
|
|
|
using namespace mlir;
|
|
|
|
|
2018-06-24 07:03:42 +08:00
|
|
|
Function::Function(StringRef name, FunctionType *type, Kind kind)
|
|
|
|
: kind(kind), name(name.str()), type(type) {
|
2018-06-22 00:49:33 +08:00
|
|
|
}
|
|
|
|
|
2018-06-24 07:03:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// ExtFunction implementation.
|
|
|
|
//===----------------------------------------------------------------------===//
|
2018-06-23 13:03:48 +08:00
|
|
|
|
2018-06-24 07:03:42 +08:00
|
|
|
ExtFunction::ExtFunction(StringRef name, FunctionType *type)
|
|
|
|
: Function(name, type, Kind::ExtFunc) {
|
2018-06-22 06:22:42 +08:00
|
|
|
}
|
|
|
|
|
2018-06-24 07:03:42 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// CFGFunction implementation.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
CFGFunction::CFGFunction(StringRef name, FunctionType *type)
|
|
|
|
: Function(name, type, Kind::CFGFunc) {
|
2018-06-22 06:22:42 +08:00
|
|
|
}
|
2018-06-29 08:02:32 +08:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// MLFunction implementation.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
MLFunction::MLFunction(StringRef name, FunctionType *type)
|
|
|
|
: Function(name, type, Kind::MLFunc) {
|
|
|
|
}
|