TargetSelect.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //===-- TargetSelect.h ------------------------------------------*- 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. /// \file
  10. ///
  11. /// Utilities to handle the creation of the native exegesis target.
  12. ///
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H
  15. #define LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H
  16. namespace llvm {
  17. namespace exegesis {
  18. #ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET
  19. void LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET();
  20. #endif
  21. // Initializes the native exegesis target, or returns false if there is no
  22. // native target (either because llvm-exegesis does not support the target or
  23. // because it's not linked in).
  24. inline bool InitializeNativeExegesisTarget() {
  25. #ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET
  26. LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET();
  27. return true;
  28. #else
  29. return false;
  30. #endif
  31. }
  32. } // namespace exegesis
  33. } // namespace llvm
  34. #endif // LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H