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 15 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H 16 #define LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H 17 18 namespace llvm { 19 namespace exegesis { 20 21 #ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET 22 void LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET(); 23 #endif 24 25 // Initializes the native exegesis target, or returns false if there is no 26 // native target (either because llvm-exegesis does not support the target or 27 // because it's not linked in). InitializeNativeExegesisTarget()28inline bool InitializeNativeExegesisTarget() { 29 #ifdef LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET 30 LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET(); 31 return true; 32 #else 33 return false; 34 #endif 35 } 36 37 } // namespace exegesis 38 } // namespace llvm 39 40 #endif // LLVM_TOOLS_LLVM_EXEGESIS_TARGET_SELECT_H 41