]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lld/include/lld/Common/LLVM.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lld / include / lld / Common / LLVM.h
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 // This file forward declares and imports various common LLVM datatypes that
10 // lld wants to use unqualified.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLD_COMMON_LLVM_H
15 #define LLD_COMMON_LLVM_H
16
17 // This should be the only #include, force #includes of all the others on
18 // clients.
19 #include "llvm/ADT/Hashing.h"
20 #include "llvm/Support/Casting.h"
21 #include <utility>
22
23 namespace llvm {
24 // ADT's.
25 class raw_ostream;
26 class Error;
27 class StringRef;
28 class Twine;
29 class MemoryBuffer;
30 class MemoryBufferRef;
31 template <typename T> class ArrayRef;
32 template <typename T> class MutableArrayRef;
33 template <unsigned InternalLen> class SmallString;
34 template <typename T, unsigned N> class SmallVector;
35 template <typename T> class ErrorOr;
36 template <typename T> class Expected;
37
38 namespace object {
39 class WasmObjectFile;
40 struct WasmSection;
41 struct WasmSegment;
42 class WasmSymbol;
43 } // namespace object
44
45 namespace wasm {
46 struct WasmEvent;
47 struct WasmEventType;
48 struct WasmFunction;
49 struct WasmGlobal;
50 struct WasmGlobalType;
51 struct WasmRelocation;
52 struct WasmSignature;
53 } // namespace wasm
54 } // namespace llvm
55
56 namespace lld {
57 // Casting operators.
58 using llvm::cast;
59 using llvm::cast_or_null;
60 using llvm::dyn_cast;
61 using llvm::dyn_cast_or_null;
62 using llvm::isa;
63
64 // ADT's.
65 using llvm::ArrayRef;
66 using llvm::MutableArrayRef;
67 using llvm::Error;
68 using llvm::ErrorOr;
69 using llvm::Expected;
70 using llvm::MemoryBuffer;
71 using llvm::MemoryBufferRef;
72 using llvm::raw_ostream;
73 using llvm::SmallString;
74 using llvm::SmallVector;
75 using llvm::StringRef;
76 using llvm::Twine;
77
78 using llvm::object::WasmObjectFile;
79 using llvm::object::WasmSection;
80 using llvm::object::WasmSegment;
81 using llvm::object::WasmSymbol;
82 using llvm::wasm::WasmEvent;
83 using llvm::wasm::WasmEventType;
84 using llvm::wasm::WasmFunction;
85 using llvm::wasm::WasmGlobal;
86 using llvm::wasm::WasmGlobalType;
87 using llvm::wasm::WasmRelocation;
88 using llvm::wasm::WasmSignature;
89 } // end namespace lld.
90
91 namespace std {
92 template <> struct hash<llvm::StringRef> {
93 public:
94   size_t operator()(const llvm::StringRef &s) const {
95     return llvm::hash_value(s);
96   }
97 };
98 } // namespace std
99
100 #endif