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