1 //===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file forward declares and imports various common LLVM datatypes that
11 // lld wants to use unqualified.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLD_COMMON_LLVM_H
16 #define LLD_COMMON_LLVM_H
18 // This should be the only #include, force #includes of all the others on
20 #include "llvm/ADT/Hashing.h"
21 #include "llvm/Support/Casting.h"
31 class MemoryBufferRef;
32 template <typename T> class ArrayRef;
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;
69 using llvm::MemoryBuffer;
70 using llvm::MemoryBufferRef;
71 using llvm::raw_ostream;
72 using llvm::SmallString;
73 using llvm::SmallVector;
74 using llvm::StringRef;
77 using llvm::object::WasmObjectFile;
78 using llvm::object::WasmSection;
79 using llvm::object::WasmSegment;
80 using llvm::object::WasmSymbol;
81 using llvm::wasm::WasmEvent;
82 using llvm::wasm::WasmEventType;
83 using llvm::wasm::WasmFunction;
84 using llvm::wasm::WasmGlobal;
85 using llvm::wasm::WasmGlobalType;
86 using llvm::wasm::WasmRelocation;
87 using llvm::wasm::WasmSignature;
88 } // end namespace lld.
91 template <> struct hash<llvm::StringRef> {
93 size_t operator()(const llvm::StringRef &s) const {
94 return llvm::hash_value(s);