//===- Interfaces.cpp - Interface classes ---------------------------------===// // // 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/TableGen/Interfaces.h" #include "llvm/ADT/FunctionExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSet.h" #include "llvm/Support/FormatVariadic.h" #include "llvm/TableGen/Error.h" #include "llvm/TableGen/Record.h" usingnamespacemlir; usingnamespacemlir::tblgen; //===----------------------------------------------------------------------===// // InterfaceMethod //===----------------------------------------------------------------------===// InterfaceMethod::InterfaceMethod(const llvm::Record *def) : … { … } StringRef InterfaceMethod::getReturnType() const { … } // Return the name of this method. StringRef InterfaceMethod::getName() const { … } // Return if this method is static. bool InterfaceMethod::isStatic() const { … } // Return the body for this method if it has one. std::optional<StringRef> InterfaceMethod::getBody() const { … } // Return the default implementation for this method if it has one. std::optional<StringRef> InterfaceMethod::getDefaultImplementation() const { … } // Return the description of this method if it has one. std::optional<StringRef> InterfaceMethod::getDescription() const { … } ArrayRef<InterfaceMethod::Argument> InterfaceMethod::getArguments() const { … } bool InterfaceMethod::arg_empty() const { … } //===----------------------------------------------------------------------===// // Interface //===----------------------------------------------------------------------===// Interface::Interface(const llvm::Record *def) : … { … } // Return the name of this interface. StringRef Interface::getName() const { … } // Returns this interface's name prefixed with namespaces. std::string Interface::getFullyQualifiedName() const { … } // Return the C++ namespace of this interface. StringRef Interface::getCppNamespace() const { … } // Return the methods of this interface. ArrayRef<InterfaceMethod> Interface::getMethods() const { … } // Return the description of this method if it has one. std::optional<StringRef> Interface::getDescription() const { … } // Return the interfaces extra class declaration code. std::optional<StringRef> Interface::getExtraClassDeclaration() const { … } // Return the traits extra class declaration code. std::optional<StringRef> Interface::getExtraTraitClassDeclaration() const { … } // Return the shared extra class declaration code. std::optional<StringRef> Interface::getExtraSharedClassDeclaration() const { … } std::optional<StringRef> Interface::getExtraClassOf() const { … } // Return the body for this method if it has one. std::optional<StringRef> Interface::getVerify() const { … } bool Interface::verifyWithRegions() const { … } //===----------------------------------------------------------------------===// // AttrInterface //===----------------------------------------------------------------------===// bool AttrInterface::classof(const Interface *interface) { … } //===----------------------------------------------------------------------===// // OpInterface //===----------------------------------------------------------------------===// bool OpInterface::classof(const Interface *interface) { … } //===----------------------------------------------------------------------===// // TypeInterface //===----------------------------------------------------------------------===// bool TypeInterface::classof(const Interface *interface) { … }