xref: /openbsd-src/gnu/llvm/clang/include/clang/Basic/LLVM.h (revision 12c855180aad702bbcca06e0398d774beeafb155)
1e5dd7070Spatrick //===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
2e5dd7070Spatrick //
3e5dd7070Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4e5dd7070Spatrick // See https://llvm.org/LICENSE.txt for license information.
5e5dd7070Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6e5dd7070Spatrick //
7e5dd7070Spatrick //===----------------------------------------------------------------------===//
8e5dd7070Spatrick //
9e5dd7070Spatrick /// \file
10e5dd7070Spatrick /// Forward-declares and imports various common LLVM datatypes that
11e5dd7070Spatrick /// clang wants to use unqualified.
12e5dd7070Spatrick ///
13e5dd7070Spatrick //===----------------------------------------------------------------------===//
14e5dd7070Spatrick 
15e5dd7070Spatrick #ifndef LLVM_CLANG_BASIC_LLVM_H
16e5dd7070Spatrick #define LLVM_CLANG_BASIC_LLVM_H
17e5dd7070Spatrick 
18e5dd7070Spatrick // Do not proliferate #includes here, require clients to #include their
19e5dd7070Spatrick // dependencies.
20e5dd7070Spatrick // Casting.h has complex templates that cannot be easily forward declared.
21e5dd7070Spatrick #include "llvm/Support/Casting.h"
22e5dd7070Spatrick // None.h includes an enumerator that is desired & cannot be forward declared
23e5dd7070Spatrick // without a definition of NoneType.
24e5dd7070Spatrick #include "llvm/ADT/None.h"
25a9ac8606Spatrick // Add this header as a workaround to prevent `too few template arguments for
26a9ac8606Spatrick // class template 'SmallVector'` building error with build compilers like XL.
27a9ac8606Spatrick #include "llvm/ADT/SmallVector.h"
28e5dd7070Spatrick 
29e5dd7070Spatrick namespace llvm {
30e5dd7070Spatrick   // ADT's.
31e5dd7070Spatrick   class StringRef;
32e5dd7070Spatrick   class Twine;
33e5dd7070Spatrick   class VersionTuple;
34e5dd7070Spatrick   template<typename T> class ArrayRef;
35e5dd7070Spatrick   template<typename T> class MutableArrayRef;
36e5dd7070Spatrick   template<typename T> class OwningArrayRef;
37e5dd7070Spatrick   template<unsigned InternalLen> class SmallString;
38e5dd7070Spatrick   template<typename T, unsigned N> class SmallVector;
39e5dd7070Spatrick   template<typename T> class SmallVectorImpl;
40*12c85518Srobert   template <typename T> using Optional = std::optional<T>;
41e5dd7070Spatrick   template <class T> class Expected;
42e5dd7070Spatrick 
43e5dd7070Spatrick   template<typename T>
44e5dd7070Spatrick   struct SaveAndRestore;
45e5dd7070Spatrick 
46e5dd7070Spatrick   // Reference counting.
47e5dd7070Spatrick   template <typename T> class IntrusiveRefCntPtr;
48e5dd7070Spatrick   template <typename T> struct IntrusiveRefCntPtrInfo;
49e5dd7070Spatrick   template <class Derived> class RefCountedBase;
50e5dd7070Spatrick 
51e5dd7070Spatrick   class raw_ostream;
52e5dd7070Spatrick   class raw_pwrite_stream;
53e5dd7070Spatrick   // TODO: DenseMap, ...
54e5dd7070Spatrick }
55e5dd7070Spatrick 
56e5dd7070Spatrick 
57e5dd7070Spatrick namespace clang {
58e5dd7070Spatrick   // Casting operators.
59e5dd7070Spatrick   using llvm::isa;
60a9ac8606Spatrick   using llvm::isa_and_nonnull;
61*12c85518Srobert   using llvm::isa_and_present;
62e5dd7070Spatrick   using llvm::cast;
63e5dd7070Spatrick   using llvm::dyn_cast;
64e5dd7070Spatrick   using llvm::dyn_cast_or_null;
65*12c85518Srobert   using llvm::dyn_cast_if_present;
66e5dd7070Spatrick   using llvm::cast_or_null;
67*12c85518Srobert   using llvm::cast_if_present;
68e5dd7070Spatrick 
69e5dd7070Spatrick   // ADT's.
70e5dd7070Spatrick   using llvm::ArrayRef;
71e5dd7070Spatrick   using llvm::MutableArrayRef;
72e5dd7070Spatrick   using llvm::Optional;
73e5dd7070Spatrick   using llvm::OwningArrayRef;
74e5dd7070Spatrick   using llvm::SaveAndRestore;
75e5dd7070Spatrick   using llvm::SmallString;
76e5dd7070Spatrick   using llvm::SmallVector;
77e5dd7070Spatrick   using llvm::SmallVectorImpl;
78e5dd7070Spatrick   using llvm::StringRef;
79e5dd7070Spatrick   using llvm::Twine;
80e5dd7070Spatrick   using llvm::VersionTuple;
81e5dd7070Spatrick 
82e5dd7070Spatrick   // Error handling.
83e5dd7070Spatrick   using llvm::Expected;
84e5dd7070Spatrick 
85e5dd7070Spatrick   // Reference counting.
86e5dd7070Spatrick   using llvm::IntrusiveRefCntPtr;
87e5dd7070Spatrick   using llvm::IntrusiveRefCntPtrInfo;
88e5dd7070Spatrick   using llvm::RefCountedBase;
89e5dd7070Spatrick 
90e5dd7070Spatrick   using llvm::raw_ostream;
91e5dd7070Spatrick   using llvm::raw_pwrite_stream;
92e5dd7070Spatrick } // end namespace clang.
93e5dd7070Spatrick 
94e5dd7070Spatrick #endif
95