1*700637cbSDimitry Andric //===------- TargetDefines.h - Target define helpers ------------*- C++ -*-===// 2*700637cbSDimitry Andric // 3*700637cbSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*700637cbSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*700637cbSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*700637cbSDimitry Andric // 7*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 8*700637cbSDimitry Andric // 9*700637cbSDimitry Andric // This file declares a series of helper functions for defining target-specific 10*700637cbSDimitry Andric // macros. 11*700637cbSDimitry Andric // 12*700637cbSDimitry Andric //===----------------------------------------------------------------------===// 13*700637cbSDimitry Andric 14*700637cbSDimitry Andric #ifndef LLVM_CLANG_LIB_BASIC_TARGETDEFINES_H 15*700637cbSDimitry Andric #define LLVM_CLANG_LIB_BASIC_TARGETDEFINES_H 16*700637cbSDimitry Andric 17*700637cbSDimitry Andric #include "clang/Basic/LangOptions.h" 18*700637cbSDimitry Andric #include "clang/Basic/MacroBuilder.h" 19*700637cbSDimitry Andric #include "llvm/ADT/StringRef.h" 20*700637cbSDimitry Andric 21*700637cbSDimitry Andric namespace clang { 22*700637cbSDimitry Andric namespace targets { 23*700637cbSDimitry Andric /// Define a macro name and standard variants. For example if MacroName is 24*700637cbSDimitry Andric /// "unix", then this will define "__unix", "__unix__", and "unix" when in GNU 25*700637cbSDimitry Andric /// mode. 26*700637cbSDimitry Andric LLVM_LIBRARY_VISIBILITY 27*700637cbSDimitry Andric void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, 28*700637cbSDimitry Andric const clang::LangOptions &Opts); 29*700637cbSDimitry Andric 30*700637cbSDimitry Andric LLVM_LIBRARY_VISIBILITY 31*700637cbSDimitry Andric void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName, 32*700637cbSDimitry Andric bool Tuning = true); 33*700637cbSDimitry Andric 34*700637cbSDimitry Andric LLVM_LIBRARY_VISIBILITY 35*700637cbSDimitry Andric void addCygMingDefines(const clang::LangOptions &Opts, 36*700637cbSDimitry Andric clang::MacroBuilder &Builder); 37*700637cbSDimitry Andric } // namespace targets 38*700637cbSDimitry Andric } // namespace clang 39*700637cbSDimitry Andric #endif // LLVM_CLANG_LIB_BASIC_TARGETDEFINES_H 40