summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] Rename setBackGroundPriority -> setThreadBackgroundPriority.Argyrios Kyrtzidis2012-03-284-9/+9
| | | | llvm-svn: 153566
* [libclang] Fix gcc error.Argyrios Kyrtzidis2012-03-281-2/+2
| | | | llvm-svn: 153565
* [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 llvm-svn: 153562
* [libclang] Put the CIndexer class in the clang namespace instead of havingArgyrios Kyrtzidis2012-03-281-1/+2
| | | | | | it at global namespace. llvm-svn: 153561
* [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. llvm-svn: 153560
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-272-1/+16
| | | | | | | | | 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>. llvm-svn: 153545
* [libclang] Introduce indexing option CXIndexOpt_SuppressWarnings, whichArgyrios Kyrtzidis2012-03-271-0/+3
| | | | | | | | disables all compiler warnings. rdar://11059556 llvm-svn: 153539
* [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. llvm-svn: 153354
* [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 llvm-svn: 153303
* [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! llvm-svn: 153062
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-115-13/+13
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* 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. llvm-svn: 152491
* [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. llvm-svn: 152419
* [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 llvm-svn: 152270
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+1
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* [PCH] Mark a PCH file with a flag to indicate if the serialized AST hadArgyrios Kyrtzidis2012-03-072-2/+6
| | | | | | | | | | | | | | | | compiler errors or not. -Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time. By default, such a PCH file will be rejected with an error when trying to load it. [libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors occurred. -Have libclang API calls accept a PCH that had compiler errors. The general idea is that we want libclang to stay functional even if a PCH had a compiler error. rdar://10976363. llvm-svn: 152192
* Add new code migrator support for migrating existing Objective-C code to useTed Kremenek2012-03-064-1/+45
| | | | | | | | | | | 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. llvm-svn: 152141
* And libclang cursor/indexing support for new Objective-C ↵Ted Kremenek2012-03-063-10/+36
| | | | | | NSArray/NSDictionary/NSNumber literals. llvm-svn: 152138
* Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.Argyrios Kyrtzidis2012-03-011-1/+1
| | | | | | Needs llvm update. llvm-svn: 151829
* Remove stray semi-colon.Daniel Dunbar2012-02-291-1/+1
| | | | llvm-svn: 151682
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-283-9/+18
| | | | | | | | | | make sure to record the source location of the ivar name. [libclang] When indexing @synthesized objc methods, report the @implementation as the lexical container. Fixes rdar://10905472 llvm-svn: 151635
* [libclang] When indexing an objc property, also provide information aboutArgyrios Kyrtzidis2012-02-284-2/+49
| | | | | | | | the getter/setter objc method entities that the property is associated with. rdar://10244558 llvm-svn: 151634
* [AST] Associate the getter/setter methods to a property of a objc class ↵Argyrios Kyrtzidis2012-02-281-11/+29
| | | | | | | | | | extension. [libclang] Index the getter/setter methods of a property of a objc class extension. Fixes rdar://10907597 llvm-svn: 151633
* Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"Argyrios Kyrtzidis2012-02-271-1/+1
| | | | | | | | to make it more widely available. Depends on llvm commit r151564 llvm-svn: 151566
* Don't record nested macro expansions in the preprocessing record,Argyrios Kyrtzidis2012-02-252-10/+2
| | | | | | | | it can only bring pain when dealing with preprocessor abuse (see: boost). rdar://10898986 llvm-svn: 151427
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-242-0/+7
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* [libclang] Index the field references of a designated initializer, ↵Argyrios Kyrtzidis2012-02-221-0/+11
| | | | | | rdar://10906206 llvm-svn: 151118
* Basic: import IntrusiveRefCntPtr<> into clang namespaceDylan Noblesmith2012-02-204-10/+10
| | | | | | | The class name is long enough without the llvm:: added. Also bring in RefCountedBase and RefCountedBaseVPTR. llvm-svn: 150958
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-161-3/+2
| | | | | | | | hold the used constructor itself."" This reintroduces commit r150682 with a fix for the Bullet benchmark crash. llvm-svn: 150685
* Revert "Make CXXNewExpr contain only a single initialier, and not hold the ↵Sebastian Redl2012-02-161-2/+3
| | | | | | | | | | used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. llvm-svn: 150684
* Make CXXNewExpr contain only a single initialier, and not hold the used ↵Sebastian Redl2012-02-161-3/+2
| | | | | | | | | | constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. llvm-svn: 150682
* [libclang] Do index statements inside a type source info. rdar://10872758Argyrios Kyrtzidis2012-02-161-0/+5
| | | | llvm-svn: 150647
* Fix typo in r150549.Richard Smith2012-02-151-3/+3
| | | | llvm-svn: 150555
* Implement indexing support for lambdas in libclang (both kinds), asDouglas Gregor2012-02-157-7/+122
| | | | | | | well as improving the RecursiveASTVisitor's walk of lambda expressions. llvm-svn: 150549
* [libclang] Indexing: only index implicit template instantiations via an ↵Argyrios Kyrtzidis2012-02-146-21/+44
| | | | | | opt-in indexing option. llvm-svn: 150517
* Fix use-after-free introduced by me being an idiot.Ted Kremenek2012-02-141-6/+4
| | | | llvm-svn: 150461
* Implement new DiagnosticsRenderer that packages notes retrieved by ↵Ted Kremenek2012-02-142-4/+112
| | | | | | | | | clang_getDiagnosticSetFromTU() as child diagnostics of primary diagnostics. By using the DiagnosticRenderer, these Diagnostics now match with those generated for serialized diagnostics. llvm-svn: 150456
* drop more llvm:: prefixes on SmallString<>Dylan Noblesmith2012-02-136-16/+16
| | | | | | More cleanup after r149799. llvm-svn: 150380
* drop more llvm:: prefixes on OwningPtr<>Dylan Noblesmith2012-02-135-16/+16
| | | | | | More cleanup after r149798. llvm-svn: 150379
* [libclang] For a reference of an implicit template instantiation just giveArgyrios Kyrtzidis2012-02-111-3/+0
| | | | | | | a reference for the instantiation decl. Also test that its location is correct after previous commit. llvm-svn: 150291
* [libclang] Indexing API: fully index using decls and directives.Argyrios Kyrtzidis2012-02-101-0/+23
| | | | llvm-svn: 150268
* [libclang] Indexing API: Fully index implict template instantiations.Argyrios Kyrtzidis2012-02-105-4/+54
| | | | llvm-svn: 150267
* [libclang] Encode the template specialization parameters of a functionArgyrios Kyrtzidis2012-02-101-0/+10
| | | | | | specialization in its USR string. llvm-svn: 150264
* [libclang] Indexing: When suppressing references, suppress referencesArgyrios Kyrtzidis2012-02-081-0/+13
| | | | | | of bases in C++ classes. rdar://10768707 llvm-svn: 150048
* [libclang] For CXXOperatorCallExprs, give a valid source location to the ↵Argyrios Kyrtzidis2012-02-081-0/+6
| | | | | | | | | | DeclRefExpr that is referencing the member function, so we can index the referenced function. Fixes rdar://10762375&10324915 & http://llvm.org/PR11192 llvm-svn: 150033
* [libclang] Do not index implicit C++ member functions. rdar://10769813Argyrios Kyrtzidis2012-02-073-2/+5
| | | | llvm-svn: 150007
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-2/+0
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
* Print NamedDecls directly to a raw_ostream where possible.Benjamin Kramer2012-02-071-3/+3
| | | | llvm-svn: 149982
* Introduce basic ASTs for lambda expressions. This covers:Douglas Gregor2012-02-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Capturing variables by-reference and by-copy within a lambda - The representation of lambda captures - The creation of the non-static data members in the lambda class that store the captured variables - The initialization of the non-static data members from the captured variables - Pretty-printing lambda expressions There are a number of FIXMEs, both explicit and implied, including: - Creating a field for a capture of 'this' - Improved diagnostics for initialization failures when capturing variables by copy - Dealing with temporaries created during said initialization - Template instantiation - AST (de-)serialization - Binding and returning the lambda expression; turning it into a proper temporary - Lots and lots of semantic constraints - Parameter pack captures llvm-svn: 149977
* Added location for template keyword in TemplateSpecializationTypeLoc. In the ↵Abramo Bagnara2012-02-061-1/+1
| | | | | | process removed some naming ambiguities. llvm-svn: 149870
OpenPOWER on IntegriCloud