2012-06-13 13:12:41 +08:00
|
|
|
//===- TableGenBackends.h - Declarations for Clang TableGen Backends ------===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-06-13 13:12:41 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declarations for all of the Clang TableGen
|
|
|
|
// backends. A "TableGen backend" is just a function. See
|
|
|
|
// "$LLVM_ROOT/utils/TableGen/TableGenBackends.h" for more info.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-08 21:24:19 +08:00
|
|
|
#ifndef LLVM_CLANG_UTILS_TABLEGEN_TABLEGENBACKENDS_H
|
|
|
|
#define LLVM_CLANG_UTILS_TABLEGEN_TABLEGENBACKENDS_H
|
|
|
|
|
2012-06-13 13:12:41 +08:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace llvm {
|
2019-05-22 21:01:28 +08:00
|
|
|
class raw_ostream;
|
|
|
|
class RecordKeeper;
|
|
|
|
} // namespace llvm
|
2012-06-13 13:12:41 +08:00
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangDeclContext(llvm::RecordKeeper &RK, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangASTNodes(llvm::RecordKeeper &RK, llvm::raw_ostream &OS,
|
2012-06-13 13:12:41 +08:00
|
|
|
const std::string &N, const std::string &S);
|
2019-12-14 10:52:16 +08:00
|
|
|
void EmitClangBasicReader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangBasicWriter(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-10-02 07:13:03 +08:00
|
|
|
void EmitClangTypeNodes(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-12-14 10:52:16 +08:00
|
|
|
void EmitClangTypeReader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangTypeWriter(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangAttrParserStringSwitches(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrSubjectMatchRulesParserStringSwitches(
|
|
|
|
llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangAttrClass(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrImpl(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrList(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangAttrSubjectMatchRuleList(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangAttrPCHRead(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrPCHWrite(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangAttrHasAttrImpl(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrSpellingListIndex(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrASTVisitor(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrTemplateInstantiate(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrParsedAttrList(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrParsedAttrImpl(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrParsedAttrKinds(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2019-01-12 03:16:01 +08:00
|
|
|
void EmitClangAttrTextNodeDump(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangAttrNodeTraverse(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2021-08-08 06:41:40 +08:00
|
|
|
void EmitClangAttrDocTable(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2018-10-12 20:21:29 +08:00
|
|
|
|
|
|
|
void EmitClangDiagsDefs(llvm::RecordKeeper &Records, llvm::raw_ostream &OS,
|
2012-06-13 13:12:41 +08:00
|
|
|
const std::string &Component);
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangDiagGroups(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangDiagsIndexName(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2012-06-13 13:12:41 +08:00
|
|
|
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangSACheckers(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2012-06-13 13:12:41 +08:00
|
|
|
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangCommentHTMLTags(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangCommentHTMLTagsProperties(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangCommentHTMLNamedCharacterReferences(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2012-08-31 10:21:44 +08:00
|
|
|
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangCommentCommandInfo(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
|
|
|
void EmitClangCommentCommandList(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
[Clang Interpreter] Initial patch for the constexpr interpreter
Summary:
This patch introduces the skeleton of the constexpr interpreter,
capable of evaluating a simple constexpr functions consisting of
if statements. The interpreter is described in more detail in the
RFC. Further patches will add more features.
Reviewers: Bigcheese, jfb, rsmith
Subscribers: bruno, uenoku, ldionne, Tyker, thegameg, tschuett, dexonsmith, mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D64146
llvm-svn: 371834
2019-09-13 17:46:16 +08:00
|
|
|
void EmitClangOpcodes(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2012-09-11 04:32:42 +08:00
|
|
|
|
2020-11-10 07:00:51 +08:00
|
|
|
void EmitClangSyntaxNodeList(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2020-11-01 04:09:11 +08:00
|
|
|
void EmitClangSyntaxNodeClasses(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2020-11-10 07:00:51 +08:00
|
|
|
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitNeon(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitFP16(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
[clang][BFloat] add NEON emitter for bfloat
Summary:
This patch adds the bfloat16_t struct typedefs (e.g. bfloat16x8x2_t) to
arm_neon.h
This patch is part of a series implementing the Bfloat16 extension of the
Armv8.6-a architecture, as detailed here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
The bfloat type, and its properties are specified in the Arm Architecture
Reference Manual:
https://developer.arm.com/docs/ddi0487/latest/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile
The following people contributed to this patch:
- Luke Cheeseman
- Simon Tatham
- Ties Stuij
Reviewers: t.p.northover, fpetrogalli, sdesmalen, az, LukeGeeson
Reviewed By: fpetrogalli
Subscribers: SjoerdMeijer, LukeGeeson, pbarrio, mgorny, kristof.beyls, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79708
2020-06-05 20:06:01 +08:00
|
|
|
void EmitBF16(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitNeonSema(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitNeonTest(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2012-06-13 13:12:41 +08:00
|
|
|
|
2020-03-15 22:29:45 +08:00
|
|
|
void EmitSveHeader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2020-03-18 19:07:20 +08:00
|
|
|
void EmitSveBuiltins(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitSveBuiltinCG(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitSveTypeFlags(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2020-04-14 22:56:36 +08:00
|
|
|
void EmitSveRangeChecks(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2020-03-15 22:29:45 +08:00
|
|
|
|
[clang,ARM] Initial ACLE intrinsics for MVE.
This commit sets up the infrastructure for auto-generating <arm_mve.h>
and doing clang-side code generation for the builtins it relies on,
and demonstrates that it works by implementing a representative sample
of the ACLE intrinsics, more or less matching the ones introduced in
LLVM IR by D67158,D68699,D68700.
Like NEON, that header file will provide a set of vector types like
uint16x8_t and C functions with names like vaddq_u32(). Unlike NEON,
the ACLE spec for <arm_mve.h> includes a polymorphism system, so that
you can write plain vaddq() and disambiguate by the vector types you
pass to it.
Unlike the corresponding NEON code, I've arranged to make every user-
facing ACLE intrinsic into a clang builtin, and implement all the code
generation inside clang. So <arm_mve.h> itself contains nothing but
typedefs and function declarations, with the latter all using the new
`__attribute__((__clang_builtin))` system to arrange that the user-
facing function names correspond to the right internal BuiltinIDs.
So the new MveEmitter tablegen system specifies the full sequence of
IRBuilder operations that each user-facing ACLE intrinsic should
translate into. Where possible, the ACLE intrinsics map to standard IR
operations such as vector-typed `add` and `fadd`; where no standard
representation exists, I call down to the sample IR intrinsics
introduced in an earlier commit.
Doing it like this means that you get the polymorphism for free just
by using __attribute__((overloadable)): the clang overload resolution
decides which function declaration is the relevant one, and _then_ its
BuiltinID is looked up, so by the time we're doing code generation,
that's all been resolved by the standard system. It also means that
you get really nice error messages if the user passes the wrong
combination of types: clang will show the declarations from the header
file and explain why each one doesn't match.
(The obvious alternative approach would be to have wrapper functions
in <arm_mve.h> which pass their arguments to the underlying builtins.
But that doesn't work in the case where one of the arguments has to be
a constant integer: the wrapper function can't pass the constantness
through. So you'd have to do that case using a macro instead, and then
use C11 `_Generic` to handle the polymorphism. Then you have to add
horrible workarounds because `_Generic` requires even the untaken
branches to type-check successfully, and //then// if the user gets the
types wrong, the error message is totally unreadable!)
Reviewers: dmgreen, miyuki, ostannard
Subscribers: mgorny, javed.absar, kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67161
2019-09-02 22:50:50 +08:00
|
|
|
void EmitMveHeader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitMveBuiltinDef(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitMveBuiltinSema(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitMveBuiltinCG(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitMveBuiltinAliases(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2021-03-05 23:40:28 +08:00
|
|
|
|
|
|
|
void EmitRVVHeader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitRVVBuiltins(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitRVVBuiltinCG(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
[clang,ARM] Initial ACLE intrinsics for MVE.
This commit sets up the infrastructure for auto-generating <arm_mve.h>
and doing clang-side code generation for the builtins it relies on,
and demonstrates that it works by implementing a representative sample
of the ACLE intrinsics, more or less matching the ones introduced in
LLVM IR by D67158,D68699,D68700.
Like NEON, that header file will provide a set of vector types like
uint16x8_t and C functions with names like vaddq_u32(). Unlike NEON,
the ACLE spec for <arm_mve.h> includes a polymorphism system, so that
you can write plain vaddq() and disambiguate by the vector types you
pass to it.
Unlike the corresponding NEON code, I've arranged to make every user-
facing ACLE intrinsic into a clang builtin, and implement all the code
generation inside clang. So <arm_mve.h> itself contains nothing but
typedefs and function declarations, with the latter all using the new
`__attribute__((__clang_builtin))` system to arrange that the user-
facing function names correspond to the right internal BuiltinIDs.
So the new MveEmitter tablegen system specifies the full sequence of
IRBuilder operations that each user-facing ACLE intrinsic should
translate into. Where possible, the ACLE intrinsics map to standard IR
operations such as vector-typed `add` and `fadd`; where no standard
representation exists, I call down to the sample IR intrinsics
introduced in an earlier commit.
Doing it like this means that you get the polymorphism for free just
by using __attribute__((overloadable)): the clang overload resolution
decides which function declaration is the relevant one, and _then_ its
BuiltinID is looked up, so by the time we're doing code generation,
that's all been resolved by the standard system. It also means that
you get really nice error messages if the user passes the wrong
combination of types: clang will show the declarations from the header
file and explain why each one doesn't match.
(The obvious alternative approach would be to have wrapper functions
in <arm_mve.h> which pass their arguments to the underlying builtins.
But that doesn't work in the case where one of the arguments has to be
a constant integer: the wrapper function can't pass the constantness
through. So you'd have to do that case using a macro instead, and then
use C11 `_Generic` to handle the polymorphism. Then you have to add
horrible workarounds because `_Generic` requires even the untaken
branches to type-check successfully, and //then// if the user gets the
types wrong, the error message is totally unreadable!)
Reviewers: dmgreen, miyuki, ostannard
Subscribers: mgorny, javed.absar, kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67161
2019-09-02 22:50:50 +08:00
|
|
|
|
[ARM,CDE] Generalize MVE intrinsics infrastructure to support CDE
Summary:
This patch generalizes the existing code to support CDE intrinsics
which will share some properties with existing MVE intrinsics
(some of the intrinsics will be polymorphic and accept/return values
of MVE vector types).
Specifically the patch:
* Adds new tablegen backends -gen-arm-cde-builtin-def,
-gen-arm-cde-builtin-codegen, -gen-arm-cde-builtin-sema,
-gen-arm-cde-builtin-aliases, -gen-arm-cde-builtin-header based on
existing MVE backends.
* Renames the '__clang_arm_mve_alias' attribute into
'__clang_arm_builtin_alias' (it will be used with CDE intrinsics as
well as MVE intrinsics)
* Implements semantic checks for the coprocessor argument of the CDE
intrinsics as well as the existing coprocessor intrinsics.
* Adds one CDE intrinsic __arm_cx1 to test the above changes
Reviewers: simon_tatham, MarkMurrayARM, ostannard, dmgreen
Reviewed By: simon_tatham
Subscribers: sdesmalen, mgorny, kristof.beyls, danielkiss, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D75850
2020-03-10 22:01:42 +08:00
|
|
|
void EmitCdeHeader(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitCdeBuiltinDef(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitCdeBuiltinSema(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitCdeBuiltinCG(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitCdeBuiltinAliases(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitClangAttrDocs(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangDiagDocs(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
|
|
|
void EmitClangOptDocs(llvm::RecordKeeper &Records, llvm::raw_ostream &OS);
|
2014-02-17 23:27:10 +08:00
|
|
|
|
2019-06-03 17:39:11 +08:00
|
|
|
void EmitClangOpenCLBuiltins(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2021-06-09 19:43:50 +08:00
|
|
|
void EmitClangOpenCLBuiltinTests(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2019-06-03 17:39:11 +08:00
|
|
|
|
2019-05-22 21:01:28 +08:00
|
|
|
void EmitClangDataCollectors(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2017-09-06 21:20:51 +08:00
|
|
|
|
2018-10-12 20:21:29 +08:00
|
|
|
void EmitTestPragmaAttributeSupportedAttributes(llvm::RecordKeeper &Records,
|
|
|
|
llvm::raw_ostream &OS);
|
2017-04-18 22:33:39 +08:00
|
|
|
|
2012-06-13 13:12:41 +08:00
|
|
|
} // end namespace clang
|
2014-08-08 21:24:19 +08:00
|
|
|
|
|
|
|
#endif
|