clang 22.0.0git
HLSLExternalSemaSource.cpp
Go to the documentation of this file.
1//===--- HLSLExternalSemaSource.cpp - HLSL Sema Source --------------------===//
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//
10//===----------------------------------------------------------------------===//
11
15#include "clang/AST/Attr.h"
16#include "clang/AST/Decl.h"
17#include "clang/AST/DeclCXX.h"
18#include "clang/AST/Expr.h"
19#include "clang/AST/Type.h"
21#include "clang/Sema/Lookup.h"
22#include "clang/Sema/Sema.h"
23#include "clang/Sema/SemaHLSL.h"
24#include "llvm/ADT/SmallVector.h"
25
26using namespace clang;
27using namespace llvm::hlsl;
28
30
32 SemaPtr = &S;
33 ASTContext &AST = SemaPtr->getASTContext();
34 // If the translation unit has external storage force external decls to load.
37
38 IdentifierInfo &HLSL = AST.Idents.get("hlsl", tok::TokenKind::identifier);
40 NamespaceDecl *PrevDecl = nullptr;
42 PrevDecl = Result.getAsSingle<NamespaceDecl>();
43 HLSLNamespace = NamespaceDecl::Create(
44 AST, AST.getTranslationUnitDecl(), /*Inline=*/false, SourceLocation(),
45 SourceLocation(), &HLSL, PrevDecl, /*Nested=*/false);
46 HLSLNamespace->setImplicit(true);
47 HLSLNamespace->setHasExternalLexicalStorage();
48 AST.getTranslationUnitDecl()->addDecl(HLSLNamespace);
49
50 // Force external decls in the HLSL namespace to load from the PCH.
51 (void)HLSLNamespace->getCanonicalDecl()->decls_begin();
52 defineTrivialHLSLTypes();
53 defineHLSLTypesWithForwardDeclarations();
54
55 // This adds a `using namespace hlsl` directive. In DXC, we don't put HLSL's
56 // built in types inside a namespace, but we are planning to change that in
57 // the near future. In order to be source compatible older versions of HLSL
58 // will need to implicitly use the hlsl namespace. For now in clang everything
59 // will get added to the namespace, and we can remove the using directive for
60 // future language versions to match HLSL's evolution.
63 NestedNameSpecifierLoc(), SourceLocation(), HLSLNamespace,
65
67}
68
69void HLSLExternalSemaSource::defineHLSLVectorAlias() {
70 ASTContext &AST = SemaPtr->getASTContext();
71
72 llvm::SmallVector<NamedDecl *> TemplateParams;
73
74 auto *TypeParam = TemplateTypeParmDecl::Create(
75 AST, HLSLNamespace, SourceLocation(), SourceLocation(), 0, 0,
76 &AST.Idents.get("element", tok::TokenKind::identifier), false, false);
77 TypeParam->setDefaultArgument(
80
81 TemplateParams.emplace_back(TypeParam);
82
83 auto *SizeParam = NonTypeTemplateParmDecl::Create(
84 AST, HLSLNamespace, SourceLocation(), SourceLocation(), 0, 1,
85 &AST.Idents.get("element_count", tok::TokenKind::identifier), AST.IntTy,
86 false, AST.getTrivialTypeSourceInfo(AST.IntTy));
87 llvm::APInt Val(AST.getIntWidth(AST.IntTy), 4);
88 TemplateArgument Default(AST, llvm::APSInt(std::move(Val)), AST.IntTy,
89 /*IsDefaulted=*/true);
90 SizeParam->setDefaultArgument(
92 SourceLocation(), SizeParam));
93 TemplateParams.emplace_back(SizeParam);
94
95 auto *ParamList =
97 TemplateParams, SourceLocation(), nullptr);
98
99 IdentifierInfo &II = AST.Idents.get("vector", tok::TokenKind::identifier);
100
102 AST.getTemplateTypeParmType(0, 0, false, TypeParam),
104 AST, NestedNameSpecifierLoc(), SourceLocation(), SizeParam, false,
105 DeclarationNameInfo(SizeParam->getDeclName(), SourceLocation()),
106 AST.IntTy, VK_LValue),
108
109 auto *Record = TypeAliasDecl::Create(AST, HLSLNamespace, SourceLocation(),
110 SourceLocation(), &II,
111 AST.getTrivialTypeSourceInfo(AliasType));
112 Record->setImplicit(true);
113
114 auto *Template =
115 TypeAliasTemplateDecl::Create(AST, HLSLNamespace, SourceLocation(),
116 Record->getIdentifier(), ParamList, Record);
117
118 Record->setDescribedAliasTemplate(Template);
119 Template->setImplicit(true);
120 Template->setLexicalDeclContext(Record->getDeclContext());
121 HLSLNamespace->addDecl(Template);
122}
123
124void HLSLExternalSemaSource::defineTrivialHLSLTypes() {
125 defineHLSLVectorAlias();
126}
127
128/// Set up common members and attributes for buffer types
130 ResourceClass RC, bool IsROV,
131 bool RawBuffer) {
133 .addHandleMember(RC, IsROV, RawBuffer)
137}
138
139// This function is responsible for constructing the constraint expression for
140// this concept:
141// template<typename T> concept is_typed_resource_element_compatible =
142// __is_typed_resource_element_compatible<T>;
145 ASTContext &Context = S.getASTContext();
146
147 // Obtain the QualType for 'bool'
148 QualType BoolTy = Context.BoolTy;
149
150 // Create a QualType that points to this TemplateTypeParmDecl
151 QualType TType = Context.getTypeDeclType(T);
152
153 // Create a TypeSourceInfo for the template type parameter 'T'
154 TypeSourceInfo *TTypeSourceInfo =
155 Context.getTrivialTypeSourceInfo(TType, NameLoc);
156
157 TypeTraitExpr *TypedResExpr = TypeTraitExpr::Create(
158 Context, BoolTy, NameLoc, UTT_IsTypedResourceElementCompatible,
159 {TTypeSourceInfo}, NameLoc, true);
160
161 return TypedResExpr;
162}
163
164// This function is responsible for constructing the constraint expression for
165// this concept:
166// template<typename T> concept is_structured_resource_element_compatible =
167// !__is_intangible<T> && sizeof(T) >= 1;
169 SourceLocation NameLoc,
171 ASTContext &Context = S.getASTContext();
172
173 // Obtain the QualType for 'bool'
174 QualType BoolTy = Context.BoolTy;
175
176 // Create a QualType that points to this TemplateTypeParmDecl
177 QualType TType = Context.getTypeDeclType(T);
178
179 // Create a TypeSourceInfo for the template type parameter 'T'
180 TypeSourceInfo *TTypeSourceInfo =
181 Context.getTrivialTypeSourceInfo(TType, NameLoc);
182
183 TypeTraitExpr *IsIntangibleExpr =
184 TypeTraitExpr::Create(Context, BoolTy, NameLoc, UTT_IsIntangibleType,
185 {TTypeSourceInfo}, NameLoc, true);
186
187 // negate IsIntangibleExpr
188 UnaryOperator *NotIntangibleExpr = UnaryOperator::Create(
189 Context, IsIntangibleExpr, UO_LNot, BoolTy, VK_LValue, OK_Ordinary,
190 NameLoc, false, FPOptionsOverride());
191
192 // element types also may not be of 0 size
193 UnaryExprOrTypeTraitExpr *SizeOfExpr = new (Context) UnaryExprOrTypeTraitExpr(
194 UETT_SizeOf, TTypeSourceInfo, BoolTy, NameLoc, NameLoc);
195
196 // Create a BinaryOperator that checks if the size of the type is not equal to
197 // 1 Empty structs have a size of 1 in HLSL, so we need to check for that
199 Context, llvm::APInt(Context.getTypeSize(Context.getSizeType()), 1, true),
200 Context.getSizeType(), NameLoc);
201
202 BinaryOperator *SizeGEQOneExpr =
203 BinaryOperator::Create(Context, SizeOfExpr, rhs, BO_GE, BoolTy, VK_LValue,
204 OK_Ordinary, NameLoc, FPOptionsOverride());
205
206 // Combine the two constraints
208 Context, NotIntangibleExpr, SizeGEQOneExpr, BO_LAnd, BoolTy, VK_LValue,
209 OK_Ordinary, NameLoc, FPOptionsOverride());
210
211 return CombinedExpr;
212}
213
215 bool isTypedBuffer) {
216 ASTContext &Context = S.getASTContext();
217 DeclContext *DC = NSD->getDeclContext();
218 SourceLocation DeclLoc = SourceLocation();
219
220 IdentifierInfo &ElementTypeII = Context.Idents.get("element_type");
222 Context, NSD->getDeclContext(), DeclLoc, DeclLoc,
223 /*D=*/0,
224 /*P=*/0,
225 /*Id=*/&ElementTypeII,
226 /*Typename=*/true,
227 /*ParameterPack=*/false);
228
229 T->setDeclContext(DC);
230 T->setReferenced();
231
232 // Create and Attach Template Parameter List to ConceptDecl
234 Context, DeclLoc, DeclLoc, {T}, DeclLoc, nullptr);
235
236 DeclarationName DeclName;
237 Expr *ConstraintExpr = nullptr;
238
239 if (isTypedBuffer) {
240 DeclName = DeclarationName(
241 &Context.Idents.get("__is_typed_resource_element_compatible"));
242 ConstraintExpr = constructTypedBufferConstraintExpr(S, DeclLoc, T);
243 } else {
244 DeclName = DeclarationName(
245 &Context.Idents.get("__is_structured_resource_element_compatible"));
246 ConstraintExpr = constructStructuredBufferConstraintExpr(S, DeclLoc, T);
247 }
248
249 // Create a ConceptDecl
250 ConceptDecl *CD =
251 ConceptDecl::Create(Context, NSD->getDeclContext(), DeclLoc, DeclName,
252 ConceptParams, ConstraintExpr);
253
254 // Attach the template parameter list to the ConceptDecl
255 CD->setTemplateParameters(ConceptParams);
256
257 // Add the concept declaration to the Translation Unit Decl
258 NSD->getDeclContext()->addDecl(CD);
259
260 return CD;
261}
262
263void HLSLExternalSemaSource::defineHLSLTypesWithForwardDeclarations() {
265 ConceptDecl *TypedBufferConcept = constructBufferConceptDecl(
266 *SemaPtr, HLSLNamespace, /*isTypedBuffer*/ true);
267 ConceptDecl *StructuredBufferConcept = constructBufferConceptDecl(
268 *SemaPtr, HLSLNamespace, /*isTypedBuffer*/ false);
269
270 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "Buffer")
271 .addSimpleTemplateParams({"element_type"}, TypedBufferConcept)
272 .finalizeForwardDeclaration();
273
274 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
275 setupBufferType(Decl, *SemaPtr, ResourceClass::SRV, /*IsROV=*/false,
276 /*RawBuffer=*/false)
280 });
281
282 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWBuffer")
283 .addSimpleTemplateParams({"element_type"}, TypedBufferConcept)
284 .finalizeForwardDeclaration();
285
286 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
287 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/false,
288 /*RawBuffer=*/false)
292 });
293
294 Decl =
295 BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RasterizerOrderedBuffer")
296 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
297 .finalizeForwardDeclaration();
298 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
299 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/true,
300 /*RawBuffer=*/false)
304 });
305
306 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "StructuredBuffer")
307 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
308 .finalizeForwardDeclaration();
309 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
310 setupBufferType(Decl, *SemaPtr, ResourceClass::SRV, /*IsROV=*/false,
311 /*RawBuffer=*/true)
315 });
316
317 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWStructuredBuffer")
318 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
319 .finalizeForwardDeclaration();
320 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
321 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/false,
322 /*RawBuffer=*/true)
328 });
329
330 Decl =
331 BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "AppendStructuredBuffer")
332 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
333 .finalizeForwardDeclaration();
334 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
335 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/false,
336 /*RawBuffer=*/true)
339 });
340
341 Decl =
342 BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ConsumeStructuredBuffer")
343 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
344 .finalizeForwardDeclaration();
345 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
346 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/false,
347 /*RawBuffer=*/true)
350 });
351
352 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace,
353 "RasterizerOrderedStructuredBuffer")
354 .addSimpleTemplateParams({"element_type"}, StructuredBufferConcept)
355 .finalizeForwardDeclaration();
356 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
357 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/true,
358 /*RawBuffer=*/true)
364 });
365
366 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "ByteAddressBuffer")
368 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
369 setupBufferType(Decl, *SemaPtr, ResourceClass::SRV, /*IsROV=*/false,
370 /*RawBuffer=*/true)
372 });
373 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace, "RWByteAddressBuffer")
375 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
376 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/false,
377 /*RawBuffer=*/true)
379 });
380 Decl = BuiltinTypeDeclBuilder(*SemaPtr, HLSLNamespace,
381 "RasterizerOrderedByteAddressBuffer")
383 onCompletion(Decl, [this](CXXRecordDecl *Decl) {
384 setupBufferType(Decl, *SemaPtr, ResourceClass::UAV, /*IsROV=*/true,
385 /*RawBuffer=*/true)
387 });
388}
389
390void HLSLExternalSemaSource::onCompletion(CXXRecordDecl *Record,
391 CompletionFunction Fn) {
392 if (!Record->isCompleteDefinition())
393 Completions.insert(std::make_pair(Record->getCanonicalDecl(), Fn));
394}
395
397 if (!isa<CXXRecordDecl>(Tag))
398 return;
399 auto Record = cast<CXXRecordDecl>(Tag);
400
401 // If this is a specialization, we need to get the underlying templated
402 // declaration and complete that.
403 if (auto TDecl = dyn_cast<ClassTemplateSpecializationDecl>(Record))
404 Record = TDecl->getSpecializedTemplate()->getTemplatedDecl();
405 Record = Record->getCanonicalDecl();
406 auto It = Completions.find(Record);
407 if (It == Completions.end())
408 return;
409 It->second(Record);
410}
Defines the clang::ASTContext interface.
llvm::dxil::ResourceClass ResourceClass
Definition: CGHLSLRuntime.h:50
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
static ConceptDecl * constructBufferConceptDecl(Sema &S, NamespaceDecl *NSD, bool isTypedBuffer)
static Expr * constructTypedBufferConstraintExpr(Sema &S, SourceLocation NameLoc, TemplateTypeParmDecl *T)
static BuiltinTypeDeclBuilder setupBufferType(CXXRecordDecl *Decl, Sema &S, ResourceClass RC, bool IsROV, bool RawBuffer)
Set up common members and attributes for buffer types.
static Expr * constructStructuredBufferConstraintExpr(Sema &S, SourceLocation NameLoc, TemplateTypeParmDecl *T)
llvm::MachO::Record Record
Definition: MachO.h:31
This file declares semantic analysis for HLSL constructs.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:188
TranslationUnitDecl * getTranslationUnitDecl() const
Definition: ASTContext.h:1201
unsigned getIntWidth(QualType T) const
CanQualType FloatTy
Definition: ASTContext.h:1234
IdentifierTable & Idents
Definition: ASTContext.h:740
CanQualType BoolTy
Definition: ASTContext.h:1223
QualType getTemplateTypeParmType(unsigned Depth, unsigned Index, bool ParameterPack, TemplateTypeParmDecl *ParmDecl=nullptr) const
Retrieve the template type parameter type for a template parameter or parameter pack with the given d...
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
CanQualType IntTy
Definition: ASTContext.h:1231
QualType getTypeDeclType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
Definition: ASTContext.h:2625
QualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
QualType getDependentSizedExtVectorType(QualType VectorType, Expr *SizeExpr, SourceLocation AttrLoc) const
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3974
static BinaryOperator * Create(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptionsOverride FPFeatures)
Definition: Expr.cpp:4938
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
Declaration of a C++20 concept.
static ConceptDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, Expr *ConstraintExpr=nullptr)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1449
void addDecl(Decl *D)
Add the declaration D into this context.
Definition: DeclBase.cpp:1793
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
Definition: DeclBase.h:2688
void setHasExternalLexicalStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations lexically in this context.
Definition: DeclBase.h:2694
decl_iterator decls_begin() const
Definition: DeclBase.cpp:1649
static DeclRefExpr * Create(const ASTContext &Context, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *D, bool RefersToEnclosingVariableOrCapture, SourceLocation NameLoc, QualType T, ExprValueKind VK, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr, NonOdrUseReason NOUR=NOUR_None)
Definition: Expr.cpp:484
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
void setImplicit(bool I=true)
Definition: DeclBase.h:594
DeclContext * getDeclContext()
Definition: DeclBase.h:448
The name of a declaration.
This represents one expression.
Definition: Expr.h:112
Represents difference between two FPOptions values.
Definition: LangOptions.h:919
void CompleteType(TagDecl *Tag) override
Complete an incomplete HLSL builtin type.
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
One of these records is kept for each identifier that is lexed.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
static IntegerLiteral * Create(const ASTContext &C, const llvm::APInt &V, QualType type, SourceLocation l)
Returns a new integer literal with value 'V' and type 'type'.
Definition: Expr.cpp:971
Represents the results of name lookup.
Definition: Lookup.h:147
Represent a C++ namespace.
Definition: Decl.h:591
NamespaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this namespace.
Definition: Decl.h:683
static NamespaceDecl * Create(ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl, bool Nested)
Definition: DeclCXX.cpp:3245
A C++ nested-name-specifier augmented with source location information.
static NonTypeTemplateParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, unsigned D, unsigned P, const IdentifierInfo *Id, QualType T, bool ParameterPack, TypeSourceInfo *TInfo)
A (possibly-)qualified type.
Definition: TypeBase.h:937
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:850
TemplateArgumentLoc getTrivialTemplateArgumentLoc(const TemplateArgument &Arg, QualType NTTPType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr)
Allocate a TemplateArgumentLoc where all locations have been initialized to the given location.
@ LookupNamespaceName
Look up a namespace name within a C++ using directive or namespace alias definition,...
Definition: Sema.h:9304
ASTContext & getASTContext() const
Definition: Sema.h:918
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
Encodes a location in the source.
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3714
Represents a template argument.
Definition: TemplateBase.h:61
void setTemplateParameters(TemplateParameterList *TParams)
Definition: DeclTemplate.h:451
Stores a list of template parameters for a TemplateDecl and its derived classes.
Definition: DeclTemplate.h:74
static TemplateParameterList * Create(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > Params, SourceLocation RAngleLoc, Expr *RequiresClause)
Declaration of a template type parameter.
static TemplateTypeParmDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation KeyLoc, SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, bool ParameterPack, bool HasTypeConstraint=false, UnsignedOrNone NumExpanded=std::nullopt)
static TypeAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, TypeSourceInfo *TInfo)
Definition: Decl.cpp:5680
static TypeAliasTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
Create a function template node.
A container of type source information.
Definition: TypeBase.h:8314
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2890
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
Definition: ExprCXX.cpp:1914
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2627
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2246
static UnaryOperator * Create(const ASTContext &C, Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, bool CanOverflow, FPOptionsOverride FPFeatures)
Definition: Expr.cpp:4995
Represents a C++ using-declaration.
Definition: DeclCXX.h:3585
static UsingDirectiveDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation NamespaceLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Nominated, DeclContext *CommonAncestor)
Definition: DeclCXX.cpp:3201
BuiltinTypeDeclBuilder & addHandleConstructorFromImplicitBinding()
BuiltinTypeDeclBuilder & addSimpleTemplateParams(ArrayRef< StringRef > Names, ConceptDecl *CD)
BuiltinTypeDeclBuilder & addHandleConstructorFromBinding()
BuiltinTypeDeclBuilder & addArraySubscriptOperators()
BuiltinTypeDeclBuilder & addIncrementCounterMethod()
BuiltinTypeDeclBuilder & addHandleMember(ResourceClass RC, bool IsROV, bool RawBuffer, AccessSpecifier Access=AccessSpecifier::AS_private)
BuiltinTypeDeclBuilder & addDefaultHandleConstructor()
BuiltinTypeDeclBuilder & addDecrementCounterMethod()
The JSON file list parser is used to communicate input to InstallAPI.
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:151
@ Result
The result type of a method or function.
@ Template
We are parsing a template declaration.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:139
const FunctionProtoType * T
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...