-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[Clang] Add BuiltinTemplates.td to generate code for builtin templates #123736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
586dd4e
dc4232e
8611121
417b15f
c517ac9
9a582a1
eb7a870
57495b6
0f79dcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//===--- BuiltinTemplates.td - Clang builtin template aliases ---*- C++ -*-===// | ||
// | ||
// 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 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
class BuiltinTemplate<string prototype> { | ||
string Prototype = prototype; | ||
philnik777 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
def __make_integer_seq : BuiltinTemplate< | ||
"template <template <class T, T... Ints> class IntSeq, class T, T N>">; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its unfortunate that we have this much "just arbitrary text" here. I don't have a better idea, and no real wish to try to make it 'better', but this makes me grumpy and I wanted to let you know. ALSO, and something that IS actionable: Can we document the importance of the defined 'name'? Since it is the actual name of the builtin that we're exposing to the user? Typically these (names in .td files) are internal names that are generally arbitrary, so it would be nice to document that: "An entry here will introduce a template builtin with the name X, and whatever-else-we-are-doing-here." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it would be better to give the templates an internal name to be more consistent? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about this over the weekend. I really think that we want some sort of structures to define the template head here. The base needs a name, then we need a Type, an Non-Type, a Template-Template, and a Variadic (for now). But having us try to parse this is really going to be error prone and difficult to extend. |
||
|
||
def __type_pack_element : BuiltinTemplate< | ||
"template <size_t, class... T>">; | ||
|
||
def __builtin_common_type : BuiltinTemplate< | ||
"template <template <class... Args> class BaseTemplate," | ||
" template <class TypeMember> class HasTypeMember," | ||
" class HasNoTypeMember," | ||
" class... Ts>">; |
Uh oh!
There was an error while loading. Please reload this page.