1*0b57cec5SDimitry Andric //===------- Targets.h - Declare target feature support ---------*- C++ -*-===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric // 9*0b57cec5SDimitry Andric // This file declares things required for construction of a TargetInfo object 10*0b57cec5SDimitry Andric // from a target triple. Typically individual targets will need to include from 11*0b57cec5SDimitry Andric // here in order to get these functions if required. 12*0b57cec5SDimitry Andric // 13*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 14*0b57cec5SDimitry Andric 15*0b57cec5SDimitry Andric #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_H 16*0b57cec5SDimitry Andric #define LLVM_CLANG_LIB_BASIC_TARGETS_H 17*0b57cec5SDimitry Andric 18*0b57cec5SDimitry Andric #include "clang/Basic/LangOptions.h" 19*0b57cec5SDimitry Andric #include "clang/Basic/MacroBuilder.h" 20*0b57cec5SDimitry Andric #include "clang/Basic/TargetInfo.h" 21*0b57cec5SDimitry Andric #include "llvm/ADT/StringRef.h" 22*0b57cec5SDimitry Andric 23*0b57cec5SDimitry Andric namespace clang { 24*0b57cec5SDimitry Andric namespace targets { 25*0b57cec5SDimitry Andric 26*0b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 27*0b57cec5SDimitry Andric clang::TargetInfo *AllocateTarget(const llvm::Triple &Triple, 28*0b57cec5SDimitry Andric const clang::TargetOptions &Opts); 29*0b57cec5SDimitry Andric 30*0b57cec5SDimitry Andric /// DefineStd - Define a macro name and standard variants. For example if 31*0b57cec5SDimitry Andric /// MacroName is "unix", then this will define "__unix", "__unix__", and "unix" 32*0b57cec5SDimitry Andric /// when in GNU mode. 33*0b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 34*0b57cec5SDimitry Andric void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, 35*0b57cec5SDimitry Andric const clang::LangOptions &Opts); 36*0b57cec5SDimitry Andric 37*0b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 38*0b57cec5SDimitry Andric void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName, 39*0b57cec5SDimitry Andric bool Tuning = true); 40*0b57cec5SDimitry Andric 41*0b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 42*0b57cec5SDimitry Andric void addCygMingDefines(const clang::LangOptions &Opts, 43*0b57cec5SDimitry Andric clang::MacroBuilder &Builder); 44*0b57cec5SDimitry Andric } // namespace targets 45*0b57cec5SDimitry Andric } // namespace clang 46*0b57cec5SDimitry Andric #endif // LLVM_CLANG_LIB_BASIC_TARGETS_H 47