clang: lib/Sema/HLSLBuiltinTypeDeclBuilder.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
27#include "llvm/ADT/SmallVector.h"
28
29using namespace llvm::hlsl;
30
32
33namespace hlsl {
34
35namespace {
36
37static FunctionDecl *lookupBuiltinFunction(Sema &S, StringRef Name) {
38 IdentifierInfo &II =
39 S.getASTContext().Idents.get(Name, tok::TokenKind::identifier);
40 DeclarationNameInfo NameInfo =
41 DeclarationNameInfo(DeclarationName(&II), SourceLocation());
43
44
45 S.LookupName(R, S.getCurScope());
46
47
48 assert(R.isSingleResult() &&
49 "Since this is a builtin it should always resolve!");
51}
52
53CXXConstructorDecl *lookupCopyConstructor(QualType ResTy) {
54 assert(ResTy->isRecordType() && "not a CXXRecord type");
55 for (auto *CD : ResTy->getAsCXXRecordDecl()->ctors())
56 if (CD->isCopyConstructor())
57 return CD;
58 return nullptr;
59}
60
62convertParamModifierToParamABI(HLSLParamModifierAttr::Spelling Modifier) {
63 assert(Modifier != HLSLParamModifierAttr::Spelling::Keyword_in &&
64 "HLSL 'in' parameters modifier cannot be converted to ParameterABI");
65 switch (Modifier) {
66 case HLSLParamModifierAttr::Spelling::Keyword_out:
68 case HLSLParamModifierAttr::Spelling::Keyword_inout:
70 default:
71 llvm_unreachable("Invalid HLSL parameter modifier");
72 }
73}
74
75QualType getInoutParameterType(ASTContext &AST, QualType Ty) {
76 assert(!Ty->isReferenceType() &&
77 "Pointer and reference types cannot be inout or out parameters");
79 Ty.addRestrict();
80 return Ty;
81}
82
83}
84
85
86
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
128private:
129 struct Param {
132 HLSLParamModifierAttr::Spelling Modifier;
134 HLSLParamModifierAttr::Spelling Modifier)
135 : NameII(NameII), Ty(Ty), Modifier(Modifier) {}
136 };
137
138 struct LocalVar {
139 StringRef Name;
142 LocalVar(StringRef Name, QualType Ty) : Name(Name), Ty(Ty), Decl(nullptr) {}
143 };
144
148
149
151 bool IsConst;
152 bool IsCtor;
156
157
158
159
160
161
162
163
164 enum class PlaceHolder {
165 _0,
166 _1,
167 _2,
168 _3,
169 _4,
170 _5,
171 Handle = 128,
172 CounterHandle,
173 LastStmt
174 };
175
176 Expr *convertPlaceholder(PlaceHolder PH);
177 Expr *convertPlaceholder(LocalVar &Var);
178 Expr *convertPlaceholder(Expr *E) { return E; }
179
180public:
182
184 QualType ReturnTy, bool IsConst = false,
186 : DeclBuilder(DB), Name(Name), ReturnTy(ReturnTy), Method(nullptr),
187 IsConst(IsConst), IsCtor(IsCtor), SC(SC) {}
188
190 QualType ReturnTy, bool IsConst = false,
193
195
198
200 HLSLParamModifierAttr::Spelling Modifier =
201 HLSLParamModifierAttr::Keyword_in);
203 template <typename... Ts>
205 QualType ReturnType, Ts &&...ArgSpecs);
206 template <typename TLHS, typename TRHS>
209 template
211 template <typename ResourceT, typename ValueT>
213 ValueT HandleValue);
214 template
217 template <typename ResourceT, typename ValueT>
225
226private:
227 void createDecl();
228
229
230
231 void ensureCompleteDecl() {
232 if (!Method)
233 createDecl();
234 }
235
236 template <typename ResourceT, typename ValueT>
238 ValueT HandleValue,
240};
241
245
249 assert(.Record->isCompleteDefinition() &&
250 "record is already complete");
252 unsigned Position = static_cast<unsigned>(Params.size());
255 0, Position,
256 &AST.Idents.get(Name, tok::TokenKind::identifier),
257 true,
258 false,
259 false);
260 if (!DefaultValue.isNull())
261 Decl->setDefaultArgument(AST,
262 Builder.SemaRef.getTrivialTemplateArgumentLoc(
264
266 return *this;
267}
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
299
300
301
302
304 "unexpected concept decl parameter count");
307
308
309
310
312 Context,
313 Builder.Record->getDeclContext(),
315 0,
316 0,
317 nullptr,
318 true,
319 false,
320 false
321 );
322
323 T->setDeclContext(DC);
324
325 QualType ConceptTType = Context.getTypeDeclType(ConceptTTPD);
326
327
328
330
331 QualType CSETType = Context.getTypeDeclType(T);
332
333
334
336
339 Context, Builder.Record->getDeclContext(), Loc, {CSETA});
340
341
342
343
347
351
352
353
356
359
360 return CSE;
361}
362
367
377
378 Builder.Record->setDescribedClassTemplate(Builder.Template);
379 Builder.Template->setImplicit(true);
380 Builder.Template->setLexicalDeclContext(Builder.Record->getDeclContext());
381
382
383
384 Builder.Template->setPreviousDecl(Builder.PrevTemplate);
385 Builder.Record->getDeclContext()->addDecl(Builder.Template);
387
389}
390
391Expr *BuiltinTypeMethodBuilder::convertPlaceholder(PlaceHolder PH) {
392 if (PH == PlaceHolder::Handle)
394 if (PH == PlaceHolder::CounterHandle)
396
397 if (PH == PlaceHolder::LastStmt) {
398 assert(!StmtsList.empty() && "no statements in the list");
399 Stmt *LastStmt = StmtsList.pop_back_val();
400 assert(isa(LastStmt) && "last statement does not have a value");
402 }
403
405 ParmVarDecl *ParamDecl = Method->getParamDecl(static_cast<unsigned>(PH));
410}
411
412Expr *BuiltinTypeMethodBuilder::convertPlaceholder(LocalVar &Var) {
413 VarDecl *VD = Var.Decl;
414 assert(VD && "local variable is not declared");
416 VD->getASTContext(), NestedNameSpecifierLoc(), SourceLocation(), VD,
417 false, DeclarationNameInfo(VD->getDeclName(), SourceLocation()),
419}
420
422 StringRef NameStr,
424 bool IsConst, bool IsCtor,
426 : DeclBuilder(DB), ReturnTy(ReturnTy), Method(nullptr), IsConst(IsConst),
427 IsCtor(IsCtor), SC(SC) {
428
429 assert((!NameStr.empty() || IsCtor) && "method needs a name");
430 assert(((IsCtor && !IsConst) || !IsCtor) && "constructor cannot be const");
431
433 if (IsCtor) {
436 } else {
438 AST.Idents.get(NameStr, tok::TokenKind::identifier);
440 }
441}
442
445 HLSLParamModifierAttr::Spelling Modifier) {
446 assert(Method == nullptr && "Cannot add param, method already created");
447 const IdentifierInfo &II = DeclBuilder.SemaRef.getASTContext().Idents.get(
448 Name, tok::TokenKind::identifier);
449 Params.emplace_back(II, Ty, Modifier);
450 return *this;
451}
452
453void BuiltinTypeMethodBuilder::createDecl() {
454 assert(Method == nullptr && "Method or constructor is already created");
455
456
460 uint32_t ArgIndex = 0;
461
462
463 bool UseParamExtInfo = false;
464 for (Param &MP : Params) {
465 if (MP.Modifier != HLSLParamModifierAttr::Keyword_in) {
466 UseParamExtInfo = true;
468 ParamExtInfos[ArgIndex] =
469 PI.withABI(convertParamModifierToParamABI(MP.Modifier));
470 if (!MP.Ty->isDependentType())
471 MP.Ty = getInoutParameterType(AST, MP.Ty);
472 }
473 ParamTypes.emplace_back(MP.Ty);
474 ++ArgIndex;
475 }
476
477 FunctionProtoType::ExtProtoInfo ExtInfo;
478 if (UseParamExtInfo)
479 ExtInfo.ExtParameterInfos = ParamExtInfos.data();
480 if (IsConst)
481 ExtInfo.TypeQuals.addConst();
482
483 QualType FuncTy = AST.getFunctionType(ReturnTy, ParamTypes, ExtInfo);
484
485
487 DeclarationNameInfo NameInfo = DeclarationNameInfo(Name, SourceLocation());
488 if (IsCtor)
490 AST, DeclBuilder.Record, SourceLocation(), NameInfo, FuncTy, TSInfo,
491 ExplicitSpecifier(), false, true, false,
493 else
495 AST, DeclBuilder.Record, SourceLocation(), NameInfo, FuncTy, TSInfo, SC,
497
498
501 auto FnProtoLoc =
502 Method->getTypeSourceInfo()->getTypeLoc().getAs();
503 for (int I = 0, E = Params.size(); I != E; I++) {
504 Param &MP = Params[I];
506 AST, Method->getDeclContext(), SourceLocation(), SourceLocation(),
507 &MP.NameII, MP.Ty,
509 nullptr);
510 if (MP.Modifier != HLSLParamModifierAttr::Keyword_in) {
511 auto *Mod =
512 HLSLParamModifierAttr::Create(AST, SourceRange(), MP.Modifier);
513 Parm->addAttr(Mod);
514 }
515 Parm->setScopeInfo(CurScopeDepth, I);
516 ParmDecls.push_back(Parm);
517 FnProtoLoc.setParam(I, Parm);
518 }
519 Method->setParams({ParmDecls});
520}
521
523 ensureCompleteDecl();
524
525 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
527 AST, SourceLocation(), Method->getFunctionObjectParameterType(), true);
528 FieldDecl *HandleField = DeclBuilder.getResourceHandleField();
532}
533
535 ensureCompleteDecl();
536
537 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
539 AST, SourceLocation(), Method->getFunctionObjectParameterType(), true);
540 FieldDecl *HandleField = DeclBuilder.getResourceCounterHandleField();
544}
545
548 ensureCompleteDecl();
549
550 assert(Var.Decl == nullptr && "local variable is already declared");
551
552 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
555 &AST.Idents.get(Var.Name, tok::TokenKind::identifier), Var.Ty,
559 StmtsList.push_back(DS);
560 return *this;
561}
562
564 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
566 AST, SourceLocation(), Method->getFunctionObjectParameterType(),
567 true);
568 StmtsList.push_back(ThisExpr);
569 return *this;
570}
571
572template <typename... Ts>
575 QualType ReturnType, Ts &&...ArgSpecs) {
576 ensureCompleteDecl();
577
578 std::array<Expr *, sizeof...(ArgSpecs)> Args{
579 convertPlaceholder(std::forward(ArgSpecs))...};
580
581 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
582 FunctionDecl *FD = lookupBuiltinFunction(DeclBuilder.SemaRef, BuiltinName);
586
590
591 if (ReturnType.isNull())
593
596 StmtsList.push_back(Call);
597 return *this;
598}
599
600template <typename TLHS, typename TRHS>
602 Expr *LHSExpr = convertPlaceholder(LHS);
603 Expr *RHSExpr = convertPlaceholder(RHS);
605 DeclBuilder.SemaRef.getASTContext(), LHSExpr, RHSExpr, BO_Assign,
608 StmtsList.push_back(AssignStmt);
609 return *this;
610}
611
612template
614 Expr *PtrExpr = convertPlaceholder(Ptr);
615 Expr *Deref =
620 StmtsList.push_back(Deref);
621 return *this;
622}
623
624template
627 ensureCompleteDecl();
628
629 Expr *ResourceExpr = convertPlaceholder(ResourceRecord);
630
631 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
632 FieldDecl *HandleField = DeclBuilder.getResourceHandleField();
634 AST, ResourceExpr, false, HandleField, HandleField->getType(), VK_LValue,
636 StmtsList.push_back(HandleExpr);
637 return *this;
638}
639
640template <typename ResourceT, typename ValueT>
643 ValueT HandleValue) {
644 return setFieldOnResource(ResourceRecord, HandleValue,
645 DeclBuilder.getResourceHandleField());
646}
647
648template <typename ResourceT, typename ValueT>
651 ResourceT ResourceRecord, ValueT HandleValue) {
652 return setFieldOnResource(ResourceRecord, HandleValue,
653 DeclBuilder.getResourceCounterHandleField());
654}
655
656template <typename ResourceT, typename ValueT>
658 ResourceT ResourceRecord, ValueT HandleValue, FieldDecl *HandleField) {
659 ensureCompleteDecl();
660
661 Expr *ResourceExpr = convertPlaceholder(ResourceRecord);
662 Expr *HandleValueExpr = convertPlaceholder(HandleValue);
663
666 AST, ResourceExpr, false, HandleField, HandleField->getType(), VK_LValue,
669 DeclBuilder.SemaRef.getASTContext(), HandleMemberExpr, HandleValueExpr,
672 StmtsList.push_back(AssignStmt);
673 return *this;
674}
675
676template
677BuiltinTypeMethodBuilder &
679 ensureCompleteDecl();
680
681 Expr *ResourceExpr = convertPlaceholder(ResourceRecord);
682
683 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
684 FieldDecl *HandleField = DeclBuilder.getResourceCounterHandleField();
686 AST, ResourceExpr, false, HandleField, HandleField->getType(), VK_LValue,
688 StmtsList.push_back(HandleExpr);
689 return *this;
690}
691
692template
694 ensureCompleteDecl();
695
696 Expr *ReturnValueExpr = convertPlaceholder(ReturnValue);
697 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
698
701
702
703 auto *ICE =
707 assert(CD && "no copy constructor found");
709 AST, Ty, SourceLocation(), CD, false, {ICE},
710 false, false,
711 false,
714 }
715 StmtsList.push_back(
717 return *this;
718}
719
721 assert(!DeclBuilder.Record->isCompleteDefinition() &&
722 "record is already complete");
723
724 ensureCompleteDecl();
725
726 if (!Method->hasBody()) {
727 ASTContext &AST = DeclBuilder.SemaRef.getASTContext();
728 assert((ReturnTy == AST.VoidTy || !StmtsList.empty()) &&
729 "nothing to return from non-void method");
730 if (ReturnTy != AST.VoidTy) {
731 if (Expr *LastExpr = dyn_cast(StmtsList.back())) {
733 ReturnTy.getNonReferenceType()) &&
734 "Return type of the last statement must match the return type "
735 "of the method");
737 StmtsList.pop_back();
738 StmtsList.push_back(
740 }
741 }
742 }
743
746 Method->setLexicalDeclContext(DeclBuilder.Record);
748 Method->addAttr(AlwaysInlineAttr::CreateImplicit(
749 AST, SourceRange(), AlwaysInlineAttr::CXX11_clang_always_inline));
750 DeclBuilder.Record->addDecl(Method);
751 }
752 return DeclBuilder;
753}
754
756 : SemaRef(SemaRef), Record(R) {
757 Record->startDefinition();
758 Template = Record->getDescribedClassTemplate();
759}
760
763 StringRef Name)
764 : SemaRef(SemaRef), HLSLNamespace(Namespace) {
765 ASTContext &AST = SemaRef.getASTContext();
767
770 if (SemaRef.LookupQualifiedName(Result, HLSLNamespace)) {
771
773 if (auto *TD = dyn_cast(Found)) {
774 PrevDecl = TD->getTemplatedDecl();
775 PrevTemplate = TD;
776 } else
777 PrevDecl = dyn_cast(Found);
778 assert(PrevDecl && "Unexpected lookup result type.");
779 }
780
782 Record = PrevDecl;
783 Template = PrevTemplate;
784 return;
785 }
786
787 Record =
790 Record->setImplicit(true);
791 Record->setLexicalDeclContext(HLSLNamespace);
792 Record->setHasExternalLexicalStorage();
793
794
795 Record->addAttr(
796 FinalAttr::CreateImplicit(AST, SourceRange(), FinalAttr::Keyword_final));
797}
798
800 if (HLSLNamespace && !Template && Record->getDeclContext() == HLSLNamespace)
801 HLSLNamespace->addDecl(Record);
802}
803
808 assert(!Record->isCompleteDefinition() && "record is already complete");
809 assert(Record->isBeingDefined() &&
810 "Definition must be started before adding members!");
811 ASTContext &AST = Record->getASTContext();
812
819 Field->setAccess(Access);
820 Field->setImplicit(true);
821 for (Attr *A : Attrs) {
822 if (A)
823 Field->addAttr(A);
824 }
825
826 Record->addDecl(Field);
827 Fields[Name] = Field;
828 return *this;
829}
830
833 bool RawBuffer, bool HasCounter,
835 addHandleMember(RC, IsROV, RawBuffer, Access);
836 if (HasCounter)
837 addCounterHandleMember(RC, IsROV, RawBuffer, Access);
838 return *this;
839}
840
842 ResourceClass RC, bool IsROV, bool RawBuffer, AccessSpecifier Access) {
843 return addResourceMember("__handle", RC, IsROV, RawBuffer,
844 false, Access);
845}
846
848 ResourceClass RC, bool IsROV, bool RawBuffer, AccessSpecifier Access) {
849 return addResourceMember("__counter_handle", RC, IsROV, RawBuffer,
850 true, Access);
851}
852
854 StringRef MemberName, ResourceClass RC, bool IsROV, bool RawBuffer,
855 bool IsCounter, AccessSpecifier Access) {
856 assert(->isCompleteDefinition() && "record is already complete");
857
859 TypeSourceInfo *ElementTypeInfo =
861
862
863 QualType AttributedResTy = QualType();
865 HLSLResourceClassAttr::CreateImplicit(Ctx, RC),
866 IsROV ? HLSLROVAttr::CreateImplicit(Ctx) : nullptr,
867 RawBuffer ? HLSLRawBufferAttr::CreateImplicit(Ctx) : nullptr,
868 ElementTypeInfo
869 ? HLSLContainedTypeAttr::CreateImplicit(Ctx, ElementTypeInfo)
871 if (IsCounter)
872 Attrs.push_back(HLSLIsCounterAttr::CreateImplicit(Ctx));
873
875 AttributedResTy))
877 return *this;
878}
879
880
881
883 assert(!Record->isCompleteDefinition() && "record is already complete");
884
885 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
886 QualType HandleType = getResourceHandleField()->getType();
888 false, true)
889 .callBuiltin("__builtin_hlsl_resource_uninitializedhandle", HandleType,
890 PH::Handle)
891 .assign(PH::Handle, PH::LastStmt)
892 .finalize();
893}
894
897 if (HasCounter) {
898 addCreateFromBindingWithImplicitCounter();
899 addCreateFromImplicitBindingWithImplicitCounter();
900 } else {
901 addCreateFromBinding();
902 addCreateFromImplicitBinding();
903 }
904 return *this;
905}
906
907
908
909
910
911
912
913
914
915
916
917
919 assert(->isCompleteDefinition() && "record is already complete");
920
921 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
923 QualType HandleType = getResourceHandleField()->getType();
925 BuiltinTypeMethodBuilder::LocalVar TmpVar("tmp", RecordType);
926
931 .addParam("range", AST.IntTy)
934 .declareLocalVar(TmpVar)
935 .accessHandleFieldOnResource(TmpVar)
936 .callBuiltin("__builtin_hlsl_resource_handlefrombinding", HandleType,
937 PH::LastStmt, PH::_0, PH::_1, PH::_2, PH::_3, PH::_4)
938 .setHandleFieldOnResource(TmpVar, PH::LastStmt)
939 .returnValue(TmpVar)
940 .finalize();
941}
942
943
944
945
946
947
948
949
950
951
952
953
954
956 assert(->isCompleteDefinition() && "record is already complete");
957
958 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
960 QualType HandleType = getResourceHandleField()->getType();
962 BuiltinTypeMethodBuilder::LocalVar TmpVar("tmp", RecordType);
963
965 RecordType, false, false, SC_Static)
968 .addParam("range", AST.IntTy)
971 .declareLocalVar(TmpVar)
972 .accessHandleFieldOnResource(TmpVar)
973 .callBuiltin("__builtin_hlsl_resource_handlefromimplicitbinding",
974 HandleType, PH::LastStmt, PH::_0, PH::_1, PH::_2, PH::_3,
975 PH::_4)
976 .setHandleFieldOnResource(TmpVar, PH::LastStmt)
977 .returnValue(TmpVar)
978 .finalize();
979}
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
997BuiltinTypeDeclBuilder::addCreateFromBindingWithImplicitCounter() {
998 assert(->isCompleteDefinition() && "record is already complete");
999
1000 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1002 QualType HandleType = getResourceHandleField()->getType();
1004 BuiltinTypeMethodBuilder::LocalVar TmpVar("tmp", RecordType);
1005
1007 "__createFromBindingWithImplicitCounter",
1008 RecordType, false, false, SC_Static)
1011 .addParam("range", AST.IntTy)
1015 .declareLocalVar(TmpVar)
1016 .accessHandleFieldOnResource(TmpVar)
1017 .callBuiltin("__builtin_hlsl_resource_handlefrombinding", HandleType,
1018 PH::LastStmt, PH::_0, PH::_1, PH::_2, PH::_3, PH::_4)
1019 .setHandleFieldOnResource(TmpVar, PH::LastStmt)
1020 .accessHandleFieldOnResource(TmpVar)
1021 .callBuiltin("__builtin_hlsl_resource_counterhandlefromimplicitbinding",
1022 HandleType, PH::LastStmt, PH::_5, PH::_1)
1023 .setCounterHandleFieldOnResource(TmpVar, PH::LastStmt)
1024 .returnValue(TmpVar)
1025 .finalize();
1026}
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1045BuiltinTypeDeclBuilder::addCreateFromImplicitBindingWithImplicitCounter() {
1046 assert(!Record->isCompleteDefinition() && "record is already complete");
1047
1048 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1049 ASTContext &AST = SemaRef.getASTContext();
1050 QualType HandleType = getResourceHandleField()->getType();
1052 BuiltinTypeMethodBuilder::LocalVar TmpVar("tmp", RecordType);
1053
1055 *this, "__createFromImplicitBindingWithImplicitCounter",
1056 RecordType, false, false, SC_Static)
1059 .addParam("range", AST.IntTy)
1063 .declareLocalVar(TmpVar)
1064 .accessHandleFieldOnResource(TmpVar)
1065 .callBuiltin("__builtin_hlsl_resource_handlefromimplicitbinding",
1066 HandleType, PH::LastStmt, PH::_0, PH::_1, PH::_2, PH::_3,
1067 PH::_4)
1068 .setHandleFieldOnResource(TmpVar, PH::LastStmt)
1069 .accessHandleFieldOnResource(TmpVar)
1070 .callBuiltin("__builtin_hlsl_resource_counterhandlefromimplicitbinding",
1071 HandleType, PH::LastStmt, PH::_5, PH::_1)
1072 .setCounterHandleFieldOnResource(TmpVar, PH::LastStmt)
1073 .returnValue(TmpVar)
1074 .finalize();
1075}
1076
1078 assert(!Record->isCompleteDefinition() && "record is already complete");
1079
1080 ASTContext &AST = SemaRef.getASTContext();
1084
1085 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1086
1088 false, true);
1089 MMB.addParam("other", ConstRecordRefType)
1091 .assign(PH::Handle, PH::LastStmt);
1092
1093 if (getResourceCounterHandleField())
1095 PH::LastStmt);
1096
1098}
1099
1101 assert(!Record->isCompleteDefinition() && "record is already complete");
1102
1103 ASTContext &AST = SemaRef.getASTContext();
1108
1109 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1112 MMB.addParam("other", ConstRecordRefType)
1114 .assign(PH::Handle, PH::LastStmt);
1115
1116 if (getResourceCounterHandleField())
1118 PH::LastStmt);
1119
1121}
1122
1124 ASTContext &AST = Record->getASTContext();
1127
1129 if (getResourceAttrs().ResourceClass == llvm::dxil::ResourceClass::UAV)
1131
1132 return *this;
1133}
1134
1136 assert(!Record->isCompleteDefinition() && "record is already complete");
1137
1138 ASTContext &AST = Record->getASTContext();
1141
1144
1145 return *this;
1146}
1147
1148FieldDecl *BuiltinTypeDeclBuilder::getResourceHandleField() const {
1149 auto I = Fields.find("__handle");
1150 assert(I != Fields.end() &&
1151 I->second->getType()->isHLSLAttributedResourceType() &&
1152 "record does not have resource handle field");
1153 return I->second;
1154}
1155
1156FieldDecl *BuiltinTypeDeclBuilder::getResourceCounterHandleField() const {
1157 auto I = Fields.find("__counter_handle");
1158 if (I == Fields.end() ||
1159 !I->second->getType()->isHLSLAttributedResourceType())
1160 return nullptr;
1161 return I->second;
1162}
1163
1164QualType BuiltinTypeDeclBuilder::getFirstTemplateTypeParam() {
1165 assert(Template && "record it not a template");
1166 if (const auto *TTD = dyn_cast(
1167 Template->getTemplateParameters()->getParam(0))) {
1168 return QualType(TTD->getTypeForDecl(), 0);
1169 }
1170 return QualType();
1171}
1172
1173QualType BuiltinTypeDeclBuilder::getHandleElementType() {
1174 if (Template)
1175 return getFirstTemplateTypeParam();
1176
1177 return SemaRef.getASTContext().Char8Ty;
1178}
1179
1180HLSLAttributedResourceType::Attributes
1181BuiltinTypeDeclBuilder::getResourceAttrs() const {
1182 QualType HandleType = getResourceHandleField()->getType();
1184}
1185
1187 assert(!Record->isCompleteDefinition() && "record is already complete");
1188 assert(Record->isBeingDefined() &&
1189 "Definition must be started before completing it.");
1190
1191 Record->completeDefinition();
1192 return *this;
1193}
1194
1195Expr *BuiltinTypeDeclBuilder::getConstantIntExpr(int value) {
1200}
1201
1205 if (Record->isCompleteDefinition()) {
1206 assert(Template && "existing record it not a template");
1207 assert(Template->getTemplateParameters()->size() == Names.size() &&
1208 "template param count mismatch");
1209 return *this;
1210 }
1211
1213 for (StringRef Name : Names)
1214 Builder.addTypeParameter(Name);
1215 return Builder.finalizeTemplateArgs(CD);
1216}
1217
1219 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1221 SemaRef.getASTContext().UnsignedIntTy)
1222 .callBuiltin("__builtin_hlsl_buffer_update_counter", QualType(),
1223 PH::CounterHandle, getConstantIntExpr(1))
1224 .finalize();
1225}
1226
1228 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1230 SemaRef.getASTContext().UnsignedIntTy)
1231 .callBuiltin("__builtin_hlsl_buffer_update_counter", QualType(),
1232 PH::CounterHandle, getConstantIntExpr(-1))
1233 .finalize();
1234}
1235
1238 bool IsConst) {
1239 assert(!Record->isCompleteDefinition() && "record is already complete");
1240 ASTContext &AST = SemaRef.getASTContext();
1241 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1242
1243 QualType ReturnTy = getHandleElementType();
1246 .addParam("Status", AST.UnsignedIntTy, HLSLParamModifierAttr::Keyword_out)
1247 .callBuiltin("__builtin_hlsl_resource_load_with_status", ReturnTy,
1248 PH::Handle, PH::_0, PH::_1)
1249 .finalize();
1250}
1251
1254 bool IsConst, bool IsRef) {
1255 assert(!Record->isCompleteDefinition() && "record is already complete");
1256 ASTContext &AST = SemaRef.getASTContext();
1257 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1258
1259 QualType ElemTy = getHandleElementType();
1264
1265 if (IsRef) {
1266 ReturnTy = AddrSpaceElemTy;
1267 if (IsConst)
1270 } else {
1271 ReturnTy = ElemTy;
1272 if (IsConst)
1274 }
1275
1278 .callBuiltin("__builtin_hlsl_resource_getpointer", ElemPtrTy, PH::Handle,
1279 PH::_0)
1280 .dereference(PH::LastStmt)
1281 .finalize();
1282}
1283
1285 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1286 ASTContext &AST = SemaRef.getASTContext();
1287 QualType ElemTy = getHandleElementType();
1291 .addParam("value", ElemTy)
1292 .callBuiltin("__builtin_hlsl_buffer_update_counter", AST.UnsignedIntTy,
1293 PH::CounterHandle, getConstantIntExpr(1))
1294 .callBuiltin("__builtin_hlsl_resource_getpointer",
1296 PH::LastStmt)
1297 .dereference(PH::LastStmt)
1298 .assign(PH::LastStmt, PH::_0)
1299 .finalize();
1300}
1301
1303 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1304 ASTContext &AST = SemaRef.getASTContext();
1305 QualType ElemTy = getHandleElementType();
1309 .callBuiltin("__builtin_hlsl_buffer_update_counter", AST.UnsignedIntTy,
1310 PH::CounterHandle, getConstantIntExpr(-1))
1311 .callBuiltin("__builtin_hlsl_resource_getpointer",
1313 PH::LastStmt)
1314 .dereference(PH::LastStmt)
1315 .finalize();
1316}
1317
1320 using PH = BuiltinTypeMethodBuilder::PlaceHolder;
1321 ASTContext &AST = SemaRef.getASTContext();
1323
1324 QualType HandleTy = getResourceHandleField()->getType();
1326
1327
1328
1329 if (AttrResTy->getAttrs().RawBuffer &&
1330 AttrResTy->getContainedType() != AST.Char8Ty) {
1332 .addParam("numStructs", UIntTy, HLSLParamModifierAttr::Keyword_out)
1333 .addParam("stride", UIntTy, HLSLParamModifierAttr::Keyword_out)
1334 .callBuiltin("__builtin_hlsl_resource_getdimensions_x", QualType(),
1335 PH::Handle, PH::_0)
1336 .callBuiltin("__builtin_hlsl_resource_getstride", QualType(),
1337 PH::Handle, PH::_1)
1338 .finalize();
1339 }
1340
1341
1342
1344 .addParam("dim", UIntTy, HLSLParamModifierAttr::Keyword_out)
1345 .callBuiltin("__builtin_hlsl_resource_getdimensions_x", QualType(),
1346 PH::Handle, PH::_0)
1347 .finalize();
1348}
1349
1350}
1351}
Defines the clang::ASTContext interface.
llvm::dxil::ResourceClass ResourceClass
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
llvm::MachO::Record Record
This file declares semantic analysis for HLSL constructs.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
QualType getTypeDeclType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const
CanQualType UnsignedIntTy
a trap message and trap category.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
DeclarationNameTable DeclarationNames
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
TypeSourceInfo * getTrivialTypeSourceInfo(QualType T, SourceLocation Loc=SourceLocation()) const
Allocate a TypeSourceInfo where all locations have been initialized to a given location,...
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.
CanQualType UnsignedIntTy
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
QualType getAddrSpaceQualType(QualType T, LangAS AddressSpace) const
Return the uniqued reference to the type for an address space qualified type with the specified type ...
CanQualType getCanonicalTagType(const TagDecl *TD) const
static bool hasSameUnqualifiedType(QualType T1, QualType T2)
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
Attr - This represents one attribute.
static BinaryOperator * Create(const ASTContext &C, Expr *lhs, Expr *rhs, Opcode opc, QualType ResTy, ExprValueKind VK, ExprObjectKind OK, SourceLocation opLoc, FPOptionsOverride FPFeatures)
static CXXConstructExpr * Create(const ASTContext &Ctx, QualType Ty, SourceLocation Loc, CXXConstructorDecl *Ctor, bool Elidable, ArrayRef< Expr * > Args, bool HadMultipleCandidates, bool ListInitialization, bool StdInitListInitialization, bool ZeroInitialization, CXXConstructionKind ConstructKind, SourceRange ParenOrBraceRange)
Create a C++ construction expression.
Represents a C++ constructor within a class.
static CXXConstructorDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, ExplicitSpecifier ES, bool UsesFPIntrin, bool isInline, bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind, InheritedConstructor Inherited=InheritedConstructor(), const AssociatedConstraint &TrailingRequiresClause={})
Represents a static or instance method of a struct/union/class.
static CXXMethodDecl * Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin, bool isInline, ConstexprSpecKind ConstexprKind, SourceLocation EndLocation, const AssociatedConstraint &TrailingRequiresClause={})
Represents a C++ struct/union/class.
static CXXRecordDecl * Create(const ASTContext &C, TagKind TK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, CXXRecordDecl *PrevDecl=nullptr)
Represents the this expression in C++.
static CXXThisExpr * Create(const ASTContext &Ctx, SourceLocation L, QualType Ty, bool IsImplicit)
static CallExpr * Create(const ASTContext &Ctx, Expr *Fn, ArrayRef< Expr * > Args, QualType Ty, ExprValueKind VK, SourceLocation RParenLoc, FPOptionsOverride FPFeatures, unsigned MinNumArgs=0, ADLCallKind UsesADL=NotADL)
Create a call expression.
QualType withConst() const
Retrieves a version of this type with const applied.
static ClassTemplateDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, DeclarationName Name, TemplateParameterList *Params, NamedDecl *Decl)
Create a class template node.
static CompoundStmt * Create(const ASTContext &C, ArrayRef< Stmt * > Stmts, FPOptionsOverride FPFeatures, SourceLocation LB, SourceLocation RB)
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
static ConceptReference * Create(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, TemplateDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten)
Represents the specialization of a concept - evaluates to a prvalue of type bool.
static ConceptSpecializationExpr * Create(const ASTContext &C, ConceptReference *ConceptRef, ImplicitConceptSpecializationDecl *SpecDecl, const ConstraintSatisfaction *Satisfaction)
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
A reference to a declared variable, function, enum, etc.
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)
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
The name of a declaration.
This represents one expression.
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
static FieldDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
Represents a function declaration or definition.
QualType getReturnType() const
DeclarationNameInfo getNameInfo() const
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
ExtParameterInfo withABI(ParameterABI kind) const
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 ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat, FPOptionsOverride FPO)
static ImplicitConceptSpecializationDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation SL, ArrayRef< TemplateArgument > ConvertedArgs)
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'.
Represents the results of name lookup.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
static MemberExpr * CreateImplicit(const ASTContext &C, Expr *Base, bool IsArrow, ValueDecl *MemberDecl, QualType T, ExprValueKind VK, ExprObjectKind OK)
Create an implicit MemberExpr, with no location, qualifier, template arguments, and so on.
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represent a C++ namespace.
A C++ nested-name-specifier augmented with source location information.
Represents a parameter to a function.
static ParmVarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S, Expr *DefArg)
A (possibly-)qualified type.
QualType withConst() const
void addConst()
Add the const type qualifier to this QualType.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
static ReturnStmt * Create(const ASTContext &Ctx, SourceLocation RL, Expr *E, const VarDecl *NRVOCandidate)
Create a return statement.
unsigned getDepth() const
Returns the depth of this scope. The translation-unit has scope depth 0.
Sema - This implements semantic analysis and AST building for C.
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.
Scope * getCurScope() const
Retrieve the parser's current scope.
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
@ LookupTagName
Tag name lookup, which finds the names of enums, classes, structs, and unions.
ASTContext & getASTContext() const
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
A convenient class for passing around template argument information.
void addArgument(const TemplateArgumentLoc &Loc)
Location wrapper for a TemplateArgument.
Represents a template argument.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
NamedDecl * getParam(unsigned Idx)
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)
A container of type source information.
The base class of the type hierarchy.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isRecordType() const
static UnaryOperator * Create(const ASTContext &C, Expr *input, Opcode opc, QualType type, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, bool CanOverflow, FPOptionsOverride FPFeatures)
Represents a variable declaration or definition.
static VarDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass S)
friend struct BuiltinTypeMethodBuilder
BuiltinTypeDeclBuilder(Sema &SemaRef, CXXRecordDecl *R)
Definition HLSLBuiltinTypeDeclBuilder.cpp:755
BuiltinTypeDeclBuilder & addSimpleTemplateParams(ArrayRef< StringRef > Names, ConceptDecl *CD)
Definition HLSLBuiltinTypeDeclBuilder.cpp:1203
BuiltinTypeDeclBuilder & addMemberVariable(StringRef Name, QualType Type, llvm::ArrayRef< Attr * > Attrs, AccessSpecifier Access=AccessSpecifier::AS_private)
Definition HLSLBuiltinTypeDeclBuilder.cpp:805
BuiltinTypeDeclBuilder & addConsumeMethod()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1302
BuiltinTypeDeclBuilder & addLoadWithStatusFunction(DeclarationName &Name, bool IsConst)
Definition HLSLBuiltinTypeDeclBuilder.cpp:1237
~BuiltinTypeDeclBuilder()
Definition HLSLBuiltinTypeDeclBuilder.cpp:799
BuiltinTypeDeclBuilder & addHandleAccessFunction(DeclarationName &Name, bool IsConst, bool IsRef)
Definition HLSLBuiltinTypeDeclBuilder.cpp:1253
friend struct TemplateParameterListBuilder
BuiltinTypeDeclBuilder & addGetDimensionsMethodForBuffer()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1319
BuiltinTypeDeclBuilder & addArraySubscriptOperators()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1123
BuiltinTypeDeclBuilder & completeDefinition()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1186
BuiltinTypeDeclBuilder & addBufferHandles(ResourceClass RC, bool IsROV, bool RawBuffer, bool HasCounter, AccessSpecifier Access=AccessSpecifier::AS_private)
Definition HLSLBuiltinTypeDeclBuilder.cpp:832
BuiltinTypeDeclBuilder & addAppendMethod()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1284
BuiltinTypeDeclBuilder & addIncrementCounterMethod()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1218
BuiltinTypeDeclBuilder & addCopyAssignmentOperator()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1100
BuiltinTypeDeclBuilder & addCopyConstructor()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1077
BuiltinTypeDeclBuilder & addStaticInitializationFunctions(bool HasCounter)
Definition HLSLBuiltinTypeDeclBuilder.cpp:896
BuiltinTypeDeclBuilder & addDefaultHandleConstructor()
Definition HLSLBuiltinTypeDeclBuilder.cpp:882
BuiltinTypeDeclBuilder & addDecrementCounterMethod()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1227
BuiltinTypeDeclBuilder & addLoadMethods()
Definition HLSLBuiltinTypeDeclBuilder.cpp:1135
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
@ ICIS_NoInit
No in-class initializer.
@ OK_Ordinary
An ordinary object is located at an address in memory.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
StorageClass
Storage classes.
@ Result
The result type of a method or function.
ParameterABI
Kinds of parameter ABI.
const FunctionProtoType * T
@ Template
We are parsing a template declaration.
bool CreateHLSLAttributedResourceType(Sema &S, QualType Wrapped, ArrayRef< const Attr * > AttrList, QualType &ResType, HLSLAttributedResourceLocInfo *LocInfo=nullptr)
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
U cast(CodeGen::Address addr)
@ Other
Other implicit parameter.
Represents an explicit template argument list in C++, e.g., the "" in "sort".
static const ASTTemplateArgumentListInfo * Create(const ASTContext &C, const TemplateArgumentListInfo &List)
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
BuiltinTypeMethodBuilder & addParam(StringRef Name, QualType Ty, HLSLParamModifierAttr::Spelling Modifier=HLSLParamModifierAttr::Keyword_in)
Definition HLSLBuiltinTypeDeclBuilder.cpp:444
Expr * getResourceHandleExpr()
Definition HLSLBuiltinTypeDeclBuilder.cpp:522
BuiltinTypeMethodBuilder & callBuiltin(StringRef BuiltinName, QualType ReturnType, Ts &&...ArgSpecs)
Definition HLSLBuiltinTypeDeclBuilder.cpp:574
BuiltinTypeMethodBuilder & accessHandleFieldOnResource(T ResourceRecord)
Definition HLSLBuiltinTypeDeclBuilder.cpp:626
BuiltinTypeDeclBuilder & finalize()
Definition HLSLBuiltinTypeDeclBuilder.cpp:720
Expr * getResourceCounterHandleExpr()
Definition HLSLBuiltinTypeDeclBuilder.cpp:534
BuiltinTypeMethodBuilder & operator=(const BuiltinTypeMethodBuilder &Other)=delete
BuiltinTypeMethodBuilder & returnThis()
Definition HLSLBuiltinTypeDeclBuilder.cpp:563
BuiltinTypeMethodBuilder & dereference(T Ptr)
Definition HLSLBuiltinTypeDeclBuilder.cpp:613
~BuiltinTypeMethodBuilder()
Definition HLSLBuiltinTypeDeclBuilder.cpp:194
BuiltinTypeMethodBuilder & declareLocalVar(LocalVar &Var)
Definition HLSLBuiltinTypeDeclBuilder.cpp:547
BuiltinTypeMethodBuilder & assign(TLHS LHS, TRHS RHS)
Definition HLSLBuiltinTypeDeclBuilder.cpp:601
BuiltinTypeMethodBuilder(const BuiltinTypeMethodBuilder &Other)=delete
BuiltinTypeMethodBuilder & accessCounterHandleFieldOnResource(T ResourceRecord)
Definition HLSLBuiltinTypeDeclBuilder.cpp:678
BuiltinTypeMethodBuilder & setCounterHandleFieldOnResource(ResourceT ResourceRecord, ValueT HandleValue)
Definition HLSLBuiltinTypeDeclBuilder.cpp:650
BuiltinTypeMethodBuilder & setHandleFieldOnResource(ResourceT ResourceRecord, ValueT HandleValue)
Definition HLSLBuiltinTypeDeclBuilder.cpp:642
friend BuiltinTypeDeclBuilder
Definition HLSLBuiltinTypeDeclBuilder.cpp:181
BuiltinTypeMethodBuilder & returnValue(T ReturnValue)
Definition HLSLBuiltinTypeDeclBuilder.cpp:693
BuiltinTypeMethodBuilder(BuiltinTypeDeclBuilder &DB, DeclarationName &Name, QualType ReturnTy, bool IsConst=false, bool IsCtor=false, StorageClass SC=SC_None)
Definition HLSLBuiltinTypeDeclBuilder.cpp:183
TemplateParameterListBuilder & addTypeParameter(StringRef Name, QualType DefaultValue=QualType())
Definition HLSLBuiltinTypeDeclBuilder.cpp:247
BuiltinTypeDeclBuilder & finalizeTemplateArgs(ConceptDecl *CD=nullptr)
Definition HLSLBuiltinTypeDeclBuilder.cpp:364
llvm::SmallVector< NamedDecl * > Params
Definition HLSLBuiltinTypeDeclBuilder.cpp:89
~TemplateParameterListBuilder()
Definition HLSLBuiltinTypeDeclBuilder.cpp:242
TemplateParameterListBuilder(BuiltinTypeDeclBuilder &RB)
Definition HLSLBuiltinTypeDeclBuilder.cpp:91
ConceptSpecializationExpr * constructConceptSpecializationExpr(Sema &S, ConceptDecl *CD)
Definition HLSLBuiltinTypeDeclBuilder.cpp:291
BuiltinTypeDeclBuilder & Builder
Definition HLSLBuiltinTypeDeclBuilder.cpp:88