summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/include-fixer
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* [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-202-0/+109
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
OpenPOWER on IntegriCloud