summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* IncludeFixerTests: Update libdeps.NAKAMURA Takumi2016-05-311-0/+1
| | | | llvm-svn: 271295
* [include-fixer] use clang-format cleaner to insert header.Eric Liu2016-05-311-20/+23
| | | | | | | | | | | | Summary: clang-format's cleanupAroundReplacements() takes care of header insertions. Reviewers: bkramer Subscribers: cfe-commits, hokein Differential Revision: http://reviews.llvm.org/D20816 llvm-svn: 271287
* [include-fixer] use tooling::Replacements since the order of replacements ↵Eric Liu2016-05-311-6/+6
| | | | | | | | | | don't matter anymore. Summary: [include-fixer] use tooling::Replacements since the order of replacements don't matter anymore. Differential Revision: http://reviews.llvm.org/D20813 llvm-svn: 271279
* [include-fixer] Create a mode in vim integration to show multiple potential ↵Haojian Wu2016-05-311-4/+9
| | | | | | | | | | | | | | | | | | | headers. Summary: Some changes in the patch: * Add two commandline flags in clang-include-fixer. * Introduce a IncludeFixerContext for the queried symbol. * Pull out CreateReplacementsForHeader. Reviewers: bkramer Subscribers: klimek, cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20621 llvm-svn: 271258
* [find-all-symbols] Added hardcode header mapping from header postfix to ↵Eric Liu2016-05-241-43/+18
| | | | | | | | | | | | | | header name for STL symbols. Summary: [find-all-symbols] Added hardcode header mapping from header postfix to header name for STL symbols. Reviewers: klimek, bkramer Subscribers: cfe-commits, hokein Differential Revision: http://reviews.llvm.org/D20566 llvm-svn: 270566
* [find-all-symbols] Some cleanups in unittest.Haojian Wu2016-05-201-6/+0
| | | | llvm-svn: 270211
* [find-all-symbol] Ignore inline namespace context.Haojian Wu2016-05-201-1/+6
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20465 llvm-svn: 270206
* [find-all-symbol] Try to fix the failure windows unittest.Haojian Wu2016-05-201-1/+7
| | | | llvm-svn: 270199
* [find-all-symbols] make HeaderMapCollector optional in FindAllSymbols and ↵Eric Liu2016-05-201-1/+1
| | | | | | FindAllMacros. llvm-svn: 270193
* [find-all-symbol] Add macro support.Haojian Wu2016-05-201-11/+52
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20420 llvm-svn: 270189
* [include-fixer] Make search handle fully qualified names correctly.Benjamin Kramer2016-05-191-0/+6
| | | | | | | | | If a search string starts with "::" we don't want to return any results for suffixes of that string. Differential Revision: http://reviews.llvm.org/D20424 llvm-svn: 270055
* [include-fixer] Remove obsolete windows hack.Benjamin Kramer2016-05-191-4/+2
| | | | llvm-svn: 270045
* [include-fixer] Sort headers after inserting new headers.Eric Liu2016-05-191-23/+41
| | | | | | | | | | | | Summary: [include-fixer] Sort headers after inserting new headers. Reviewers: bkramer Subscribers: klimek, djasper, hokein, cfe-commits Differential Revision: http://reviews.llvm.org/D20370 llvm-svn: 270031
* [include-fixer] Also look up prefixes of queries.Benjamin Kramer2016-05-181-3/+0
| | | | | | | | | | | | This is used to find nested classes. For a nested name foo::bar::qux we will first look up foo::bar::qux, then foo::bar, then foo unless we find a result. This is used to support nested classes which are not part of the index but can only be used if the header for the parent context is included. Differential Revision: http://reviews.llvm.org/D20372 llvm-svn: 269956
* [include-fixer] Run tests with -fno-ms-compatibility.Benjamin Kramer2016-05-181-4/+3
| | | | | | | Something behind that flag makes us get fewer typo correction callbacks, unbreak the tests on windows for now. llvm-svn: 269894
* [include-fixer] Ignore non-scoped enum declaration during search.Haojian Wu2016-05-181-0/+10
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20354 llvm-svn: 269890
* FindAllSymbolsTests doesn't require clangToolingCore.NAKAMURA Takumi2016-05-181-1/+0
| | | | llvm-svn: 269874
* include-fixer: They require clangLex.NAKAMURA Takumi2016-05-181-0/+1
| | | | llvm-svn: 269873
* IncludeFixerTest.cpp: Add explicit triple for some tests. They are failing ↵NAKAMURA Takumi2016-05-181-2/+4
| | | | | | for targeting *-win32. llvm-svn: 269870
* [find-all-symbols] Add IWYU private pragma support.Haojian Wu2016-05-171-6/+55
| | | | | | | | | | Reviewers: djasper, klimek Subscribers: kimgr, cfe-commits, bkramer, ioeric Differential Revision: http://reviews.llvm.org/D19816 llvm-svn: 269779
* [find-all-symbols] Ignore anonymous enum declarations.Haojian Wu2016-05-171-0/+2
| | | | llvm-svn: 269762
* [include-fixer] Make the "extend to the right" hack support typos without ↵Benjamin Kramer2016-05-171-1/+11
| | | | | | | | nested names in the front. This handles cases where the initial namespace is unknown. llvm-svn: 269758
* [include-fixer] Fix broken dependency shared buildEtienne Bergeron2016-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The shared build is broken (again). To repro: [Release + Shared] ``` -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ``` Errors: ``` tools/clang/tools/extra/include-fixer/tool/CMakeFiles/clang-include-fixer.dir/ClangIncludeFixer.cpp.o: In function `(anonymous namespace)::includeFixerMain(int, char const**)': ClangIncludeFixer.cpp:(.text._ZN12_GLOBAL__N_116includeFixerMainEiPPKc+0xbe9): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' collect2: error: ld returned 1 exit status ``` ``` tools/clang/tools/extra/unittests/include-fixer/CMakeFiles/IncludeFixerTests.dir/IncludeFixerTest.cpp.o: In function `clang::include_fixer::(anonymous namespace)::runIncludeFixer(llvm::StringRef, std::vector<std::string, std::allocator<std::string> > const&)': IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x10e): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x1dc): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x2f3): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x40e): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' IncludeFixerTest.cpp:(.text._ZN5clang13include_fixer12_GLOBAL__N_1L15runIncludeFixerEN4llvm9StringRefERKSt6vectorISsSaISsEE+0x526): undefined reference to `clang::find_all_symbols::SymbolInfo::SymbolInfo(llvm::StringRef, clang::find_all_symbols::SymbolInfo::SymbolKind, llvm::StringRef, int, std::vector<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string>, std::allocator<std::pair<clang::find_all_symbols::SymbolInfo::ContextType, std::string> > > const&)' ``` Reviewers: bkramer, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20245 llvm-svn: 269441
* [include-fixer] Use scope contexts information to improve query.Haojian Wu2016-05-131-0/+17
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20205 llvm-svn: 269430
* [include-fixer] Simplify unittest code.Haojian Wu2016-05-132-88/+82
| | | | | | | | | | | | | | | Summary: The InMemorySymbolIndex only constructs hard-coded Class symbols from a string map. The patch provide a flexable way in InMemorySymbolIndex to create a custom SymbolInfo in the include-fixer unittest. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20232 llvm-svn: 269427
* [include-fixer] Rename XrefsDB to SymbolIndex.Benjamin Kramer2016-05-131-8/+10
| | | | | | It's not really containing xrefs so the name didn't fit. No functional change. llvm-svn: 269403
* [find-all-symbols] Add enum type support.Haojian Wu2016-05-131-41/+107
| | | | | | | | | | | | | | Summary: Also change enums defined in SymbolInfo to scoped enums to avoid conflicts. Reviewers: bkramer Subscribers: cfe-commits, ioeric Differential Revision: http://reviews.llvm.org/D20203 llvm-svn: 269401
* [find-all-symbols] Slim SymbolInfo.Haojian Wu2016-05-111-174/+76
| | | | | | | | | | | | | | | | | | | | Summary: SymbolInfo has some optional fields, which is a bad-smell implementation. For now, we * remove the optional field since we don't need them (we can probably add them back if we actually need them in the future) * make SymbolInfo to be a class. By this change, the code is more simplified. Reviewers: klimek Subscribers: cfe-commits, ioeric, bkramer Differential Revision: http://reviews.llvm.org/D20095 llvm-svn: 269162
* Disable IncludeFixerTests/IncludeFixer.NestedName for now. It doesn't pass ↵NAKAMURA Takumi2016-05-101-0/+3
| | | | | | for targeting win32. Investigating. llvm-svn: 269135
* [include-fixer] Work around partial names in both directions.Benjamin Kramer2016-05-101-0/+6
| | | | | | | | | | | | We already handled the case where we had a nested name specifier where parts from the beginning don't get a callback, also handle the case where the end doesn't get a callback. This happens with function calls in unknown namespaces. The way we do this for now based on character data is a bit of a hack, we may need to refine this later or fix clang to produce different callbacks. llvm-svn: 269029
* [include-fixer] For now, only add the first suggested include.Benjamin Kramer2016-05-101-0/+6
| | | | | | | | We used a std::set which made the picked include somewhat random (well, lexicographically sorted). Make the behavior more consistent by always picking the first one we found. llvm-svn: 269028
* Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.Eric Liu2016-05-041-5/+10
| | | | | | | | | | | | Summary: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo. Reviewers: hokein, djasper, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19869 llvm-svn: 268480
* [clang-tidy] Cleanup namespace in utils folder.Etienne Bergeron2016-05-031-4/+5
| | | | | | | | | | | | | | Summary: This is a step forward cleaning up the namespaces in clang-tidy/utils. There is no behavior change. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19819 llvm-svn: 268356
* [include-fixer] Fix Clang-tidy modernize-use-override and some Include What ↵Eugene Zelenko2016-05-021-2/+13
| | | | | | | | You Use warnings. Differential revision: http://reviews.llvm.org/D19755 llvm-svn: 268262
* [include-fixer] Add an option to minimize include paths.Benjamin Kramer2016-04-281-11/+38
| | | | | | | This will always pick the shortest possible path based on -I options. Based on the #include suggestion code for modules. llvm-svn: 267868
* FindAllSymbolsTest.CTypedefTest: Tweak for LLP64 like x86_64-win32.NAKAMURA Takumi2016-04-281-2/+2
| | | | | | | | | | In file included from symbol.cc:1: symbols.h:2:24: error: typedef redefinition with different types ('unsigned int' vs 'unsigned long long') typedef unsigned size_t; ^ llvm-svn: 267841
* Fix a bunch of sign-compare warningsDavid Blaikie2016-04-271-4/+4
| | | | llvm-svn: 267754
* [find-all-symbols] Also update unittest dependencies.Benjamin Kramer2016-04-271-0/+2
| | | | llvm-svn: 267739
* [include-fixer] Add a find-all-symbols tool for include-fixer.Haojian Wu2016-04-273-0/+387
| | | | | | | | | | | | | | | | Summary: The find-all-symbols tool generates a yaml symbol database for include-fixer. The symbol matcher is originally written by Xiaoyi Liu. Reviewers: bkramer, djasper Subscribers: cfe-commits, klimek, ioeric Differential Revision: http://reviews.llvm.org/D19482 llvm-svn: 267719
* IncludeFixerTest.cpp: Tweak not to assume clang-tools-extra were onto ↵NAKAMURA Takumi2016-04-202-1/+4
| | | | | | clang/tools/extra. llvm-svn: 266874
* [include-fixer] Add a prototype for a new include fixing tool.Benjamin Kramer2016-04-203-0/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The goal of this tool is fairly simple, look up unknown identifiers in a global database and add the corresponding #include line. It accomplishes this by hooking into Sema as an ExternalSemaSource and responding to typo correction callbacks. This means we can see the unknown identifier before it's being munged by error recovery. This doesn't work perfectly yet as some typo corrections don't emit callbacks (delayed typos), but I think this is fixable. We also handle only one include at a time as this is meant to be run directly from the editing environment eventually. Adding multiple includes at the same time is tricky because of error recovery. This version only has a a dummy database, so all you can do is fixing missing includes of <string>, but the indexer to build a database will follow soon. Reviewers: djasper Subscribers: ioeric, hokein, cfe-commits Differential Revision: http://reviews.llvm.org/D19314 llvm-svn: 266870
* Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko2016-03-171-4/+3
| | | | | | Differential revision: http://reviews.llvm.org/D18231 llvm-svn: 263726
* Fix Clang-tidy modernize-use-override warning in ↵Eugene Zelenko2016-01-261-2/+1
| | | | | | | | unittests/clang-tidy/IncludeInserterTest.cpp; other minor fixes. Differential revision: http://reviews.llvm.org/D16566 llvm-svn: 258870
* Remove autoconf supportChris Bieneman2016-01-265-119/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Remove clang-modernize.Alexander Kornienko2015-12-1710-1103/+1
| | | | | | | | | | | | | | Summary: clang-modernize transforms have moved to clang-tidy. Removing the old tool now. Reviewers: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15606 llvm-svn: 255886
* Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie2015-10-201-1/+1
| | | | | | | | | Breaks the build in GCC 4.7.2 (see http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example) This reverts commit r250824. llvm-svn: 250862
* Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13889 llvm-svn: 250824
* Fix overlapping replacements in clang-tidy.Angel Garcia Gomez2015-10-161-43/+73
| | | | | | | | | | | | Summary: Prevent clang-tidy from applying fixes to errors that overlap with other errors' fixes, with one exception: if one fix is completely contained inside another one, then we can apply the big one. Reviewers: bkramer, klimek Subscribers: djasper, cfe-commits, alexfh Differential Revision: http://reviews.llvm.org/D13516 llvm-svn: 250509
* [VFS] Switch clang-tidy tests to use an in-memory fs.Benjamin Kramer2015-10-071-4/+8
| | | | | | | Again, this is both cleaner and completely removes any depedency on the host file system. llvm-svn: 249526
* Create interfaces and tests for the overlapping replacements fix in clang-tidy.Angel Garcia Gomez2015-10-064-9/+413
| | | | | | | | | | | | Summary: No changes in clang-tidy yet. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13469 llvm-svn: 249402
OpenPOWER on IntegriCloud