1 //===- offload_lib.cpp - Entry points for the new LLVM/Offload API --------===// 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 pulls in the tablegen'd API entry point functions. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "OffloadImpl.hpp" 14 #include <OffloadAPI.h> 15 #include <OffloadPrint.hpp> 16 17 #include <iostream> 18 19 llvm::StringSet<> &errorStrs() { 20 static llvm::StringSet<> ErrorStrs; 21 return ErrorStrs; 22 } 23 24 ErrSetT &errors() { 25 static ErrSetT Errors{}; 26 return Errors; 27 } 28 29 ol_code_location_t *¤tCodeLocation() { 30 thread_local ol_code_location_t *CodeLoc = nullptr; 31 return CodeLoc; 32 } 33 34 OffloadConfig &offloadConfig() { 35 static OffloadConfig Config{}; 36 return Config; 37 } 38 39 // Pull in the declarations for the implementation funtions. The actual entry 40 // points in this file wrap these. 41 #include "OffloadImplFuncDecls.inc" 42 43 // Pull in the tablegen'd entry point definitions. 44 #include "OffloadEntryPoints.inc" 45