| /llvm-project-15.0.7/clang-tools-extra/unittests/clang-change-namespace/ |
| H A D | ChangeNamespaceTests.cpp | 55 format::getLLVMStyle(), Code, {tooling::Range(0, Code.size())}); in format() 562 std::string Code = in TEST_F() local 611 std::string Code = in TEST_F() local 648 std::string Code = in TEST_F() local 1415 std::string Code = in TEST_F() local 1436 std::string Code = in TEST_F() local 1458 std::string Code = in TEST_F() local 1479 std::string Code = in TEST_F() local 1508 std::string Code = in TEST_F() local 1537 std::string Code = in TEST_F() local [all …]
|
| /llvm-project-15.0.7/clang/unittests/Tooling/ |
| H A D | HeaderIncludesTest.cpp | 28 return std::string(Code); in insert() 48 std::string Code = "int main() {}"; in TEST_F() local 55 std::string Code; in TEST_F() local 57 Code += "#include \"a.h\"\n"; in TEST_F() 64 std::string Code = "#ifndef A_H\n" in TEST_F() local 80 std::string Code = "#ifndef A_H\n" in TEST_F() local 242 std::string Code = "// comment\n" in TEST_F() local 253 std::string Code = "// comment\n" in TEST_F() local 270 std::string Code = "/*\n" in TEST_F() local 287 std::string Code = "/*\n" in TEST_F() local [all …]
|
| H A D | RangeSelectorTest.cpp | 89 StringRef Code = R"cc( in selectFromAssorted() local 132 StringRef Code = R"cc( in TEST() local 151 StringRef Code = R"cc( in TEST() local 171 StringRef Code = R"cc( in TEST() local 209 StringRef Code = R"cc( in TEST() local 225 StringRef Code = R"cc( in TEST() local 240 StringRef Code = R"cc( in TEST() local 256 StringRef Code = R"cc( in TEST() local 268 StringRef Code = R"cc( in TEST() local 282 StringRef Code = R"cc( in TEST() local [all …]
|
| H A D | RefactoringCallbacksTest.cpp | 29 << "Parsing error in \"" << Code << "\""; in expectRewritten() 38 std::string Code = "void f() { int i = 1; }"; in TEST() local 59 std::string Code = "void f() { int i = 1; }"; in TEST() local 70 Code, Expected, in TEST() 81 expectRewritten(Code, Expected, in TEST() 93 Code, Expected, in TEST() 98 std::string Code = "void f() { int i = 1; }"; in TEST() local 106 std::string Code = "void f() { int i = 1; }"; in TEST() local 110 expectRewritten(Code, Expected, in TEST() 116 std::string Code = "void f() { int i = 1; }"; in TEST() local [all …]
|
| H A D | SourceCodeTest.cpp | 91 llvm::Annotations Code; member in __anon42750e5d0111::AnnotatedCodeVisitor 104 << Code.code(); in VisitDeclHelper() 431 Visitor.runOver(Code); in TEST() 479 Visitor.runOver(Code); in TEST() 528 Visitor.runOver(Code); in TEST() 546 Visitor.runOver(Code); in TEST() 559 Visitor.runOver(Code); in TEST() 576 Visitor.runOver(Code); in TEST() 591 Visitor.runOver(Code); in TEST() 607 Visitor.runOver(Code); in TEST() [all …]
|
| /llvm-project-15.0.7/clang/unittests/Format/ |
| H A D | CleanupTest.cpp | 47 std::string Code = "namespace A {\n" in TEST_F() local 62 std::string Code = "namespace A {\n" in TEST_F() local 103 std::string Code = "namespace A\n" in TEST_F() local 122 std::string Code = "#ifdef A\n" in TEST_F() local 173 Code = "try : , {}"; in TEST_F() 250 std::string Code = in TEST_F() local 264 Result = cleanup(Code, Ranges); in TEST_F() 269 std::string Code = in TEST_F() local 433 std::string Code = "\nint x;"; in TEST_F() local 450 std::string Code = "\nint x;"; in TEST_F() local [all …]
|
| H A D | SortIncludesTest.cpp | 44 return sort(Code, GetCodeRange(Code), FileName, ExpectedNumRanges); in sort() 48 sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.cpp", &Cursor); in newCursor() 161 std::string Code = "#include <a>\n" in TEST_F() local 167 EXPECT_TRUE(sortIncludes(FmtStyle, Code, GetCodeRange(Code), "a.cc").empty()); in TEST_F() 176 sortIncludes(FmtStyle, Code, GetCodeRange(Code), "a/extra_action.cc") in TEST_F() 819 EXPECT_EQ(Expected, sort(Code)); in TEST_F() 907 EXPECT_EQ(Expected, sort(Code)); in TEST_F() 963 std::string Code = R"( in TEST_F() local 968 EXPECT_EQ(Code, sort(Code, "input.h", 0)); in TEST_F() 977 EXPECT_EQ(Code, sort(Code, "input.h", 0)); in TEST_F() [all …]
|
| H A D | FormatTestTableGen.cpp | 21 static std::string format(llvm::StringRef Code, unsigned Offset, in format() argument 24 LLVM_DEBUG(llvm::errs() << Code << "\n\n"); in format() 26 tooling::Replacements Replaces = reformat(Style, Code, Ranges); in format() 27 auto Result = applyAllReplacements(Code, Replaces); in format() 33 static std::string format(llvm::StringRef Code) { in format() argument 36 return format(Code, 0, Code.size(), Style); in format() 39 static void verifyFormat(llvm::StringRef Code) { in verifyFormat() argument 40 EXPECT_EQ(Code.str(), format(Code)) << "Expected code is not stable"; in verifyFormat() 41 EXPECT_EQ(Code.str(), format(test::messUp(Code))); in verifyFormat()
|
| H A D | SortImportsTestJava.cpp | 12 std::vector<tooling::Range> GetCodeRange(StringRef Code) { in GetCodeRange() argument 13 return std::vector<tooling::Range>(1, tooling::Range(0, Code.size())); in GetCodeRange() 16 std::string sort(StringRef Code, std::vector<tooling::Range> Ranges) { in sort() argument 17 auto Replaces = sortIncludes(FmtStyle, Code, Ranges, "input.java"); in sort() 19 auto Sorted = applyAllReplacements(Code, Replaces); in sort() 27 std::string sort(StringRef Code) { return sort(Code, GetCodeRange(Code)); } in sort() argument 338 std::string Code = "import org.a;\n" in TEST_F() local 341 sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.java").empty()); in TEST_F() 345 std::string Code = "import org.a;\r\n" in TEST_F() local 348 sortIncludes(FmtStyle, Code, GetCodeRange(Code), "input.java").empty()); in TEST_F()
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/unittests/ |
| H A D | FindTargetTests.cpp | 102 << Code 106 Code = R"cpp( in TEST_F() 112 Code = R"cpp( in TEST_F() 118 Code = R"cpp( in TEST_F() 124 Code = R"cpp( in TEST_F() 135 Code = R"cpp( in TEST_F() 143 Code = R"cpp( in TEST_F() 154 Code = R"cpp( in TEST_F() 164 Code = R"cpp( in TEST_F() 322 Code = R"c( in TEST_F() [all …]
|
| H A D | InsertionPointTests.cpp | 26 Annotations Code(R"cpp( in TEST() local 77 EXPECT_EQ(offsetToPosition(Code.code(), Edit->getOffset()), Code.point("b")); in TEST() 83 Code.point("end")); in TEST() 90 Annotations Code(R"cpp( in TEST() local 131 Code.point("private")); in TEST() 136 Code.point("end")); in TEST() 141 Code.point("end")); in TEST() 181 Annotations Code(R"objc( in TEST() local 189 auto TU = TestTU::withCode(Code.code()); in TEST() 202 Code.point("endIface")); in TEST() [all …]
|
| /llvm-project-15.0.7/clang/unittests/Sema/ |
| H A D | CodeCompleteTest.cpp | 186 Code = R"cpp( in TEST() 195 Code = R"cpp( in TEST() 202 Code = R"cpp( in TEST() 215 Code = R"cpp( in TEST() 222 Code = R"cpp( in TEST() 231 Code = R"cpp( in TEST() 240 Code = R"cpp( in TEST() 247 Code = R"cpp( in TEST() 255 Code = R"cpp( in TEST() 266 Code = R"cpp( in TEST() [all …]
|
| /llvm-project-15.0.7/clang/unittests/ASTMatchers/ |
| H A D | ASTMatchersTest.h | 86 const Twine &Code, const T &AMatcher, bool ExpectMatch, 134 << "Could not find match in \"" << Code << "\""; 159 matches(const Twine &Code, const T &AMatcher, 166 notMatches(const Twine &Code, const T &AMatcher, 174 return matchesConditionally(Code, AMatcher, ExpectMatch, 188 return matchesObjC(Code, AMatcher, false); in notMatchesObjC() 276 return matchesConditionally(Code, AMatcher, true, in matchesWithOpenMP51() 283 return matchesConditionally(Code, AMatcher, false, in notMatchesWithOpenMP51() 289 const Twine &Code, const T &AMatcher, in matchAndVerifyResultConditionally() argument 337 const Twine &Code, const T &AMatcher, in matchAndVerifyResultTrue() argument [all …]
|
| H A D | ASTMatchersTraversalTest.cpp | 1578 Code, in TEST() 1600 Code, in TEST() 1805 Code, in TEST() 1817 Code, in TEST() 1868 Code, in TEST() 1875 Code, in TEST() 1882 Code, in TEST() 1889 Code, in TEST() 2297 Code, in TEST() 2429 Code, in TEST() [all …]
|
| /llvm-project-15.0.7/clang/unittests/ASTMatchers/Dynamic/ |
| H A D | ParserTest.cpp | 46 void parse(StringRef Code) { in parse() argument 223 StringRef Code = in TEST() local 273 Code = in TEST() 295 StringRef Code = in TEST() local 415 StringRef Code; in TEST() local 539 Code = "whileStmt()."; in TEST() 545 Code = "mapAny"; in TEST() 562 Code = "mapAnyOf(ifS"; in TEST() 574 Parser::completeExpression(Code, Code.size(), nullptr, &NamedValues); in TEST() 581 Comps = Parser::completeExpression(Code, Code.size(), nullptr, &NamedValues); in TEST() [all …]
|
| /llvm-project-15.0.7/clang/include/clang/AST/ |
| H A D | StmtDataCollectors.td | 2 code Code = [{ 12 code Code = [{ 19 code Code = [{ 24 code Code = [{ 29 code Code = [{ 34 code Code = [{ 43 code Code = [{ 69 code Code = [{ 74 code Code = [{ 81 code Code = [{ [all …]
|
| /llvm-project-15.0.7/clang/unittests/AST/ |
| H A D | NamedDeclPrinterTest.cpp | 96 return PrintedNamedDeclMatches(Code, Args, in PrintedNamedDeclCXX98Matches() 106 return PrintedNamedDeclMatches(Code, Args, in PrintedWrittenNamedDeclCXX11Matches() 116 return PrintedNamedDeclMatches(Code, Args, in PrintedWrittenPropertyDeclObjCMatches() 199 const char *Code = in TEST() local 209 Code, in TEST() 215 const char *Code = in TEST() local 228 ASSERT_TRUE(PrintedNamedDeclMatches(Code, Args, in TEST() 236 const char *Code = in TEST() local 246 Code, in TEST() 252 const char *Code = in TEST() local [all …]
|
| H A D | TypePrinterTest.cpp | 48 std::string Code = R"cpp( in TEST() local 59 Code, {}, Matcher, "const Type<T> &", in TEST() 63 Code, {}, Matcher, "const N::Type<T> &", in TEST() 68 std::string Code = R"cpp( in TEST() local 76 ASSERT_TRUE(PrintedTypeMatches(Code, {}, Matcher, "<int>", in TEST() 84 llvm::StringLiteral Code = R"cpp( in TEST() local 92 ASSERT_TRUE(PrintedTypeMatches(Code, {}, in TEST() 95 ASSERT_TRUE(PrintedTypeMatches(Code, {}, in TEST() 101 constexpr char Code[] = R"cpp( in TEST() local 117 Code, {"-std=c++20"}, Matcher, in TEST() [all …]
|
| /llvm-project-15.0.7/clang/lib/Serialization/ |
| H A D | ASTWriterStmt.cpp | 36 serialization::StmtCode Code; member in clang::ASTStmtWriter 78 Code = serialization::STMT_NULL; in VisitNullStmt() 110 Code = serialization::STMT_CASE; in VisitCaseStmt() 125 Code = serialization::STMT_LABEL; in VisitLabelStmt() 163 Code = serialization::STMT_IF; in VisitIfStmt() 206 Code = serialization::STMT_WHILE; in VisitWhileStmt() 216 Code = serialization::STMT_DO; in VisitDoStmt() 229 Code = serialization::STMT_FOR; in VisitForStmt() 237 Code = serialization::STMT_GOTO; in VisitGotoStmt() 281 Code = serialization::STMT_DECL; in VisitDeclStmt() [all …]
|
| /llvm-project-15.0.7/clang/lib/ASTMatchers/Dynamic/ |
| H A D | Parser.cpp | 134 Code = Code.drop_front(); in getNextToken() 139 Code = Code.drop_front(); in getNextToken() 146 Code = Code.drop_front(); in getNextToken() 151 Code = Code.drop_front(); in getNextToken() 156 Code = Code.drop_front(); in getNextToken() 200 Code = Code.drop_front(TokenLength); in getNextToken() 204 Code = Code.drop_front(1); in getNextToken() 238 Code = Code.drop_front(Length); in consumeNumberLiteral() 286 Code = Code.drop_front(Length + 1); in consumeStringLiteral() 292 Code = Code.drop_front(Code.size()); in consumeStringLiteral() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/unittests/clang-tidy/ |
| H A D | OverlappingReplacementsTest.cpp | 138 const char Code[] = in TEST() local 157 const char Code[] = in TEST() local 180 const char Code[] = in TEST() local 205 const char Code[] = in TEST() local 231 const char Code[] = in TEST() local 267 EndsWithTatoCheck>(Code); in TEST() 273 const char Code[] = in TEST() local 330 const char Code[] = in TEST() local 360 const char Code[] = in TEST() local 389 const char Code[] = in TEST() local [all …]
|
| /llvm-project-15.0.7/clang/unittests/Analysis/FlowSensitive/ |
| H A D | SingleVarConstantPropagationTest.cpp | 191 Code, "fun", in RunDataflow() 206 std::string Code = R"( in TEST() local 218 std::string Code = R"( in TEST() local 235 std::string Code = R"( in TEST() local 249 std::string Code = R"( in TEST() local 261 std::string Code = R"( in TEST() local 273 std::string Code = R"( in TEST() local 287 std::string Code = R"cc( in TEST() local 310 std::string Code = R"cc( in TEST() local 327 std::string Code = R"cc( in TEST() local [all …]
|
| /llvm-project-15.0.7/clang/lib/Tooling/Refactoring/Extract/ |
| H A D | Extract.cpp | 70 CodeRangeASTSelection Code, in initiate() argument 75 if (!Code.isInFunctionLikeBodyOfCode()) in initiate() 79 if (Code.size() == 1) { in initiate() 81 if (isSimpleExpression(dyn_cast<Expr>(Code[0]))) in initiate() 93 return ExtractFunction(std::move(Code), DeclName); in initiate() 100 const Decl *ParentDecl = Code.getFunctionLikeNearestParent(); in createSourceReplacements() 104 SourceRange ExtractedRange(Code[0]->getBeginLoc(), in createSourceReplacements() 105 Code[Code.size() - 1]->getEndLoc()); in createSourceReplacements() 119 bool IsExpr = Code.size() == 1 && isa<Expr>(Code[0]); in createSourceReplacements() 122 ReturnType = cast<Expr>(Code[0])->getType(); in createSourceReplacements() [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/pseudo/lib/ |
| H A D | DirectiveTree.cpp | 21 : Code(Code), Tok(&Code.front()) {} in DirectiveParser() 70 Token::Range{Code.index(*Start), Code.index(*Tok)}}); in parse() 130 D->Tokens = {Code.index(*Tokens.begin()), Code.index(*Tokens.end())}; in parseDirective() 139 const TokenStream &Code; member in clang::pseudo::__anon141705870111::DirectiveParser 148 DirectiveParser(Code).parse(&Result); in parse() 160 static void dump(llvm::raw_ostream &OS, const DirectiveTree::Code &Code, in dump() argument 205 OSTREAM_DUMP(DirectiveTree::Code) 224 BranchChooser(const TokenStream &Code) : Code(Code) {} in BranchChooser() argument 249 Score walk(DirectiveTree::Code &C) { in walk() 341 const TokenStream &Code; member in clang::pseudo::__anon141705870411::BranchChooser [all …]
|
| /llvm-project-15.0.7/clang-tools-extra/clangd/ |
| H A D | Format.cpp | 25 SourceManagerForFile FileSM("mock_file.cpp", Code); in closeBrackets() 60 Code.append("\n// */\n"); in closeBrackets() 61 Code.append(Brackets.rbegin(), Brackets.rend()); in closeBrackets() 73 llvm::StringRef firstLine(llvm::StringRef Code) { in firstLine() argument 77 llvm::StringRef lastLine(llvm::StringRef Code) { in lastLine() argument 78 llvm::StringRef Rest = Code; in lastLine() 81 return Code.substr(Rest.size()); in lastLine() 91 assert(From.begin() >= Code.begin() && From.end() <= Code.end()); in replacement() 161 StringRef Trailing = firstLine(Code.substr(Cursor)); in getIncrementalChangesAfterNewline() 163 if (Indentation.data() == Code.data()) { in getIncrementalChangesAfterNewline() [all …]
|