blob: 6172bd96d09890c463f9ae17cdb006245aa404cc [file] [log] [blame]
Erik Pilkington7adcf292018-07-24 00:07:49 +00001//===------- Targets.h - Declare target feature support ---------*- C++ -*-===//
Erich Keaneebba5922017-07-21 22:37:03 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Erich Keaneebba5922017-07-21 22:37:03 +00006//
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
18#include "clang/Basic/LangOptions.h"
19#include "clang/Basic/MacroBuilder.h"
20#include "clang/Basic/TargetInfo.h"
21#include "llvm/ADT/StringRef.h"
22
23namespace clang {
24namespace targets {
25
26LLVM_LIBRARY_VISIBILITY
27clang::TargetInfo *AllocateTarget(const llvm::Triple &Triple,
28 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
Martell Malone051e9662017-11-21 11:28:29 +000042void addMinGWDefines(const llvm::Triple &Triple, const clang::LangOptions &Opts,
Erich Keaneebba5922017-07-21 22:37:03 +000043 clang::MacroBuilder &Builder);
Martin Storsjoe2a247c2017-07-31 18:17:38 +000044
45LLVM_LIBRARY_VISIBILITY
46void addCygMingDefines(const clang::LangOptions &Opts,
47 clang::MacroBuilder &Builder);
Erich Keaneebba5922017-07-21 22:37:03 +000048} // namespace targets
49} // namespace clang
50#endif // LLVM_CLANG_LIB_BASIC_TARGETS_H