1 //===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file forward declares and imports various common LLVM datatypes that
10 // lld wants to use unqualified.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLD_COMMON_LLVM_H
15 #define LLD_COMMON_LLVM_H
17 // This should be the only #include, force #includes of all the others on
19 #include "llvm/ADT/Hashing.h"
20 #include "llvm/Support/Casting.h"
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;
50 struct WasmGlobalType;
51 struct WasmRelocation;
59 using llvm::cast_or_null;
61 using llvm::dyn_cast_or_null;
66 using llvm::MutableArrayRef;
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;
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.
92 template <> struct hash<llvm::StringRef> {
94 size_t operator()(const llvm::StringRef &s) const {
95 return llvm::hash_value(s);