Targets.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //===------- Targets.h - Declare target feature support ---------*- 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 declares things required for construction of a TargetInfo object
  10. // from a target triple. Typically individual targets will need to include from
  11. // here in order to get these functions if required.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_H
  15. #define LLVM_CLANG_LIB_BASIC_TARGETS_H
  16. #include "clang/Basic/LangOptions.h"
  17. #include "clang/Basic/MacroBuilder.h"
  18. #include "clang/Basic/TargetInfo.h"
  19. #include "llvm/ADT/StringRef.h"
  20. namespace clang {
  21. namespace targets {
  22. LLVM_LIBRARY_VISIBILITY
  23. clang::TargetInfo *AllocateTarget(const llvm::Triple &Triple,
  24. const clang::TargetOptions &Opts);
  25. /// DefineStd - Define a macro name and standard variants. For example if
  26. /// MacroName is "unix", then this will define "__unix", "__unix__", and "unix"
  27. /// when in GNU mode.
  28. LLVM_LIBRARY_VISIBILITY
  29. void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName,
  30. const clang::LangOptions &Opts);
  31. LLVM_LIBRARY_VISIBILITY
  32. void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName,
  33. bool Tuning = true);
  34. LLVM_LIBRARY_VISIBILITY
  35. void addCygMingDefines(const clang::LangOptions &Opts,
  36. clang::MacroBuilder &Builder);
  37. } // namespace targets
  38. } // namespace clang
  39. #endif // LLVM_CLANG_LIB_BASIC_TARGETS_H