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// Add this header as a workaround to prevent `too few template arguments for 23// class template 'SmallVector'` building error with build compilers like XL. 24#include "llvm/ADT/SmallVector.h" 25 26namespace llvm { 27 // ADT's. 28 class StringRef; 29 class Twine; 30 class VersionTuple; 31 template<typename T> class ArrayRef; 32 template<typename T> class MutableArrayRef; 33 template<typename T> class OwningArrayRef; 34 template<unsigned InternalLen> class SmallString; 35 template<typename T, unsigned N> class SmallVector; 36 template<typename T> class SmallVectorImpl; 37 template <class T> class Expected; 38 39 template<typename T> 40 struct SaveAndRestore; 41 42 // Reference counting. 43 template <typename T> class IntrusiveRefCntPtr; 44 template <typename T> struct IntrusiveRefCntPtrInfo; 45 template <class Derived> class RefCountedBase; 46 47 class raw_ostream; 48 class raw_pwrite_stream; 49 // TODO: DenseMap, ... 50} 51 52 53namespace clang { 54 // Casting operators. 55 using llvm::isa; 56 using llvm::isa_and_nonnull; 57 using llvm::isa_and_present; 58 using llvm::cast; 59 using llvm::dyn_cast; 60 using llvm::dyn_cast_or_null; 61 using llvm::dyn_cast_if_present; 62 using llvm::cast_or_null; 63 using llvm::cast_if_present; 64 65 // ADT's. 66 using llvm::ArrayRef; 67 using llvm::MutableArrayRef; 68 using llvm::OwningArrayRef; 69 using llvm::SaveAndRestore; 70 using llvm::SmallString; 71 using llvm::SmallVector; 72 using llvm::SmallVectorImpl; 73 using llvm::StringRef; 74 using llvm::Twine; 75 using llvm::VersionTuple; 76 77 // Error handling. 78 using llvm::Expected; 79 80 // Reference counting. 81 using llvm::IntrusiveRefCntPtr; 82 using llvm::IntrusiveRefCntPtrInfo; 83 using llvm::RefCountedBase; 84 85 using llvm::raw_ostream; 86 using llvm::raw_pwrite_stream; 87} // end namespace clang. 88 89#endif 90