summaryrefslogtreecommitdiffstats
path: root/unittests
Commit message (Collapse)AuthorAgeFilesLines
* Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek2012-04-181-0/+69
| | | | | | | | at the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the last vestiges of clangIndexDouglas Gregor2012-04-131-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154675 91177308-0d34-0410-b5e6-96231b3b80d8
* clangFrontend depends on clangEdit.Benjamin Kramer2012-04-041-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154010 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a tooling library.Manuel Klimek2012-04-045-1/+360
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154008 91177308-0d34-0410-b5e6-96231b3b80d8
* [preprocessor] Handle correctly inclusion directives that have macro ↵Argyrios Kyrtzidis2012-03-271-0/+115
| | | | | | | | | | | | | | | | | | expansions, e.g "#include MACRO(STUFF)". -As an inclusion position for the included file, use the file location of the file where it was included but *after* the macro expansions. We want the macro expansions to be considered as before-in-translation-unit for everything in the included file. -In the preprocessing record take into account that only inclusion directives can be encountered as "out-of-order" (by comparing the start of the range which for inclusions is the hash location) and use binary search if there is an extreme number of macro expansions in the include directive. Fixes rdar://11111779 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153527 91177308-0d34-0410-b5e6-96231b3b80d8
* get rid of an unsued variable warning.Fariborz Jahanian2012-03-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152146 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-062-3/+3
| | | | | | | | | | | the new Objective-C NSArray/NSDictionary/NSNumber literal syntax. This introduces a new library, libEdit, which provides a new way to support migration of code that improves on the original ARC migrator. We now believe that most of its functionality can be refactored into the existing libraries, and thus this new library may shortly disappear. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
* [preprocessor] Enhance PreprocessingRecord to keep track of locations of ↵Argyrios Kyrtzidis2012-03-051-0/+139
| | | | | | | | | conditional directives. Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns true if a given range intersects with a conditional directive block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152018 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-202-4/+4
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8
* drop more llvm:: prefixes on SmallString<>Dylan Noblesmith2012-02-131-1/+1
| | | | | | More cleanup after r149799. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150380 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Lexer::makeFileCharRange() to have it accept a CharSourceRangeArgyrios Kyrtzidis2012-02-031-11/+13
| | | | | | | instead of a SourceRange, and handle the case where the range is a char (not token) range. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149677 91177308-0d34-0410-b5e6-96231b3b80d8
* Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor2012-01-302-3/+3
| | | | | | | target-specific module requirements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149224 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve Lexer::getImmediateMacroName to take into account inner macrosArgyrios Kyrtzidis2012-01-231-2/+21
| | | | | | | | | of macro arguments. For "MAC1( MAC2(foo) )" and location of 'foo' token it would return "MAC1" instead of "MAC2". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148704 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance Lexer::makeFileCharRange to check for ranges inside a macro argumentArgyrios Kyrtzidis2012-01-201-2/+34
| | | | | | | expansion, in which case it returns a file range in the location where the argument was spelled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148551 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken unit testDouglas Gregor2012-01-201-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148547 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence set-but-unused warning.Benjamin Kramer2012-01-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148496 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce Lexer::getSourceText() that returns a string for the sourceArgyrios Kyrtzidis2012-01-191-0/+5
| | | | | | that the given source range encompasses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148481 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce Lexer::makeFileCharRange() that accepts a token source rangeArgyrios Kyrtzidis2012-01-191-3/+19
| | | | | | and returns a character range with file locations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148480 91177308-0d34-0410-b5e6-96231b3b80d8
* For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macroArgyrios Kyrtzidis2012-01-191-2/+5
| | | | | | | | | start/end location. It is commonly needed after calling the function; with this way we avoid recalculating it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148479 91177308-0d34-0410-b5e6-96231b3b80d8
* Add unit testing for Lexer.Argyrios Kyrtzidis2012-01-194-1/+121
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148478 91177308-0d34-0410-b5e6-96231b3b80d8
* clang/unittests/Basic/SourceManagerTest.cpp: Fixup corresponding to r147387.NAKAMURA Takumi2011-12-311-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147388 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.Argyrios Kyrtzidis2011-12-211-0/+72
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147057 91177308-0d34-0410-b5e6-96231b3b80d8
* For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg ↵Argyrios Kyrtzidis2011-12-213-2/+111
| | | | | | | | | | expanded token locations as coming before the closing ')' of a function macro expansion. Include a unit test for SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147056 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11 constexpr: Add note stacks containing backtraces if constant evaluationRichard Smith2011-12-164-104/+1
| | | | | | | | | | | fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit argument to driver and frontend, to control the maximum number of notes so produced (default 10). Fix APValue printing to be able to pretty-print all APValue types, and move the testing for this functionality from a unittest to a -verify test now that it's visible in clang's output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix unit testsDouglas Gregor2011-09-291-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140748 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-261-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140493 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140479 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Basic/FileManagerTest.cpp: Suppress warnings on gcc.NAKAMURA Takumi2011-09-231-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140364 91177308-0d34-0410-b5e6-96231b3b80d8
* Define DiagnosticBuilder<<APValue so it's easy to include APValues inJeffrey Yasskin2011-07-184-1/+100
| | | | | | diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135398 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Basic/FileManagerTest.cpp: Unbreak Win32, mingw and msvc.NAKAMURA Takumi2011-06-241-3/+3
| | | | | | | LLVM_ON_WIN32 is defined in llvm/Config/config.h. IMO, it might be enough with _WIN32 in most cases, LLVM_ON_xxx could be deprecated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133794 91177308-0d34-0410-b5e6-96231b3b80d8
* This random unit test also depends on ARCMigrate.John McCall2011-06-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133148 91177308-0d34-0410-b5e6-96231b3b80d8
* The ARC Migration Tool. All the credit goes to Argyrios and FariborzJohn McCall2011-06-151-1/+1
| | | | | | | | for this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133104 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverts the Tooling changes as requested by Chris.Manuel Klimek2011-06-024-2040/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132462 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix broken test on windows. To get operator new working, we need size_t, for ↵Manuel Klimek2011-06-011-4/+6
| | | | | | which we need to figure out a way to resolve standard include paths in the test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132386 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch implements an AST matching framework that allows to writeManuel Klimek2011-05-312-0/+1607
| | | | | | | | | | | tools that match on the C++ ASTs. The main interface is in ASTMatchers.h, an example implementation of a tool that removes redundant .c_str() calls is in the example RemoveCStrCalls.cpp. Various contributions: Zhanyong Wan, Chandler Carruth, Marcin Kowalczyk, Wei Xu, James Dennett. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132374 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle gcc-compatible compilers (such as clang) the same way we handleOscar Fuentes2011-05-111-1/+1
| | | | | | | | gcc. Fixes PR9886. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131182 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a test for the command line parser when a quoted string is not closed ↵Manuel Klimek2011-05-021-0/+14
| | | | | | by a quote. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130704 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the next step in building the standalone tools infrastructure:Manuel Klimek2011-04-273-0/+321
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130306 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a function to run FrontendActions over in-memory code. This isManuel Klimek2011-04-212-0/+96
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129924 91177308-0d34-0410-b5e6-96231b3b80d8
* Put targets on folders, if the IDE supports the feature.Oscar Fuentes2011-02-201-0/+2
| | | | | | Requires CMake 2.8.3 or newer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126094 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-instate r125819 and r125820 with no functionality changePeter Collingbourne2011-02-193-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126060 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 125820 and 125819 to fix PR9266.Rafael Espindola2011-02-193-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050 91177308-0d34-0410-b5e6-96231b3b80d8
* Use PARSE_ARGUMENTS to clean up add_clang_unittest's calling convention.Jeffrey Yasskin2011-02-191-10/+20
| | | | | | | | | It would be nice to propagate this into the other functions to replace LLVM_LINK_COMPONENTS and friends, but I don't plan to do that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126032 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support and mc from the clang unittests' dependencies because they're notJeffrey Yasskin2011-02-191-2/+2
| | | | | | | | | | | needed or provided by the libraries under test. The next step is to import http://www.itk.org/Wiki/CMakeMacroParseArguments to make the empty string parameter unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126024 91177308-0d34-0410-b5e6-96231b3b80d8
* Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne2011-02-184-6/+4
| | | | | | | | | This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125820 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a CMake target for the Basic lib's unit tests. Reviewed byZhanyong Wan2011-02-161-0/+6
| | | | | | | jyasskin and chapuni. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125657 91177308-0d34-0410-b5e6-96231b3b80d8
* Improves CMakeLists.txt for Clang's unit tests: make "linkedZhanyong Wan2011-02-161-11/+7
| | | | | | | | components" and "used libs" arguments of add_clang_unittest(). Reviewed by jyasskin and chapuni. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125652 91177308-0d34-0410-b5e6-96231b3b80d8
* Moves FileManagerTest.cpp to unittests/Basic such that the unit testZhanyong Wan2011-02-153-4/+4
| | | | | | | directory structure matches the library structure. Reviewed by jyasskin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125600 91177308-0d34-0410-b5e6-96231b3b80d8