clang  14.0.0git
LLVM.h
Go to the documentation of this file.
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> class Optional;
41  template <class T> class Expected;
42 
43  template<typename T>
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::cast;
62  using llvm::dyn_cast;
63  using llvm::dyn_cast_or_null;
64  using llvm::cast_or_null;
65 
66  // ADT's.
67  using llvm::ArrayRef;
69  using llvm::None;
70  using llvm::Optional;
73  using llvm::SmallString;
74  using llvm::SmallVector;
76  using llvm::StringRef;
77  using llvm::Twine;
78  using llvm::VersionTuple;
79 
80  // Error handling.
81  using llvm::Expected;
82 
83  // Reference counting.
87 
88  using llvm::raw_ostream;
89  using llvm::raw_pwrite_stream;
90 } // end namespace clang.
91 
92 #endif
llvm
Definition: Dominators.h:30
llvm::OwningArrayRef
Definition: LLVM.h:36
Optional
llvm::Optional< T > Optional
Definition: ByteCodeExprGen.cpp:23
llvm::SmallVector
Definition: LLVM.h:38
clang::cast
U cast(CodeGen::Address addr)
Definition: Address.h:108
llvm::Optional
Definition: LLVM.h:40
llvm::Expected
Definition: LLVM.h:41
llvm::RefCountedBase
Definition: LLVM.h:49
Expected
llvm::Expected< T > Expected
Definition: ByteCodeExprGen.cpp:22
llvm::MutableArrayRef
Definition: LLVM.h:35
clang::isa
bool isa(CodeGen::Address addr)
Definition: Address.h:111
llvm::SmallString
Definition: LLVM.h:37
llvm::ArrayRef
Definition: LLVM.h:34
llvm::IntrusiveRefCntPtrInfo
Definition: LLVM.h:48
llvm::SaveAndRestore
Definition: LLVM.h:44
clang
Definition: CalledOnceCheck.h:17
llvm::SmallVectorImpl
Definition: LLVM.h:39
llvm::IntrusiveRefCntPtr
Definition: LLVM.h:47