| /llvm-project-15.0.7/clang/unittests/Analysis/ |
| H A D | ExprMutationAnalyzerTest.cpp | 35 auto AST = in buildASTFromCodeWithArgs() local 38 return AST; in buildASTFromCodeWithArgs() 471 AST = in TEST() 568 AST = in TEST() 614 auto AST = in TEST() local 633 auto AST = in TEST() local 640 AST = in TEST() 961 auto AST = in TEST() local 995 AST = in TEST() 1251 AST = in TEST() [all …]
|
| H A D | CFGBuildResult.h | 28 std::unique_ptr<ASTUnit> AST = nullptr) 29 : S(S), Cfg(std::move(Cfg)), AST(std::move(AST)), Func(Func) {} in S() 33 ASTUnit *getAST() const { return AST.get(); } in getAST() 39 std::unique_ptr<ASTUnit> AST; variable 45 CFGCallback(std::unique_ptr<ASTUnit> AST) : AST(std::move(AST)) {} in CFGCallback() argument 47 std::unique_ptr<ASTUnit> AST; variable 61 std::move(AST)}; in run() 68 std::unique_ptr<ASTUnit> AST = tooling::buildASTFromCodeWithArgs(Code, Args); 69 if (!AST) 72 CFGCallback Callback(std::move(AST)); [all …]
|
| /llvm-project-15.0.7/clang/unittests/Tooling/ |
| H A D | FixItTest.cpp | 32 const CallExpr &CE = onlyCall(AST.context()); in TEST() 40 const CallExpr &CE2 = onlyCall(AST.context()); in TEST() 45 TestAST AST("#define F foo(\n" in TEST() local 48 const CallExpr &CE = onlyCall(AST.context()); in TEST() 49 EXPECT_EQ("F OO", getText(CE, AST.context())); in TEST() 55 const CallExpr &CE2 = onlyCall(AST.context()); in TEST() 56 EXPECT_EQ("", getText(CE2, AST.context())); in TEST() 63 const CallExpr &CE = onlyCall(AST.context()); in TEST() 90 TestAST AST("#define FOO foo(1, 1)\n" in TEST() local 137 TestAST AST(Code); in TEST() local [all …]
|
| H A D | StandardLibraryTest.cpp | 27 const NamedDecl &lookup(TestAST &AST, llvm::StringRef Name) { in lookup() argument 28 TranslationUnitDecl *TU = AST.context().getTranslationUnitDecl(); in lookup() 29 auto Result = TU->lookup(DeclarationName(&AST.context().Idents.get(Name))); in lookup() 52 TestAST AST(R"cpp( in TEST() local 85 auto &VectorNonstd = lookup(AST, "vector"); in TEST() 86 auto *Vec = cast<VarDecl>(lookup(AST, "vec")).getType()->getAsCXXRecordDecl(); in TEST() 88 cast<VarDecl>(lookup(AST, "nest")).getType()->getAsCXXRecordDecl(); in TEST() 90 cast<VarDecl>(lookup(AST, "clock")).getType()->getAsCXXRecordDecl(); in TEST() 91 auto *Sec = cast<VarDecl>(lookup(AST, "sec")).getType()->getAsCXXRecordDecl(); in TEST() 93 cast<VarDecl>(lookup(AST, "div")).getType()->getAsCXXRecordDecl(); in TEST()
|
| /llvm-project-15.0.7/clang/lib/Sema/ |
| H A D | HLSLExternalSemaSource.cpp | 24 ASTContext &AST = SemaPtr->getASTContext(); in InitializeSema() local 27 NamespaceDecl::Create(AST, AST.getTranslationUnitDecl(), false, in InitializeSema() 40 AST, AST.getTranslationUnitDecl(), SourceLocation(), SourceLocation(), in InitializeSema() 42 AST.getTranslationUnitDecl()); in InitializeSema() 44 AST.getTranslationUnitDecl()->addDecl(UsingDecl); in InitializeSema() 48 ASTContext &AST = SemaPtr->getASTContext(); in defineHLSLVectorAlias() local 55 TypeParam->setDefaultArgument(AST.getTrivialTypeSourceInfo(AST.FloatTy)); in defineHLSLVectorAlias() 61 &AST.Idents.get("element_count", tok::TokenKind::identifier), AST.IntTy, in defineHLSLVectorAlias() 62 false, AST.getTrivialTypeSourceInfo(AST.IntTy)); in defineHLSLVectorAlias() 64 IntegerLiteral::Create(AST, llvm::APInt(AST.getIntWidth(AST.IntTy), 4), in defineHLSLVectorAlias() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Support/ |
| H A D | Z3Solver.cpp | 149 Z3_ast AST; member in __anonae660b540111::Z3Expr 157 Z3Expr(const Z3Expr &Copy) : SMTExpr(), Context(Copy.Context), AST(Copy.AST) { in Z3Expr() 166 AST = Other.AST; in operator =() 174 if (AST) in ~Z3Expr() 478 Z3_ast Args[2] = {toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST}; in mkAnd() 483 Z3_ast Args[2] = {toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST}; in mkOr() 523 toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST))); in mkFPMul() 531 toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST))); in mkFPDiv() 545 toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST))); in mkFPAdd() 553 toZ3Expr(*LHS).AST, toZ3Expr(*RHS).AST))); in mkFPSub() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/unittests/ |
| H A D | IncludeCleanerTests.cpp | 340 auto AST = TU.build(); in TEST() local 471 findReferencedLocations(AST), AST.getIncludeStructure(), in TEST() 472 AST.getCanonicalIncludes(), AST.getSourceManager()); in TEST() 505 findReferencedLocations(AST), AST.getIncludeStructure(), in TEST() 506 AST.getCanonicalIncludes(), AST.getSourceManager()); in TEST() 537 findReferencedLocations(AST), AST.getIncludeStructure(), in TEST() 538 AST.getCanonicalIncludes(), AST.getSourceManager()); in TEST() 575 findReferencedLocations(AST), AST.getIncludeStructure(), in TEST() 576 AST.getCanonicalIncludes(), AST.getSourceManager()); in TEST() 600 findReferencedLocations(AST), AST.getIncludeStructure(), in TEST() [all …]
|
| H A D | SelectionTests.cpp | 32 return SelectionTree::createRight(AST.getASTContext(), AST.getTokens(), in makeSelectionTree() 37 AST.getASTContext(), AST.getTokens(), in makeSelectionTree() 42 return SelectionTree::createRight(AST.getASTContext(), AST.getTokens(), 0u, in makeSelectionTree() 657 auto AST = TU.build(); in TEST() local 675 auto AST = TU.build(); in TEST() local 733 AST.getASTContext(), AST.getTokens(), Test.point("ambiguous"), in TEST() 747 SelectionTree::createEach(AST.getASTContext(), AST.getTokens(), in TEST() 756 SelectionTree::createEach(AST.getASTContext(), AST.getTokens(), in TEST() 765 SelectionTree::createEach(AST.getASTContext(), AST.getTokens(), in TEST() 775 SelectionTree::createEach(AST.getASTContext(), AST.getTokens(), in TEST() [all …]
|
| H A D | ParsedASTTests.cpp | 659 AST = TU.build(); in TEST() 668 AST = TU.build(); in TEST() 677 AST = TU.build(); in TEST() 686 AST = TU.build(); in TEST() 697 AST = TU.build(); in TEST() 709 AST = TU.build(); in TEST() 721 AST = TU.build(); in TEST() 733 AST = TU.build(); in TEST() 745 AST = TU.build(); in TEST() 754 AST = TU.build(); in TEST() [all …]
|
| H A D | ASTTests.cpp | 238 auto AST = TU.build(); in TEST() local 302 auto AST = TU.build(); in TEST() local 343 auto AST = TU.build(); in TEST() local 450 ParsedAST AST = TU.build(); in TEST() local 453 findDecl(AST, [&](const NamedDecl &ND) { in TEST() 468 EXPECT_EQ(getQualification(AST.getASTContext(), in TEST() 516 ParsedAST AST = TU.build(); in TEST() local 519 findDecl(AST, [&](const NamedDecl &ND) { in TEST() 550 ParsedAST AST = TU.build(); in TEST() local 579 ParsedAST AST = TestTU::withCode(Code).build(); in TEST() local [all …]
|
| H A D | DumpASTTests.cpp | 147 ParsedAST AST = TestTU::withCode(Case.first).build(); in TEST() local 149 AST.getTokens(), AST.getASTContext()); in TEST() 157 ParsedAST AST = TestTU::withCode(Case.code()).build(); in TEST() local 158 auto Node = dumpAST(DynTypedNode::create(findDecl(AST, "x")), AST.getTokens(), in TEST() 159 AST.getASTContext()); in TEST() 168 ParsedAST AST = TU.build(); in TEST() local 170 DynTypedNode::create(*AST.getASTContext().getTranslationUnitDecl()), in TEST() 171 AST.getTokens(), AST.getASTContext()); in TEST() 179 ParsedAST AST = TestTU::withCode("int x;").build(); in TEST() local 180 auto Node = dumpAST(DynTypedNode::create(findDecl(AST, "x")), AST.getTokens(), in TEST() [all …]
|
| H A D | TypeHierarchyTests.cpp | 71 auto AST = TU.build(); in TEST() local 95 auto AST = TU.build(); in TEST() local 118 auto AST = TU.build(); in TEST() local 144 auto AST = TU.build(); in TEST() local 178 auto AST = TU.build(); in TEST() local 203 auto AST = TU.build(); in TEST() local 251 auto AST = TU.build(); in TEST() local 278 auto AST = TU.build(); in TEST() local 307 auto AST = TU.build(); in TEST() local 331 auto AST = TU.build(); in TEST() local [all …]
|
| H A D | TestTU.cpp | 126 if (!AST) { in build() 130 assert(AST->getDiagnostics() && in build() 157 return std::move(*AST); in build() 161 auto AST = build(); in headerSymbols() local 168 auto AST = build(); in headerRefs() local 173 auto AST = build(); in index() local 176 AST.getASTContext(), AST.getPreprocessor(), in index() 209 TraverseHeadersToo(ParsedAST &AST) in TraverseHeadersToo() argument 217 auto &Ctx = AST.getASTContext(); in findDecl() 236 const NamedDecl &findDecl(ParsedAST &AST, in findDecl() argument [all …]
|
| H A D | XRefsTests.cpp | 131 auto AST = TU.build(); in TEST() local 268 auto AST = TU.build(); in TEST() local 378 auto AST = TU.build(); in TEST() local 396 auto AST = TU.build(); in TEST() local 1041 auto AST = TU.build(); in TEST() local 1195 auto AST = TU.build(); in TEST() local 1243 AST.getTokens(), AST.getLangOpts()); in TEST() 1305 auto AST = TU.build(); in TEST() local 1357 auto AST = TU.build(); in TEST() local 1733 AST.getTokens(), AST.getLangOpts()); in TEST() [all …]
|
| H A D | CallHierarchyTests.cpp | 75 auto AST = TU.build(); in TEST() local 121 auto AST = TU.build(); in TEST() local 163 auto AST = TU.build(); in TEST() local 196 auto AST = TU.build(); in TEST() local 292 ASSERT_TRUE(bool(AST)); in TEST() 297 ASSERT_TRUE(bool(AST)); in TEST() 302 ASSERT_TRUE(bool(AST)); in TEST() 401 ASSERT_TRUE(bool(AST)); in TEST() 406 ASSERT_TRUE(bool(AST)); in TEST() 411 ASSERT_TRUE(bool(AST)); in TEST() [all …]
|
| H A D | FeatureModulesTests.cpp | 48 auto AST = TestTU::withCode("").build(); in TEST() local 50 SelectionTree::createRight(AST.getASTContext(), AST.getTokens(), 0, 0); in TEST() 52 TweakID, Tweak::Selection(nullptr, AST, 0, 0, std::move(Tree), nullptr), in TEST() 78 auto AST = TU.build(); in TEST() local 79 EXPECT_THAT(*AST.getDiagnostics(), testing::Not(testing::IsEmpty())); in TEST() 84 auto AST = TU.build(); in TEST() local 85 EXPECT_THAT(*AST.getDiagnostics(), testing::IsEmpty()); in TEST() 113 auto AST = TU.build(); in TEST() local 114 EXPECT_THAT(*AST.getDiagnostics(), testing::Not(testing::IsEmpty())); in TEST() 119 auto AST = TU.build(); in TEST() local [all …]
|
| H A D | QualityTests.cpp | 54 auto AST = Header.build(); in TEST() local 120 auto AST = Test.build(); in TEST() local 368 auto AST = Header.build(); in TEST() local 370 const NamedDecl *Foo = &findDecl(AST, "Foo"); in TEST() 411 auto AST = Header.build(); in TEST() local 412 const NamedDecl *Foo = &findDecl(AST, "Foo::foo"); in TEST() 413 const NamedDecl *Bar = &findDecl(AST, "Foo::bar"); in TEST() 414 const NamedDecl *Tpl = &findDecl(AST, "Foo::tpl"); in TEST() 435 auto AST = Header.build(); in TEST() local 467 auto AST = Header.build(); in TEST() local [all …]
|
| /llvm-project-15.0.7/clang/unittests/AST/ |
| H A D | RandstructTest.cpp | 129 return AST; in makeAST() 156 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 176 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 196 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 216 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 239 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 260 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 281 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 306 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local 332 std::unique_ptr<ASTUnit> AST = makeAST(R"c( in TEST() local [all …]
|
| H A D | AttrTest.cpp | 48 const VarDecl *getVariableNode(ASTUnit *AST, const std::string &Name) { in getVariableNode() argument 77 auto AST = buildASTFromCode(R"cpp( in TEST() local 92 const FunctionDecl *Func = getFunctionNode(AST.get(), "f"); in TEST() 112 *Annotate->args_begin()[1], AST->getASTContext()) in TEST() 120 EXPECT_EQ(IntTL.getType(), AST->getASTContext().IntTy); in TEST() 124 const VarDecl *Var = getVariableNode(AST.get(), "array"); in TEST() 132 EXPECT_EQ(IntTL.getType(), AST->getASTContext().IntTy); in TEST() 136 const VarDecl *Var = getVariableNode(AST.get(), "fp"); in TEST() 153 EXPECT_EQ(IntTL.getType(), AST->getASTContext().IntTy); in TEST() 157 AST = buildASTFromCodeWithArgs(R"c( in TEST() [all …]
|
| H A D | ASTTraverserTest.cpp | 257 AST->getASTContext()); in TEST() 442 AST->getASTContext()); in TEST() 473 AST->getASTContext()); in TEST() 501 AST->getASTContext()); in TEST() 652 AST->getASTContext()); in TEST() 947 auto AST = in TEST() local 979 AST->getASTContext()); in TEST() 1630 AST->getASTContext()); in TEST() 1721 AST->getASTContext()); in TEST() 1759 AST->getASTContext()); in TEST() [all …]
|
| /llvm-project-15.0.7/llvm/lib/CodeGen/ |
| H A D | MachineModuleSlotTracker.cpp | 23 AST->createMetadataSlot(AAInfo.TBAA); in processMachineFunctionMetadata() 25 AST->createMetadataSlot(AAInfo.TBAAStruct); in processMachineFunctionMetadata() 27 AST->createMetadataSlot(AAInfo.Scope); in processMachineFunctionMetadata() 29 AST->createMetadataSlot(AAInfo.NoAlias); in processMachineFunctionMetadata() 34 AbstractSlotTrackerStorage *AST, const Module *M, in processMachineModule() argument 40 MDNStartSlot = AST->getNextMetadataSlot(); in processMachineModule() 42 processMachineFunctionMetadata(AST, *MF); in processMachineModule() 43 MDNEndSlot = AST->getNextMetadataSlot(); in processMachineModule() 53 MDNStartSlot = AST->getNextMetadataSlot(); in processMachineFunction() 55 processMachineFunctionMetadata(AST, *MF); in processMachineFunction() [all …]
|
| /llvm-project-15.0.7/llvm/utils/gn/secondary/clang/lib/AST/ |
| H A D | BUILD.gn | 4 visibility = [ ":AST" ] 10 visibility = [ ":AST" ] 15 static_library("AST") { 21 "//clang/include/clang/AST:AttrImpl", 22 "//clang/include/clang/AST:AttrNodeTraverse", 28 "//clang/include/clang/AST:DeclNodes", 43 "//clang/include/clang/AST:AttrVisitor", 44 "//clang/include/clang/AST:Attrs", 46 "//clang/include/clang/AST:CommentNodes", 47 "//clang/include/clang/AST:StmtNodes", [all …]
|
| /llvm-project-15.0.7/clang/lib/Frontend/ |
| H A D | ASTUnit.cpp | 787 AST->HeaderInfo.reset(new HeaderSearch(AST->HSOpts, in LoadFromASTFile() 800 AST->PPOpts, AST->getDiagnostics(), *AST->LangOpts, in LoadFromASTFile() 807 AST->Ctx = new ASTContext(*AST->LangOpts, AST->getSourceManager(), in LoadFromASTFile() 822 *AST->PP, AST->Ctx.get(), *AST->HSOpts, *AST->PPOpts, *AST->LangOpts, in LoadFromASTFile() 823 AST->TargetOpts, AST->Target, Counter)); in LoadFromASTFile() 831 AST->Ctx->setExternalSource(AST->Reader); in LoadFromASTFile() 858 AST->TheSema.reset(new Sema(PP, *AST->Ctx, *AST->Consumer)); in LoadFromASTFile() 860 AST->Reader->InitializeSema(*AST->TheSema); in LoadFromASTFile() 866 return AST; in LoadFromASTFile() 1493 AST->SourceMgr = new SourceManager(AST->getDiagnostics(), *AST->FileMgr, in create() [all …]
|
| /llvm-project-15.0.7/clang/unittests/Frontend/ |
| H A D | PCHPreambleTest.cpp | 105 return AST; in ParseAST() 108 bool ReparseAST(const std::unique_ptr<ASTUnit> &AST) { in ReparseAST() argument 208 std::unique_ptr<ASTUnit> AST(ParseAST(MainName)); in TEST_F() local 209 ASSERT_TRUE(AST.get()); in TEST_F() 210 ASSERT_FALSE(AST->getDiagnostics().hasErrorOccurred()); in TEST_F() 218 ASSERT_TRUE(ReparseAST(AST)); in TEST_F() 234 std::unique_ptr<ASTUnit> AST(ParseAST(Main)); in TEST_F() local 235 ASSERT_TRUE(AST.get()); in TEST_F() 240 ASSERT_TRUE(ReparseAST(AST)); in TEST_F() 251 ASSERT_TRUE(ReparseAST(AST)); in TEST_F() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/ |
| H A D | XRefs.h | 53 std::vector<LocatedSymbol> locateSymbolAt(ParsedAST &AST, Position Pos, 63 locateSymbolTextually(const SpelledWord &Word, ParsedAST &AST, 74 std::vector<DocumentLink> getDocumentLinks(ParsedAST &AST); 77 std::vector<DocumentHighlight> findDocumentHighlights(ParsedAST &AST, 101 std::vector<LocatedSymbol> findImplementations(ParsedAST &AST, Position Pos, 108 std::vector<LocatedSymbol> findType(ParsedAST &AST, Position Pos); 112 ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit, 116 std::vector<SymbolDetails> getSymbolInfo(ParsedAST &AST, Position Pos); 119 std::vector<const CXXRecordDecl *> findRecordTypeAt(ParsedAST &AST, 144 prepareCallHierarchy(ParsedAST &AST, Position Pos, PathRef TUPath); [all …]
|