summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Merging r155534:Bill Wendling2012-04-251-1/+1
| | | | | | | | | | | | | ------------------------------------------------------------------------ r155534 | lattner | 2012-04-24 23:09:30 -0700 (Tue, 24 Apr 2012) | 3 lines don't use soname on OpenBSD, it doesn't support it. Patch by Brad Smith! ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_31@155572 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a FixedCompilationDatabase to be able to specify tool parametersManuel Klimek2012-04-181-6/+10
| | | | | | | | at the command line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154989 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Make sure that when we have multiple @class references in the ↵Argyrios Kyrtzidis2012-04-161-1/+21
| | | | | | | | | | | | | | | same line, that later ones do not override the previous ones. If we have: @class Foo, Bar; source ranges for both start at '@', so 'Bar' will end up overriding 'Foo' even though the cursor location was at 'Foo'. rdar://11257578 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154873 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Spelling range for a objc category should the category name ↵Argyrios Kyrtzidis2012-04-161-0/+12
| | | | | | | | range, not the class one. rdar://11249386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154853 91177308-0d34-0410-b5e6-96231b3b80d8
* Like for LLVM / shlib, we also provide a SONAME to libclang.soSylvestre Ledru2012-04-151-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154779 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add .cxx and .txx as known file extensions to ccc-analyzer.Anna Zaks2012-04-141-0/+2
| | | | | | A patch by Sean McBride. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154751 91177308-0d34-0410-b5e6-96231b3b80d8
* c-index-test: dispose spelling string after use.Benjamin Kramer2012-04-141-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154738 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-5/+9
| | | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the last vestiges of clangIndexDouglas Gregor2012-04-136-6/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154675 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-122-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement clang_getDiagnosticCategoryText() to provide a way for a client of ↵Ted Kremenek2012-04-127-5/+41
| | | | | | | | | libclang to accurately get the diagnostic category name from a serialized diagnostic when the version of libclang used to read the diagnostic file is newer than the clang that emitted the diagnostic file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154567 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Apparently it's important to build in C89, sigh..Argyrios Kyrtzidis2012-04-111-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154525 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce a couple of functions to make it convenientArgyrios Kyrtzidis2012-04-114-3/+50
| | | | | | | | | | | to get at the parameters (and their types) of a function or objc method cursor. int clang_Cursor_getNumArguments(CXCursor C); CXCursor clang_Cursor_getArgument(CXCursor C, unsigned i); rdar://11201527 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154523 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] In cxloc::translateSourceRange make sure to handle locations in ↵Argyrios Kyrtzidis2012-04-111-3/+4
| | | | | | | | | | macro arguments correctly. clang diagnostics can provide fixits inside a macro argument now. rdar://11014346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154517 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Fix "error: conflicts with new declaration with ‘C’ linkage" ↵Argyrios Kyrtzidis2012-04-111-21/+21
| | | | | | | | that gcc emits but not clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154475 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] If displayDiagnostics is set (when calling clang_createIndex), ↵Argyrios Kyrtzidis2012-04-113-21/+39
| | | | | | | | | | | | | make sure to output the errors that occurred even if we did not get an AST (e.g. because the PCH failed to load). Also honor displayDiagnostics in clang_indexSourceFile(). rdar://11203489 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154472 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] For clang_getOverriddenCursors make sure to report overridden ↵Argyrios Kyrtzidis2012-04-102-16/+38
| | | | | | | | objc methods for methods in categories of super classes. rdar://11220358 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154436 91177308-0d34-0410-b5e6-96231b3b80d8
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-102-13/+17
| | | | | | | | | | | | | | | | | | | code-completion related strings specific to a translation unit (ASTContext and related data) CodeCompletionAllocator does such limited caching, by caching the name assigned to a DeclContext*, but that is not the appropriate place since that object has a lifetime that can extend beyond that of an ASTContext. Introduce CodeCompletionTUInfo which will be always tied to a translation unit to do this kind of caching and move the caching of CodeCompletionAllocator into this object, and propagate it to all the places where it will be needed. The plan is to extend the caching where appropriate, using CodeCompletionTUInfo, to avoid re-calculating code-completion strings. Part of rdar://10796159. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154408 91177308-0d34-0410-b5e6-96231b3b80d8
* [Cygwin] Work around to flush stdout in a thread, or stdout in threads won't ↵NAKAMURA Takumi2012-04-072-0/+6
| | | | | | be flushed at exit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154254 91177308-0d34-0410-b5e6-96231b3b80d8
* clangFrontend depends on clangEdit.Benjamin Kramer2012-04-041-1/+1
| | | | 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/+94
| | | | | | | | | | | | | | | | | 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
* Fix dead store warning.Ted Kremenek2012-04-041-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153988 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build by passing in the needed variable after r153860.Bill Wendling2012-04-021-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153861 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused but set variable.Benjamin Kramer2012-03-311-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153800 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Fix use-after-free bug when handling attributes indexing info.Argyrios Kyrtzidis2012-03-312-52/+58
| | | | | | | | | When indexing a property with a getter/setter with attributes, the allocated memory for AttrListInfo could get released before its destructor is run. Fixes rdar://11113442. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153792 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce clang_Cursor_getObjCSelectorIndex() function.Argyrios Kyrtzidis2012-03-303-0/+7
| | | | | | | | | | After getting a cursor with clang_getCursor for a particular source location, allows querying the cursor in order to find out if the location points to a selector identifier in an objc method or message expression, and which selector index it is. rdar://11158946 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153781 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce clang_Cursor_getSpellingNameRange().Argyrios Kyrtzidis2012-03-303-3/+73
| | | | | | | | | | | It retrieves a source range for a piece that forms the cursors spelling name. Most of the times there is only one range for the complete spelling but for objc methods and objc message expressions, there are multiple pieces for each selector identifier. Part of rdar://11113120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153775 91177308-0d34-0410-b5e6-96231b3b80d8
* Add info to ObjCPropertyRefExpr to indicate whether the dot syntax propertyArgyrios Kyrtzidis2012-03-301-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | reference is going to message the setter, the getter, or both. Having this info on the ObjCPropertyRefExpr node makes it easier for AST clients (like libclang) to reason about the meaning of the property reference. [AST/Sema] -Use 2 bits (with a PointerIntPair) in ObjCPropertyRefExpr to record the above info -Have ObjCPropertyOpBuilder set the info appropriately. [libclang] -When there is an implicit property reference (property syntax using methods) have clang_getCursorReferenced return a cursor for the method. If the property reference is going to result in messaging both the getter and the setter choose to return a cursor for the setter because it is less obvious from source inspection that the setter is getting called. The general idea has the seal of approval by John. rdar://11151621 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153709 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] A MemberRefExpr cursor for a property dot syntax should have asArgyrios Kyrtzidis2012-03-301-0/+2
| | | | | | | | its location the location of the property. Part of rdar://11113120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153708 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Have c-index-test output more information about a cursor with ↵Argyrios Kyrtzidis2012-03-301-0/+12
| | | | | | | | | | | | -cursor-at: -the location of the cursor -its extent -its spelling Part of radar://11113120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153707 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Fix CIndexer::isOptEnabled(); not sure what I was thinking there.Argyrios Kyrtzidis2012-03-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153594 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Rename setBackGroundPriority -> setThreadBackgroundPriority.Argyrios Kyrtzidis2012-03-284-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153566 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Fix gcc error.Argyrios Kyrtzidis2012-03-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153565 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce options to control the priority for the threadsArgyrios Kyrtzidis2012-03-286-6/+76
| | | | | | | | | | | | | | | | | | | | | | that libclang creates. -Introduce CXGlobalOptFlags enum for the new options that can be set on the CXIndex object. -CXGlobalOpt_ThreadBackgroundPriorityForIndexing affects: clang_indexSourceFile clang_indexTranslationUnit clang_parseTranslationUnit clang_saveTranslationUnit -CXGlobalOpt_ThreadBackgroundPriorityForEditing affects: clang_reparseTranslationUnit clang_codeCompleteAt clang_annotateTokens rdar://9075282 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153562 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Put the CIndexer class in the clang namespace instead of havingArgyrios Kyrtzidis2012-03-281-1/+2
| | | | | | it at global namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153561 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] For clang_saveTranslationUnit, if the AST to save has invalid nodesArgyrios Kyrtzidis2012-03-281-5/+52
| | | | | | | due to compiler errors, use a crash recovery thread to do the AST writing for protection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153560 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-273-2/+32
| | | | | | | | | | completion item. For example, if the code completion itself represents a declaration in a namespace (say, std::vector), then this API retrieves the cursor kind and name of the namespace (std). Implements <rdar://problem/11121951>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153545 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, whichArgyrios Kyrtzidis2012-03-271-0/+3
| | | | | | | | disables all compiler warnings. rdar://11059556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153539 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Make sure we don't crash when trying to index code thatArgyrios Kyrtzidis2012-03-232-4/+7
| | | | | | | | | | | managed to insert an @interface as top level decl contained by another @interface. A commit to also not allow this as valid code will be coming. rdar://11105114. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153354 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] For a ↵Argyrios Kyrtzidis2012-03-231-0/+4
| | | | | | | | | | CXCursor_ObjCInstanceMethodDecl/CXCursor_ObjCClassMethodDecl cursor, return from clang_getCursorLocation the start location of the method name. rdar://11105223 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153303 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include FixIts with a null replacement range. Fixes ↵Ted Kremenek2012-03-201-0/+2
| | | | | | <rdar://problem/11040133>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153122 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Have clang_getCursorExtent() return the range of the main file whenArgyrios Kyrtzidis2012-03-191-0/+8
| | | | | | | | the passed cursor is the translation unit cursor. Patch by Clint Caywood! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153062 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Make it C90 compliant.Argyrios Kyrtzidis2012-03-151-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152823 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] A couple of enhancements to c-index-test.Argyrios Kyrtzidis2012-03-151-14/+35
| | | | | | | | | -When printing location avoid printing the filename if it is same as the main file, not just if it has '.h' extension. -Make sure we allocate enough bytes for storing as string a huge line number. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152821 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Parse diagnostic args in the driver.Chad Rosier2012-03-131-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only diagnostics thrown by the cc1 process were actually honoring the diagnostic options given on the command line, like -Werror. Reuse the existing code in Frontend currently used for cc1, adjusting it to not interpret -Wl, linker flags as warnings. Also fix a faulty test exposed by this change. It wasn't actually testing anything, and was giving this warning: clang-3: warning: argument unused during compilation: '-verify' Which -Werror didn't turn into an error because it was output by the driver, not the cc1 process, and diagnostic options weren't parsed by the driver. And you couldn't see the warning when running the test suite. Fixes PR12181. Patch by Dylan Noblesmith <nobled@dreamwidth.org>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
* Update library dependencies to add clangEdit on c-index-test and c-arcmt-test.NAKAMURA Takumi2012-03-112-2/+2
| | | | | | | | | To link with -static -lclang, linker tries to seek not libclang.so, clang.dll nor libclang.dll.a, but libclang.a. USEDLIBS should have correct dependencies for -static. (In contrast, USEDLIBS=libclang.so might be enough w/o -static) FYI, cygwin build (in buildbot) is using -static, due to avoiding weirdness of extremely slower startup lag of clang.exe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152539 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-116-14/+14
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-102-5/+0
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152491 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().Daniel Dunbar2012-03-091-5/+5
| | | | | | | | | - getSourceRange().getBegin() is about as awesome a pattern as .copy().size(). I already killed the hot paths so this doesn't seem to impact performance on my tests-of-the-day, but it is a much more sensible (and shorter) pattern. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Enhance clang_getOverriddenCursors.Argyrios Kyrtzidis2012-03-081-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | Basically the current design is: -for an implementation method, show as overridden the interface method. This is not useful, and is inconsistent with the C++ side -for an interface method, show as overridden the protocols methods (this is desirable) and the methods from the categories; methods from categories are not useful since they are considered the same method (same USR). -If there is a protocol method or category method reported, it does not check the super class for overridden methods. This is really problematic since overridden methods from super class is what we want to give back. Change clang_getOverriddenCursors to show as overridden any method in the class's base class, its protocols, or its categories' protocols, that has the same selector and is of the same kind (class or instance). If no such method exists, the search continues to the class's superclass, its protocols, and its categories, and so on. A method from an Objective-C implementation is considered to override the same methods as its corresponding method in the interface. rdar://10967206 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152270 91177308-0d34-0410-b5e6-96231b3b80d8