Lines Matching defs:AST

13 #include "clang/AST/ASTContext.h"
14 #include "clang/AST/Attr.h"
15 #include "clang/AST/DeclCXX.h"
45 ASTContext &AST = S.getASTContext();
46 IdentifierInfo &II = AST.Idents.get(Name, tok::TokenKind::identifier);
65 Record = CXXRecordDecl::Create(AST, TagDecl::TagKind::Class, HLSLNamespace,
73 Record->addAttr(FinalAttr::CreateImplicit(AST, SourceRange(),
89 ASTContext &AST = Record->getASTContext();
91 IdentifierInfo &II = AST.Idents.get(Name, tok::TokenKind::identifier);
93 AST.getTrivialTypeSourceInfo(Type, SourceLocation());
95 AST, Record, SourceLocation(), SourceLocation(), &II, Type, MemTySource,
129 static DeclRefExpr *lookupBuiltinFunction(ASTContext &AST, Sema &S,
131 IdentifierInfo &II = AST.Idents.get(Name, tok::TokenKind::identifier);
144 return DeclRefExpr::Create(AST, NestedNameSpecifierLoc(), SourceLocation(),
148 static Expr *emitResourceClassExpr(ASTContext &AST, ResourceClass RC) {
150 AST,
151 llvm::APInt(AST.getIntWidth(AST.UnsignedCharTy),
153 AST.UnsignedCharTy, SourceLocation());
160 ASTContext &AST = Record->getASTContext();
163 AST.getFunctionType(AST.VoidTy, {}, FunctionProtoType::ExtProtoInfo());
166 DeclarationName Name = AST.DeclarationNames.getCXXConstructorName(CanTy);
168 AST, Record, SourceLocation(),
170 AST.getTrivialTypeSourceInfo(ConstructorType, SourceLocation()),
175 lookupBuiltinFunction(AST, S, "__builtin_hlsl_create_handle");
176 Expr *RCExpr = emitResourceClassExpr(AST, RC);
177 Expr *Call = CallExpr::Create(AST, Fn, {RCExpr}, AST.VoidPtrTy, VK_PRValue,
181 AST, SourceLocation(), Constructor->getFunctionObjectParameterType(),
183 Expr *Handle = MemberExpr::CreateImplicit(AST, This, false, Fields["h"],
189 if (Handle->getType().getCanonicalType() != AST.VoidPtrTy) {
191 AST, Handle->getType(), VK_PRValue, CK_Dependent, Call, nullptr,
192 AST.getTrivialTypeSourceInfo(Handle->getType(), SourceLocation()),
198 AST, Handle, Call, BO_Assign, Handle->getType(), VK_LValue, OK_Ordinary,
202 CompoundStmt::Create(AST, {Assign}, FPOptionsOverride(),
224 ASTContext &AST = Record->getASTContext();
226 assert(Handle->getType().getCanonicalType() != AST.VoidPtrTy &&
237 ReturnTy = AST.getLValueReferenceType(ReturnTy);
244 AST.getFunctionType(ReturnTy, {AST.UnsignedIntTy}, ExtInfo);
245 auto *TSInfo = AST.getTrivialTypeSourceInfo(MethodTy, SourceLocation());
247 AST, Record, SourceLocation(),
249 AST.DeclarationNames.getCXXOperatorName(OO_Subscript),
254 IdentifierInfo &II = AST.Idents.get("Idx", tok::TokenKind::identifier);
256 AST, MethodDecl->getDeclContext(), SourceLocation(), SourceLocation(),
257 &II, AST.UnsignedIntTy,
258 AST.getTrivialTypeSourceInfo(AST.UnsignedIntTy, SourceLocation()),
267 CXXThisExpr::Create(AST, SourceLocation(),
270 AST, This, false, Handle, Handle->getType(), VK_LValue, OK_Ordinary);
273 AST, NestedNameSpecifierLoc(), SourceLocation(), IdxParam, false,
275 AST.UnsignedIntTy, VK_PRValue);
278 new (AST) ArraySubscriptExpr(HandleAccess, IndexExpr, ElemTy, VK_LValue,
281 auto *Return = ReturnStmt::Create(AST, SourceLocation(), Array, nullptr);
283 MethodDecl->setBody(CompoundStmt::Create(AST, {Return}, FPOptionsOverride(),
289 AST, SourceRange(), AlwaysInlineAttr::CXX11_clang_always_inline));
392 ASTContext &AST = SemaPtr->getASTContext();
394 if (AST.getTranslationUnitDecl()->hasExternalLexicalStorage())
395 (void)AST.getTranslationUnitDecl()->decls_begin();
397 IdentifierInfo &HLSL = AST.Idents.get("hlsl", tok::TokenKind::identifier);
400 if (S.LookupQualifiedName(Result, AST.getTranslationUnitDecl()))
403 AST, AST.getTranslationUnitDecl(), /*Inline=*/false, SourceLocation(),
407 AST.getTranslationUnitDecl()->addDecl(HLSLNamespace);
421 AST, AST.getTranslationUnitDecl(), SourceLocation(), SourceLocation(),
423 AST.getTranslationUnitDecl());
425 AST.getTranslationUnitDecl()->addDecl(UsingDecl);
429 ASTContext &AST = SemaPtr->getASTContext();
434 AST, HLSLNamespace, SourceLocation(), SourceLocation(), 0, 0,
435 &AST.Idents.get("element", tok::TokenKind::identifier), false, false);
437 AST, SemaPtr->getTrivialTemplateArgumentLoc(
438 TemplateArgument(AST.FloatTy), QualType(), SourceLocation()));
443 AST, HLSLNamespace, SourceLocation(), SourceLocation(), 0, 1,
444 &AST.Idents.get("element_count", tok::TokenKind::identifier), AST.IntTy,
445 false, AST.getTrivialTypeSourceInfo(AST.IntTy));
446 llvm::APInt Val(AST.getIntWidth(AST.IntTy), 4);
447 TemplateArgument Default(AST, llvm::APSInt(std::move(Val)), AST.IntTy,
450 AST, SemaPtr->getTrivialTemplateArgumentLoc(Default, AST.IntTy,
455 TemplateParameterList::Create(AST, SourceLocation(), SourceLocation(),
458 IdentifierInfo &II = AST.Idents.get("vector", tok::TokenKind::identifier);
460 QualType AliasType = AST.getDependentSizedExtVectorType(
461 AST.getTemplateTypeParmType(0, 0, false, TypeParam),
463 AST, NestedNameSpecifierLoc(), SourceLocation(), SizeParam, false,
465 AST.IntTy, VK_LValue),
468 auto *Record = TypeAliasDecl::Create(AST, HLSLNamespace, SourceLocation(),
470 AST.getTrivialTypeSourceInfo(AliasType));
474 TypeAliasTemplateDecl::Create(AST, HLSLNamespace, SourceLocation(),