summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-192-4/+4
| | | | llvm-svn: 155082
* [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 llvm-svn: 154873
* [libclang] Spelling range for a objc category should the category name ↵Argyrios Kyrtzidis2012-04-161-0/+12
| | | | | | | | range, not the class one. rdar://11249386 llvm-svn: 154853
* Like for LLVM / shlib, we also provide a SONAME to libclang.soSylvestre Ledru2012-04-151-0/+5
| | | | llvm-svn: 154779
* 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! llvm-svn: 154723
* Kill the last vestiges of clangIndexDouglas Gregor2012-04-131-1/+0
| | | | llvm-svn: 154675
* Added a flag to the parser to skip method bodies.Erik Verbruggen2012-04-121-1/+3
| | | | llvm-svn: 154584
* Implement clang_getDiagnosticCategoryText() to provide a way for a client of ↵Ted Kremenek2012-04-126-3/+33
| | | | | | | | | 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. llvm-svn: 154567
* [libclang] Introduce a couple of functions to make it convenientArgyrios Kyrtzidis2012-04-113-3/+34
| | | | | | | | | | | 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 llvm-svn: 154523
* [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 llvm-svn: 154517
* [libclang] Fix "error: conflicts with new declaration with ‘C’ linkage" ↵Argyrios Kyrtzidis2012-04-111-21/+21
| | | | | | | | that gcc emits but not clang. llvm-svn: 154475
* [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 llvm-svn: 154472
* [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 llvm-svn: 154436
* [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. llvm-svn: 154408
* Fix dead store warning.Ted Kremenek2012-04-041-1/+2
| | | | llvm-svn: 153988
* [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. llvm-svn: 153792
* [libclang] Introduce clang_Cursor_getObjCSelectorIndex() function.Argyrios Kyrtzidis2012-03-302-0/+5
| | | | | | | | | | 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 llvm-svn: 153781
* [libclang] Introduce clang_Cursor_getSpellingNameRange().Argyrios Kyrtzidis2012-03-302-0/+58
| | | | | | | | | | | 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 llvm-svn: 153775
* 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 llvm-svn: 153709
* [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 llvm-svn: 153708
* [libclang] Fix CIndexer::isOptEnabled(); not sure what I was thinking there.Argyrios Kyrtzidis2012-03-281-1/+1
| | | | llvm-svn: 153594
* [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
OpenPOWER on IntegriCloud