clang 10.0.0git

Le64.cpp
Go to the documentation of this file.
1 //===--- Le64.cpp - Implement Le64 target feature support -----------------===//
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 implements Le64 TargetInfo objects.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "Le64.h"
14 #include "Targets.h"
15 #include "clang/Basic/Builtins.h"
16 #include "clang/Basic/MacroBuilder.h"
17 #include "clang/Basic/TargetBuiltins.h"
18
19 using namespace clang;
20 using namespace clang::targets;
21
22 const Builtin::Info Le64TargetInfo::BuiltinInfo[] = {
23 #define BUILTIN(ID, TYPE, ATTRS) \
24 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr},
25 #include "clang/Basic/BuiltinsLe64.def"
26 };
27
28 ArrayRef<Builtin::Info> Le64TargetInfo::getTargetBuiltins() const {
29 return llvm::makeArrayRef(BuiltinInfo, clang::Le64::LastTSBuiltin -
30 Builtin::FirstTSBuiltin);
31 }
32
33 void Le64TargetInfo::getTargetDefines(const LangOptions &Opts,
34 MacroBuilder &Builder) const {
35 DefineStd(Builder, "unix", Opts);
36 defineCPUMacros(Builder, "le64", /*Tuning=*/false);
37 Builder.defineMacro("__ELF__");
38 }
clang::targets::DefineStd
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
Definition: Targets.cpp:54
MacroBuilder.h
Defines the clang::MacroBuilder utility class.
clang::targets
Definition: AArch64.h:21
clang::Le64::LastTSBuiltin
Definition: TargetBuiltins.h:188
clang::targets::Le64TargetInfo::getTargetBuiltins
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
Definition: Le64.cpp:28
clang::targets::Le64TargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//
Definition: Le64.cpp:33
Le64.h
clang::Builtin::Info
Definition: Builtins.h:53
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:53
llvm::ArrayRef
Definition: LLVM.h:31
TargetBuiltins.h
Enumerates target-specific builtins in their own namespaces within namespace clang.
Targets.h
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::Builtin::FirstTSBuiltin
Definition: Builtins.h:50
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::targets::defineCPUMacros
void defineCPUMacros(MacroBuilder &Builder, StringRef CPUName, bool Tuning)
Definition: Targets.cpp:70
clang::MacroBuilder::defineMacro
void defineMacro(const Twine &Name, const Twine &Value="1")
Append a #define line for macro of the form "\#define Name Value\n".
Definition: MacroBuilder.h:29
Builtins.h
Defines enum values for all the target-independent builtin functions.