blob: 12a23fa8142e55ce5c260645318a2083e25440d2 [file] [log] [blame]
Erich Keaneebba5922017-07-21 22:37:03 +00001//===------- Targets.h - Declare target feature support -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares things required for construction of a TargetInfo object
11// from a target triple. Typically individual targets will need to include from
12// here in order to get these functions if required.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_H
17#define LLVM_CLANG_LIB_BASIC_TARGETS_H
18
19#include "clang/Basic/LangOptions.h"
20#include "clang/Basic/MacroBuilder.h"
21#include "clang/Basic/TargetInfo.h"
22#include "llvm/ADT/StringRef.h"
23
24namespace clang {
25namespace targets {
26
27LLVM_LIBRARY_VISIBILITY
28clang::TargetInfo *AllocateTarget(const llvm::Triple &Triple,
29 const clang::TargetOptions &Opts);
30
31/// DefineStd - Define a macro name and standard variants. For example if
32/// MacroName is "unix", then this will define "__unix", "__unix__", and "unix"
33/// when in GNU mode.
34LLVM_LIBRARY_VISIBILITY
35void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName,
36 const clang::LangOptions &Opts);
37
38LLVM_LIBRARY_VISIBILITY
39void defineCPUMacros(clang::MacroBuilder &Builder, llvm::StringRef CPUName,
40 bool Tuning = true);
41
42LLVM_LIBRARY_VISIBILITY
43void addMinGWDefines(const clang::LangOptions &Opts,
44 clang::MacroBuilder &Builder);
Martin Storsjoe2a247c2017-07-31 18:17:38 +000045
46LLVM_LIBRARY_VISIBILITY
47void addCygMingDefines(const clang::LangOptions &Opts,
48 clang::MacroBuilder &Builder);
Erich Keaneebba5922017-07-21 22:37:03 +000049} // namespace targets
50} // namespace clang
51#endif // LLVM_CLANG_LIB_BASIC_TARGETS_H