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"
30 class MemoryBufferRef;
31 template<typename T> class ArrayRef;
32 template<unsigned InternalLen> class SmallString;
33 template<typename T, unsigned N> class SmallVector;
34 template<typename T> class SmallVectorImpl;
37 struct SaveAndRestore;
46 // TODO: DenseMap, ...
54 using llvm::dyn_cast_or_null;
55 using llvm::cast_or_null;
59 using llvm::StringRef;
61 using llvm::MemoryBuffer;
62 using llvm::MemoryBufferRef;
64 using llvm::SmallString;
65 using llvm::SmallVector;
66 using llvm::SmallVectorImpl;
67 using llvm::SaveAndRestore;
71 using llvm::raw_ostream;
72 } // end namespace lld.
75 template <> struct hash<llvm::StringRef> {
77 size_t operator()(const llvm::StringRef &s) const {
78 return llvm::hash_value(s);