10b57cec5SDimitry Andric //===------- Targets.h - Declare target feature support ---------*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This file declares things required for construction of a TargetInfo object 100b57cec5SDimitry Andric // from a target triple. Typically individual targets will need to include from 110b57cec5SDimitry Andric // here in order to get these functions if required. 120b57cec5SDimitry Andric // 130b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_H 160b57cec5SDimitry Andric #define LLVM_CLANG_LIB_BASIC_TARGETS_H 170b57cec5SDimitry Andric 180b57cec5SDimitry Andric #include "clang/Basic/LangOptions.h" 190b57cec5SDimitry Andric #include "clang/Basic/MacroBuilder.h" 200b57cec5SDimitry Andric #include "clang/Basic/TargetInfo.h" 210b57cec5SDimitry Andric #include "llvm/ADT/StringRef.h" 220b57cec5SDimitry Andric 230b57cec5SDimitry Andric namespace clang { 240b57cec5SDimitry Andric namespace targets { 250b57cec5SDimitry Andric 260b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 27*06c3fb27SDimitry Andric std::unique_ptr<clang::TargetInfo> 28*06c3fb27SDimitry Andric AllocateTarget(const llvm::Triple &Triple, const clang::TargetOptions &Opts); 290b57cec5SDimitry Andric 300b57cec5SDimitry Andric /// DefineStd - Define a macro name and standard variants. For example if 310b57cec5SDimitry Andric /// MacroName is "unix", then this will define "__unix", "__unix__", and "unix" 320b57cec5SDimitry Andric /// when in GNU mode. 330b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 340b57cec5SDimitry Andric void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, 350b57cec5SDimitry Andric const clang::LangOptions &Opts); 360b57cec5SDimitry Andric 370b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 380b57cec5SDimitry Andric void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName, 390b57cec5SDimitry Andric bool Tuning = true); 400b57cec5SDimitry Andric 410b57cec5SDimitry Andric LLVM_LIBRARY_VISIBILITY 420b57cec5SDimitry Andric void addCygMingDefines(const clang::LangOptions &Opts, 430b57cec5SDimitry Andric clang::MacroBuilder &Builder); 440b57cec5SDimitry Andric } // namespace targets 450b57cec5SDimitry Andric } // namespace clang 460b57cec5SDimitry Andric #endif // LLVM_CLANG_LIB_BASIC_TARGETS_H 47