clang 10.0.0git

XCore.cpp
Go to the documentation of this file.
1 //===--- XCore.cpp - Implement XCore 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 XCore TargetInfo objects.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #include "XCore.h"
14 #include "clang/Basic/Builtins.h"
15 #include "clang/Basic/MacroBuilder.h"
16 #include "clang/Basic/TargetBuiltins.h"
17
18 using namespace clang;
19 using namespace clang::targets;
20
21 const Builtin::Info XCoreTargetInfo::BuiltinInfo[] = {
22 #define BUILTIN(ID, TYPE, ATTRS) \
23 {#ID, TYPE, ATTRS, nullptr, ALL_LANGUAGES, nullptr},
24 #define LIBBUILTIN(ID, TYPE, ATTRS, HEADER) \
25 {#ID, TYPE, ATTRS, HEADER, ALL_LANGUAGES, nullptr},
26 #include "clang/Basic/BuiltinsXCore.def"
27 };
28
29 void XCoreTargetInfo::getTargetDefines(const LangOptions &Opts,
30 MacroBuilder &Builder) const {
31 Builder.defineMacro("__XS1B__");
32 }
33
34 ArrayRef<Builtin::Info> XCoreTargetInfo::getTargetBuiltins() const {
35 return llvm::makeArrayRef(BuiltinInfo, clang::XCore::LastTSBuiltin -
36 Builtin::FirstTSBuiltin);
37 }
MacroBuilder.h
Defines the clang::MacroBuilder utility class.
clang::targets
Definition: AArch64.h:21
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.
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:21
clang::Builtin::FirstTSBuiltin
Definition: Builtins.h:50
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::targets::XCoreTargetInfo::getTargetDefines
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
===-— Other target property query methods --------------------——===//
Definition: XCore.cpp:29
XCore.h
clang::XCore::LastTSBuiltin
Definition: TargetBuiltins.h:178
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.
clang::targets::XCoreTargetInfo::getTargetBuiltins
ArrayRef< Builtin::Info > getTargetBuiltins() const override
Return information about target-specific builtins for the current primary target, and info about whic...
Definition: XCore.cpp:34