aboutsummaryrefslogtreecommitdiff
path: root/unittests
AgeCommit message (Collapse)Author
2012-06-16ToolingTest.cpp: Fix r158592, runToolOnCode.FindsNoTopLevelDeclOnEmptyCode ↵NAKAMURA Takumi
on msvc. LangOpts.MicrosoftExt still appends "class type_info;". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158595 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-16Explicitly build __builtin_va_list.Meador Inge
The target specific __builtin_va_list types are now explicitly built instead of injecting strings into the preprocessor input. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158592 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-13Rename shouldVisitImplicitDeclarations to shouldVisitImplicitCode.Daniel Jasper
Fix RecursiveASTVisitor to visit CXXForRangeStmts accordingly to visit implicit or explicit code. The key bug that inspired this was the Visitor not visiting the range initializer of such a loop, which is explicit code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158395 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07Move sideeffecting call out of assert().Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06Switches the RewriterTestContext away from PathV1.Manuel Klimek
Now the ToolingTests all work on Windows, and they also clean up their temporary directory if they don't crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158112 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05Fixes the refactoring library test in VS2010.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158019 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05RecursiveASTVisitor: add ability to visit implicit declarations. Patch byRichard Smith
James Dennett! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-02Revert r157819, "#ifdef out a broken test on win32"NAKAMURA Takumi
FYI, LLVM_ON_WIN32 is useless. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01#ifdef out a broken test on win32Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157819 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-01Added a test for ToolInvocation::mapVirtualFile method.Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157812 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30Only visit default arguments for template declarations when visiting the ↵Richard Smith
template declaration which introduced them. Patch by Yang Chen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157723 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-30Test commit - Fix typo in comment.Daniel Jasper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157674 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-27clang/unittests/Tooling/RewriterTestContext.h: Don't try to remove ↵NAKAMURA Takumi
TemporaryDirectory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157530 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-23Adds the Refactoring library, which is a layer on top of the Tooling libraryManuel Klimek
that allows easy refactoring across translation units. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157331 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22Fixes the autoconf build.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157266 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-22Adds a method overwriteChangedFiles to the Rewriter. This is implemented byManuel Klimek
first writing the changed files to a temporary location and then overwriting the original files atomically. Also adds a RewriterTestContext to aid unit testing rewrting logic in general. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157260 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15Fixes crasher bug in JSONCompilationDatabase for invalid input.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-09RecursiveASTVisitor:Richard Smith
We don't create any declaration to mark the explicit instantiation of function templates other than the instantiation itself, so visit that when traversing the function template decl. This is a temporary fix, pending the creation of a Decl node to represent the explicit instantiation. Patch by Daniel Jasper! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156522 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02Unrevert r155951, reverted in r155962, with two changes:Richard Smith
* Work around build failures due to gcc 4.2 bugs. * Remove BodyIndexer::TraverseCXXOperatorCallExpr, which was not being called prior to this change, and whose presence disables a RecursiveASTVisitor stack space optimization after this change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01Revert "Fix RecursiveASTVisitor's data recursion to call the Traverse* ↵Andrew Trick
functions if they" FAIL: Clang :: Index/index-many-call-ops.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-01Fix RecursiveASTVisitor's data recursion to call the Traverse* functions if theyRichard Smith
have been overridden in the derived class. Also, remove a non-functional implementation of an incorrect optimization for ParenExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-26Fix file name in comment.David Blaikie
Patch by Yang Chen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-25RecursiveASTVisitor: When in 'shouldVisitTemplateInstantiations' mode, visitRichard Smith
all instantiations of a template when we visit the canonical declaration of the primary template, rather than trying to match them up to the partial specialization from which they are instantiated. This fixes a bug where we failed to visit instantiations of partial specializations of member templates of class templates, and naturally extends to allow us to visit instantiations where we have instantiated only a declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155597 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-24RecursiveASTVisitor: Visit instantiations of member templates of classRichard Smith
templates. In an implicit instantiation of a member class, any member templates don't get instantiated, so the existing check which only visited the instantiations of a defined template skipped these templates' instantiations. Since there is only a single declaration of a member template of a class template specialization, just use that to determine whether to visit the instantiations. This introduces a slight inconsistency in that we will visit the instantiations of such templates whether or not they are defined, but we never visit a declared-but-not-defined instantiation, so this turns out to not matter. Patch by Daniel Jasper! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155487 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-23Fix PR12608. Patch contributed by Yang Chen.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155355 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20No need to put the SourceManager in with the ASTContext, as the ASTContextManuel Klimek
already contains the SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155198 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19Adds a unit test for the RecursiveASTVisitor.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-18Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek
at the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-13Kill the last vestiges of clangIndexDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154675 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04clangFrontend depends on clangEdit.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-04Adds a tooling library.Manuel Klimek
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
2012-03-27[preprocessor] Handle correctly inclusion directives that have macro ↵Argyrios Kyrtzidis
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
2012-03-06get rid of an unsued variable warning.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152146 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-06Add new code migrator support for migrating existing Objective-C code to useTed Kremenek
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
2012-03-05[preprocessor] Enhance PreprocessingRecord to keep track of locations of ↵Argyrios Kyrtzidis
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
2012-02-20Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith
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
2012-02-13drop more llvm:: prefixes on SmallString<>Dylan Noblesmith
More cleanup after r149799. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150380 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer
include. Fix all the transitive include users. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03Change Lexer::makeFileCharRange() to have it accept a CharSourceRangeArgyrios Kyrtzidis
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
2012-01-30Thread a TargetInfo through to the module map; we'll need it forDouglas Gregor
target-specific module requirements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149224 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-23Improve Lexer::getImmediateMacroName to take into account inner macrosArgyrios Kyrtzidis
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
2012-01-20Enhance Lexer::makeFileCharRange to check for ranges inside a macro argumentArgyrios Kyrtzidis
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
2012-01-20Fix broken unit testDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19Silence set-but-unused warning.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148496 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19Introduce Lexer::getSourceText() that returns a string for the sourceArgyrios Kyrtzidis
that the given source range encompasses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148481 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19Introduce Lexer::makeFileCharRange() that accepts a token source rangeArgyrios Kyrtzidis
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
2012-01-19For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macroArgyrios Kyrtzidis
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
2012-01-19Add unit testing for Lexer.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148478 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-31clang/unittests/Basic/SourceManagerTest.cpp: Fixup corresponding to r147387.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147388 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147057 91177308-0d34-0410-b5e6-96231b3b80d8