MLIR
15.0.0git
include
mlir
Support
LLVM.h
Go to the documentation of this file.
1
//===- LLVM.h - Import and forward declare core LLVM types ------*- C++ -*-===//
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 forward declares and imports various common LLVM datatypes that
10
// MLIR wants to use unqualified.
11
//
12
// Note that most of these are forward declared and then imported into the MLIR
13
// namespace with using decls, rather than being #included. This is because we
14
// want clients to explicitly #include the files they need.
15
//
16
//===----------------------------------------------------------------------===//
17
18
#ifndef MLIR_SUPPORT_LLVM_H
19
#define MLIR_SUPPORT_LLVM_H
20
21
// We include these two headers because they cannot be practically forward
22
// declared, and are effectively language features.
23
#include "llvm/ADT/None.h"
24
#include "llvm/Support/Casting.h"
25
#include <vector>
26
27
// Workaround for clang-5 (PR41549)
28
#if defined(__clang_major__)
29
#if __clang_major__ <= 5
30
#include "llvm/ADT/DenseMapInfo.h"
31
#include "llvm/ADT/SmallVector.h"
32
#endif
33
#endif
34
35
// Forward declarations.
36
namespace
llvm
{
37
// String types
38
template
<
unsigned
N>
class
SmallString
;
39
class
StringRef;
40
class
StringLiteral;
41
class
Twine;
42
43
// Containers.
44
template
<
typename
T>
class
ArrayRef
;
45
class
BitVector;
46
namespace
detail {
47
template
<
typename
KeyT,
typename
ValueT>
struct
DenseMapPair
;
48
}
// namespace detail
49
template
<
typename
KeyT,
typename
ValueT,
typename
KeyInfoT,
typename
BucketT>
50
class
DenseMap
;
51
template
<
typename
T,
typename
Enable>
struct
DenseMapInfo
;
52
template
<
typename
ValueT,
typename
ValueInfoT>
class
DenseSet
;
53
class
MallocAllocator;
54
template
<
typename
T>
class
MutableArrayRef
;
55
template
<
typename
T>
class
Optional
;
56
template
<
typename
... PT>
class
PointerUnion
;
57
template
<
typename
T,
typename
Vector,
typename
Set>
class
SetVector
;
58
template
<
typename
T,
unsigned
N>
class
SmallPtrSet
;
59
template
<
typename
T>
class
SmallPtrSetImpl
;
60
template
<
typename
T,
unsigned
N>
class
SmallVector
;
61
template
<
typename
T>
class
SmallVectorImpl
;
62
template
<
typename
AllocatorTy>
class
StringSet
;
63
template
<
typename
T,
typename
R>
class
StringSwitch
;
64
template
<
typename
T>
class
TinyPtrVector
;
65
template
<
typename
T,
typename
ResultT>
class
TypeSwitch
;
66
67
// Other common classes.
68
class
APInt;
69
class
APSInt;
70
class
APFloat;
71
template
<
typename
Fn>
class
function_ref
;
72
template
<
typename
IteratorT>
class
iterator_range
;
73
class
raw_ostream;
74
class
SMLoc;
75
class
SMRange;
76
}
// namespace llvm
77
78
namespace
mlir
{
79
// Casting operators.
80
using
llvm::cast;
81
using
llvm::cast_or_null;
82
using
llvm::dyn_cast;
83
using
llvm::dyn_cast_or_null;
84
using
llvm::isa;
85
using
llvm::isa_and_nonnull;
86
87
// String types
88
using
llvm::SmallString
;
89
using
llvm::StringLiteral;
90
using
llvm::StringRef;
91
using
llvm::Twine;
92
93
// Container Related types
94
//
95
// Containers.
96
using
llvm::ArrayRef
;
97
using
llvm::BitVector;
98
template
<
typename
T,
typename
Enable =
void
>
99
using
DenseMapInfo
=
llvm::DenseMapInfo<T, Enable>
;
100
template
<
typename
KeyT,
typename
ValueT,
101
typename
KeyInfoT =
DenseMapInfo<KeyT>
,
102
typename
BucketT =
llvm::detail::DenseMapPair<KeyT, ValueT>
>
103
using
DenseMap
=
llvm::DenseMap<KeyT, ValueT, KeyInfoT, BucketT>
;
104
template
<
typename
ValueT,
typename
ValueInfoT = DenseMapInfo<ValueT>>
105
using
DenseSet
=
llvm::DenseSet<ValueT, ValueInfoT>
;
106
template
<
typename
T,
typename
Vector = std::vector<T>,
107
typename
Set = DenseSet<T>>
108
using
SetVector
=
llvm::SetVector<T, Vector, Set>
;
109
template
<
typename
AllocatorTy = llvm::MallocAllocator>
110
using
StringSet
=
llvm::StringSet<AllocatorTy>
;
111
using
llvm::MutableArrayRef
;
112
using
llvm::None;
113
using
llvm::Optional
;
114
using
llvm::PointerUnion
;
115
using
llvm::SmallPtrSet
;
116
using
llvm::SmallPtrSetImpl
;
117
using
llvm::SmallVector
;
118
using
llvm::SmallVectorImpl
;
119
template
<
typename
T,
typename
R = T>
120
using
StringSwitch
=
llvm::StringSwitch<T, R>
;
121
using
llvm::TinyPtrVector
;
122
template
<
typename
T,
typename
ResultT =
void
>
123
using
TypeSwitch
=
llvm::TypeSwitch<T, ResultT>
;
124
125
// Other common classes.
126
using
llvm::APFloat;
127
using
llvm::APInt;
128
using
llvm::APSInt;
129
template
<
typename
Fn>
using
function_ref
=
llvm::function_ref<Fn>
;
130
using
llvm::iterator_range
;
131
using
llvm::raw_ostream;
132
using
llvm::SMLoc;
133
using
llvm::SMRange;
134
}
// namespace mlir
135
136
#endif // MLIR_SUPPORT_LLVM_H
mlir
TODO: Remove this file when SCCP and integer range analysis have been ported to the new framework...
Definition:
LocalAliasAnalysis.h:20
llvm
The OpAsmOpInterface, see OpAsmInterface.td for more details.
Definition:
CallGraph.h:221
llvm::DenseSet
Definition:
LLVM.h:52
llvm::DenseMap
Definition:
LLVM.h:50
mlir::pdll::ods::Optional
Definition:
Operation.h:31
llvm::DenseMapInfo
Definition:
LLVM.h:51
llvm::function_ref
Definition:
LLVM.h:71
llvm::TypeSwitch
Definition:
LLVM.h:65
llvm::TinyPtrVector
Definition:
LLVM.h:64
llvm::SmallPtrSetImpl
Definition:
LLVM.h:59
llvm::Optional
Definition:
LLVM.h:55
llvm::SmallVectorImpl
Definition:
LLVM.h:61
llvm::ArrayRef
Definition:
LLVM.h:44
llvm::SmallString
Definition:
LLVM.h:38
llvm::detail::DenseMapPair
Definition:
LLVM.h:47
llvm::StringSwitch
Definition:
LLVM.h:63
llvm::MutableArrayRef
Definition:
LLVM.h:54
llvm::SmallPtrSet
Definition:
LLVM.h:58
llvm::SmallVector
Definition:
LLVM.h:60
llvm::iterator_range
Definition:
LLVM.h:72
llvm::SetVector
Definition:
LLVM.h:57
llvm::StringSet
Definition:
LLVM.h:62
llvm::PointerUnion
Definition:
LLVM.h:56
Generated on Thu Jul 7 2022 00:39:58 for MLIR by
1.8.13