clang 20.0.0git
Targets.h
Go to the documentation of this file.
1//===------- Targets.h - Declare target feature support ---------*- C++ -*-===//
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 declares things required for construction of a TargetInfo object
10// from a target triple. Typically individual targets will need to include from
11// here in order to get these functions if required.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_H
16#define LLVM_CLANG_LIB_BASIC_TARGETS_H
17
21#include "llvm/ADT/StringRef.h"
22
23namespace clang {
24namespace targets {
25
26LLVM_LIBRARY_VISIBILITY
27std::unique_ptr<clang::TargetInfo>
28AllocateTarget(const llvm::Triple &Triple, const clang::TargetOptions &Opts);
29
30/// DefineStd - Define a macro name and standard variants. For example if
31/// MacroName is "unix", then this will define "__unix", "__unix__", and "unix"
32/// when in GNU mode.
33LLVM_LIBRARY_VISIBILITY
34void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName,
35 const clang::LangOptions &Opts);
36
37LLVM_LIBRARY_VISIBILITY
38void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName,
39 bool Tuning = true);
40
41LLVM_LIBRARY_VISIBILITY
43 clang::MacroBuilder &Builder);
44} // namespace targets
45} // namespace clang
46#endif // LLVM_CLANG_LIB_BASIC_TARGETS_H
Defines the clang::LangOptions interface.
Defines the clang::MacroBuilder utility class.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:476
Options for controlling the target.
Definition: TargetOptions.h:26
Defines the clang::TargetInfo interface.
void defineCPUMacros(MacroBuilder &Builder, StringRef CPUName, bool Tuning)
Definition: Targets.cpp:75
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
Definition: Targets.cpp:59
std::unique_ptr< TargetInfo > AllocateTarget(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: Targets.cpp:111
void addCygMingDefines(const LangOptions &Opts, MacroBuilder &Builder)
Definition: Targets.cpp:82
The JSON file list parser is used to communicate input to InstallAPI.