summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/ToolingTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Disable a tooling test on Windows.Peter Collingbourne2013-11-061-0/+2
| | | | llvm-svn: 194178
* Introduce ClangTool::buildASTs, and buildASTFromCode.Peter Collingbourne2013-11-061-4/+50
| | | | | | | | | | | | | | | | | | | | | These allow clients to retrieve persistent AST objects (ASTUnits) which can be used in an ad-hoc manner after parsing. To accommodate this change, the code for processing a CompilerInvocation using a FrontendAction has been factored out to FrontendActionFactory, and a new base class, ToolAction, has been introduced, allowing the tool to do arbitrary things with each CompilerInvocation. This change was necessary because ASTUnit does not use the FrontendAction interface directly. This change also causes the FileManager in ClangTool to use shared ownership. This will become necessary because ASTUnit takes shared ownership of FileManager (ClangTool's FileManager is currently unused by ASTUnit; this is a FIXME). As shown in the tests, any client of ToolInvocation will need to be modified to use shared ownership for FileManager. Differential Revision: http://llvm-reviews.chandlerc.com/D2097 llvm-svn: 194164
* Use the same SourceManager for ModuleMaps and compilations.Manuel Klimek2013-10-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows using virtual file mappings on the original SourceManager to map in virtual module.map files. Without this patch, the ModuleMap search will find a module.map file (as the FileEntry exists in the FileManager), but will be unable to get the content from the SourceManager (as ModuleMap previously created its own SourceManager). Two problems needed to be fixed which this patch exposed: 1. Storing the inferred module map When writing out a module, the ASTWriter stores the names of the files in the main source manager; when loading the AST again, the ASTReader errs out if such a file is found missing, unless it is overridden. Previously CompilerInstance's compileModule method would store the inferred module map to a temporary file; the problem with this approach is that now that the module map is handled by the main source manager, the ASTWriter stores the name of the temporary module map as source to the compilation; later, when the module is loaded, the temporary file has already been deleted, which leads to a compilation error. This patch changes the inferred module map to instead inject a virtual file into the source manager. This both saves some disk IO, and works with how the ASTWriter/ASTReader handle overridden source files. 2. Changing test input in test/Modules/Inputs/* Now that the module map file is handled by the main source manager, the VerifyDiagnosticConsumer will not ignore diagnostics created while parsing the module map file. The module test test/Modules/renamed.m uses -I test/Modules/Inputs and triggers recursive loading of all module maps in test/Modules/Inputs, some of which had conflicting names, thus leading errors while parsing the module maps. Those diagnostics already occur on trunk, but before this patch they would not break the test, as they were ignored by the VerifyDiagnosticConsumer. This patch thus changes the module maps that have been recently introduced which broke the invariant of compatible modules maps in test/Modules/Inputs. llvm-svn: 193314
* Enables chaining of argument adjusters in clang tools.Manuel Klimek2013-06-041-0/+41
| | | | | | | | This enables changing clang-check to get extra arguments. Patch by Pavel Labath. llvm-svn: 183227
* Coding style fix for SourceFileCallbacksEdwin Vane2013-05-301-3/+3
| | | | llvm-svn: 182930
* Tooling: Call back for both begin and end of sourcesEdwin Vane2013-05-291-7/+14
| | | | | | | | | | | | newFrontendActionFactory() took a pointer to a callback to call when a source file was done being processed by an action. This revision updates the callback to include an ante-processing callback as well. Callback-providing class renamed and callback functions themselves renamed. Functions are no longer pure-virtual so users aren't forced to implement both callbacks if one isn't needed. llvm-svn: 182864
* Fix a typo in the name of a tooling unit testHal Finkel2013-01-281-1/+1
| | | | llvm-svn: 173658
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-6/+6
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Allow an ASTConsumer to selectively skip function bodies while parsing. PatchRichard Smith2012-11-271-0/+24
| | | | | | by Olivier Goffart! llvm-svn: 168726
* unittests/ToolingTest.cpp: Suppress ↵NAKAMURA Takumi2012-10-251-0/+2
| | | | | | newFrontendActionFactory.InjectsEndOfSourceFileCallback on Win32 for now. Investigating. llvm-svn: 166674
* Adds the possibility to inject a callback that's called after each ↵Manuel Klimek2012-10-251-0/+30
| | | | | | | | translation unit is processed. This is important when one wants to deduplicate results during one run over a translation unit by pointer identity of AST nodes. llvm-svn: 166671
* Adapts the FrontendAction convenience functions so that it can beManuel Klimek2012-07-051-1/+3
| | | | | | | | used with classes that generate ASTConsumers; this allows decoupling the ASTConsumer generation from the Frontend library (like, for example, the MatchFinder in the upcoming ASTMatcher patch). llvm-svn: 159760
* ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode ↵NAKAMURA Takumi2012-06-161-0/+5
| | | | | | on msvc. LangOpts.MicrosoftExt still appends "class type_info;". llvm-svn: 158595
* Explicitly build __builtin_va_list.Meador Inge2012-06-161-2/+2
| | | | | | | The target specific __builtin_va_list types are now explicitly built instead of injecting strings into the preprocessor input. llvm-svn: 158592
* Revert r157819, "#ifdef out a broken test on win32"NAKAMURA Takumi2012-06-021-5/+0
| | | | | | FYI, LLVM_ON_WIN32 is useless. llvm-svn: 157890
* #ifdef out a broken test on win32Alexander Kornienko2012-06-011-0/+5
| | | | llvm-svn: 157819
* Added a test for ToolInvocation::mapVirtualFile method.Alexander Kornienko2012-06-011-0/+14
| | | | llvm-svn: 157812
* Adds a tooling library.Manuel Klimek2012-04-041-0/+113
| | | | | | | | | | | | | | | Provides an API to run clang tools (FrontendActions) as standalone tools, or repeatedly in-memory in a process. This is useful for unit-testing, map-reduce style applications, source transformation daemons or command line tools. The ability to run over multiple translation units with different command line arguments enables building up refactoring tools that need to apply transformations across translation unit boundaries. See tools/clang-check/ClangCheck.cpp for an example. llvm-svn: 154008
* Reverts the Tooling changes as requested by Chris.Manuel Klimek2011-06-021-175/+0
| | | | llvm-svn: 132462
* This is the next step in building the standalone tools infrastructure:Manuel Klimek2011-04-271-0/+84
| | | | | | | | | | | | | | | This patch simplifies writing of standalone Clang tools. As an example, we add clang-check, a tool that runs a syntax only frontend action over a .cc file. When you integrate this into your favorite editor, you get much faster feedback on your compilation errors, thus reducing your feedback cycle especially when writing new code. The tool depends on integration of an outstanding patch to CMake to work which allows you to always have a current compile command database in your cmake output directory when you set CMAKE_EXPORT_COMPILE_COMMANDS. llvm-svn: 130306
* Adds a function to run FrontendActions over in-memory code. This isManuel Klimek2011-04-211-0/+91
the first step towards a standalone Clang tool infrastructure. The plan is to make it easy to build command line tools that run over the AST of source files in a project outside of the build system. llvm-svn: 129924
OpenPOWER on IntegriCloud