Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | //===--- LLVM.h - Import various common LLVM datatypes ----------*- 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 | /// \file |
||
10 | /// Forward-declares and imports various common LLVM datatypes that |
||
11 | /// clang wants to use unqualified. |
||
12 | /// |
||
13 | //===----------------------------------------------------------------------===// |
||
14 | |||
15 | #ifndef LLVM_CLANG_BASIC_LLVM_H |
||
16 | #define LLVM_CLANG_BASIC_LLVM_H |
||
17 | |||
18 | // Do not proliferate #includes here, require clients to #include their |
||
19 | // dependencies. |
||
20 | // Casting.h has complex templates that cannot be easily forward declared. |
||
21 | #include "llvm/Support/Casting.h" |
||
22 | // None.h includes an enumerator that is desired & cannot be forward declared |
||
23 | // without a definition of NoneType. |
||
24 | #include "llvm/ADT/None.h" |
||
25 | // Add this header as a workaround to prevent `too few template arguments for |
||
26 | // class template 'SmallVector'` building error with build compilers like XL. |
||
27 | #include "llvm/ADT/SmallVector.h" |
||
28 | |||
29 | namespace llvm { |
||
30 | // ADT's. |
||
31 | class StringRef; |
||
32 | class Twine; |
||
33 | class VersionTuple; |
||
34 | template<typename T> class ArrayRef; |
||
35 | template<typename T> class MutableArrayRef; |
||
36 | template<typename T> class OwningArrayRef; |
||
37 | template<unsigned InternalLen> class SmallString; |
||
38 | template<typename T, unsigned N> class SmallVector; |
||
39 | template<typename T> class SmallVectorImpl; |
||
40 | template <typename T> using Optional = std::optional<T>; |
||
41 | template <class T> class Expected; |
||
42 | |||
43 | template<typename T> |
||
44 | struct SaveAndRestore; |
||
45 | |||
46 | // Reference counting. |
||
47 | template <typename T> class IntrusiveRefCntPtr; |
||
48 | template <typename T> struct IntrusiveRefCntPtrInfo; |
||
49 | template <class Derived> class RefCountedBase; |
||
50 | |||
51 | class raw_ostream; |
||
52 | class raw_pwrite_stream; |
||
53 | // TODO: DenseMap, ... |
||
54 | } |
||
55 | |||
56 | |||
57 | namespace clang { |
||
58 | // Casting operators. |
||
59 | using llvm::isa; |
||
60 | using llvm::isa_and_nonnull; |
||
61 | using llvm::isa_and_present; |
||
62 | using llvm::cast; |
||
63 | using llvm::dyn_cast; |
||
64 | using llvm::dyn_cast_or_null; |
||
65 | using llvm::dyn_cast_if_present; |
||
66 | using llvm::cast_or_null; |
||
67 | using llvm::cast_if_present; |
||
68 | |||
69 | // ADT's. |
||
70 | using llvm::ArrayRef; |
||
71 | using llvm::MutableArrayRef; |
||
72 | using llvm::Optional; |
||
73 | using llvm::OwningArrayRef; |
||
74 | using llvm::SaveAndRestore; |
||
75 | using llvm::SmallString; |
||
76 | using llvm::SmallVector; |
||
77 | using llvm::SmallVectorImpl; |
||
78 | using llvm::StringRef; |
||
79 | using llvm::Twine; |
||
80 | using llvm::VersionTuple; |
||
81 | |||
82 | // Error handling. |
||
83 | using llvm::Expected; |
||
84 | |||
85 | // Reference counting. |
||
86 | using llvm::IntrusiveRefCntPtr; |
||
87 | using llvm::IntrusiveRefCntPtrInfo; |
||
88 | using llvm::RefCountedBase; |
||
89 | |||
90 | using llvm::raw_ostream; |
||
91 | using llvm::raw_pwrite_stream; |
||
92 | } // end namespace clang. |
||
93 | |||
94 | #endif |