LLVM.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //===--- LLVM.h - Import various common LLVM datatypes ----------*- C++ -*-===//
  2. //
  3. // This source file is part of the Swift.org open source project
  4. //
  5. // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
  6. // Licensed under Apache License v2.0 with Runtime Library Exception
  7. //
  8. // See https://swift.org/LICENSE.txt for license information
  9. // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
  10. //
  11. //===----------------------------------------------------------------------===//
  12. //
  13. // This file forward declares and imports various common LLVM datatypes that
  14. // swift wants to use unqualified.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef SWIFT_BASIC_LLVM_H
  18. #define SWIFT_BASIC_LLVM_H
  19. // Do not proliferate #includes here, require clients to #include their
  20. // dependencies.
  21. // Casting.h has complex templates that cannot be easily forward declared.
  22. #include "Casting.h"
  23. // None.h includes an enumerator that is desired & cannot be forward declared
  24. // without a definition of NoneType.
  25. #include "None.h"
  26. // Forward declarations.
  27. namespace llvm {
  28. // Containers.
  29. class StringRef;
  30. class StringLiteral;
  31. class Twine;
  32. template <typename T> class SmallPtrSetImpl;
  33. template <typename T, unsigned N> class SmallPtrSet;
  34. template <typename T> class SmallVectorImpl;
  35. template <typename T, unsigned N> class SmallVector;
  36. template <unsigned N> class SmallString;
  37. template <typename T, unsigned N> class SmallSetVector;
  38. template<typename T> class ArrayRef;
  39. template<typename T> class MutableArrayRef;
  40. template<typename T> class TinyPtrVector;
  41. template<typename T> class Optional;
  42. template <typename PT1, typename PT2> class PointerUnion;
  43. class SmallBitVector;
  44. // Other common classes.
  45. class raw_ostream;
  46. class APInt;
  47. class APFloat;
  48. template <typename Fn> class function_ref;
  49. } // end namespace llvm
  50. namespace swift {
  51. // Casting operators.
  52. using llvm::isa;
  53. using llvm::cast;
  54. using llvm::dyn_cast;
  55. using llvm::dyn_cast_or_null;
  56. using llvm::cast_or_null;
  57. // Containers.
  58. using llvm::None;
  59. using llvm::Optional;
  60. using llvm::SmallPtrSetImpl;
  61. using llvm::SmallPtrSet;
  62. using llvm::SmallString;
  63. using llvm::StringRef;
  64. using llvm::StringLiteral;
  65. using llvm::Twine;
  66. using llvm::SmallVectorImpl;
  67. using llvm::SmallVector;
  68. using llvm::ArrayRef;
  69. using llvm::MutableArrayRef;
  70. using llvm::TinyPtrVector;
  71. using llvm::PointerUnion;
  72. using llvm::SmallSetVector;
  73. using llvm::SmallBitVector;
  74. // Other common classes.
  75. using llvm::APFloat;
  76. using llvm::APInt;
  77. using llvm::function_ref;
  78. using llvm::NoneType;
  79. using llvm::raw_ostream;
  80. } // end namespace swift
  81. #endif // SWIFT_BASIC_LLVM_H