//===- LLVM.h - Import and forward declare core LLVM types ------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// // // This file forward declares and imports various common LLVM datatypes that // MLIR wants to use unqualified. // // Note that most of these are forward declared and then imported into the MLIR // namespace with using decls, rather than being #included. This is because we // want clients to explicitly #include the files they need. // //===----------------------------------------------------------------------===// #ifndef MLIR_SUPPORT_LLVM_H #define MLIR_SUPPORT_LLVM_H // We include this header because it cannot be practically forward // declared, and are effectively language features. #include "llvm/Support/Casting.h" // We include this header because large portions of mlir would have to include // it anyway. #include "llvm/Support/LogicalResult.h" // Forward declarations. namespace llvm { // String types template class SmallString; class StringRef; class StringLiteral; class Twine; // Containers. template class ArrayRef; class BitVector; namespace detail { template struct DenseMapPair; } // namespace detail template class DenseMap; template struct DenseMapInfo; template class DenseSet; class MallocAllocator; template class MutableArrayRef; template class PointerUnion; template class SetVector; template class SmallPtrSet; template class SmallPtrSetImpl; template class SmallVector; template class SmallVectorImpl; template class StringSet; template class StringSwitch; template struct Repeated; template class TinyPtrVector; template class TypeSwitch; // Other common classes. class APInt; class DynamicAPInt; class APSInt; class APFloat; template class function_ref; template class iterator_range; class raw_ostream; class SMLoc; class SMRange; } // namespace llvm namespace mlir { // Casting operators. using llvm::cast; using llvm::cast_if_present; using llvm::cast_or_null; using llvm::dyn_cast; using llvm::dyn_cast_if_present; using llvm::dyn_cast_or_null; using llvm::isa; using llvm::isa_and_nonnull; using llvm::isa_and_present; // String types using llvm::SmallString; using llvm::StringLiteral; using llvm::StringRef; using llvm::Twine; // Container Related types // // Containers. using llvm::ArrayRef; using llvm::BitVector; template using DenseMapInfo = llvm::DenseMapInfo; template , typename BucketT = llvm::detail::DenseMapPair> using DenseMap = llvm::DenseMap; template > using DenseSet = llvm::DenseSet; template , typename Set = DenseSet, unsigned N = 0> using SetVector = llvm::SetVector; template using StringSet = llvm::StringSet; using llvm::MutableArrayRef; using llvm::PointerUnion; using llvm::Repeated; using llvm::SmallPtrSet; using llvm::SmallPtrSetImpl; using llvm::SmallVector; using llvm::SmallVectorImpl; template using StringSwitch = llvm::StringSwitch; using llvm::TinyPtrVector; template using TypeSwitch = llvm::TypeSwitch; // Other common classes. using llvm::APFloat; using llvm::APInt; using llvm::APSInt; using llvm::DynamicAPInt; template using function_ref = llvm::function_ref; using llvm::iterator_range; using llvm::raw_ostream; using llvm::SMLoc; using llvm::SMRange; // LogicalResult. using llvm::failed; using llvm::failure; using llvm::FailureOr; using llvm::LogicalResult; using llvm::ParseResult; using llvm::succeeded; using llvm::success; } // namespace mlir #endif // MLIR_SUPPORT_LLVM_H