summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a big layering violation introduced by r158771.Chandler Carruth2012-06-202-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | That commit added a new library just to hold the RawCommentList. I've started a discussion on the commit thread about whether that is really meritted -- it certainly doesn't seem necessary at this stage. However, the immediate problem is that the AST library has a hard dependency on the Comment library, but the dependencies were set up completely backward. In addition to the layering violation, this had an unfortunate effect if scattering the Comments library dependency throughout the build system, but inconsistently so -- several parts of the CMake dependencies were missing and only showed up due to transitive deps or the fact that the target wasn't being built by tho bots. It turns out that the Comments library can't (currently) be a well formed layer *below* the AST library either, as it has an API that accepts an ASTContext. That parameter is currently unused, so maybe that was a mistake? Anyways, it really seems like this is logically part of the AST -- that's the whole point of the ASTContext providing access to it as far as I can tell -- so I've merged it into the AST library to solve the immediate layering violation problems and remove some of the churn from our library dependencies. llvm-svn: 158807
* Structured comment parsing, first step.Dmitri Gribenko2012-06-204-2/+33
| | | | | | | | | * Retain comments in the AST * Serialize/deserialize comments * Find comments attached to a certain Decl * Expose raw comment text and SourceRange via libclang llvm-svn: 158771
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-113-0/+11
| | | | llvm-svn: 158325
* [libclang] When doing the cursor visitation make sure declarationsArgyrios Kyrtzidis2012-06-091-1/+31
| | | | | | | | | | | | | | | in the same line do not override getting a cursor for the previous declaration. e.g: int x, y; @synthesize prop1, prop2; pointing at 'x'/'prop1' would give 'y'/'prop2' because their source ranges overlap. rdar://11361113 llvm-svn: 158258
* [libclang] Don't crash when saving a PCH from a prefix headerArgyrios Kyrtzidis2012-06-081-0/+2
| | | | | | | | that does not exist. rdar://11607033 llvm-svn: 158193
* [libclang/AST]Argyrios Kyrtzidis2012-06-081-1/+14
| | | | | | | | | | | | | AST: For auto-synthesized ivars give them the location of the related property (previously they had no source location). This allows them to be indexed by libclang. libclang: Make sure synthesized ivars are indexed before the methods that may reference them. Fixes rdar://11607001. llvm-svn: 158189
* Plug a long standing memory leak in TemplateArgument.Benjamin Kramer2012-06-071-1/+1
| | | | | | | | | | | | | | | The integral APSInt value is now stored in a decomposed form and the backing store for large values is allocated via the ASTContext. This way its not leaked as TemplateArguments are never destructed when they are allocated in the ASTContext. Since the integral data is immutable it is now shared between instances, making copying TemplateArguments a trivial operation. Currently getting the integral data out of a TemplateArgument requires creating a new APSInt object. This is cheap when the value is small but can be expensive if it's not. If this turns out to be an issue a more efficient accessor could be added. llvm-svn: 158150
* Zap the /Za compiler switch from MSVC projects, the option is considered ↵Francois Pichet2012-06-061-7/+0
| | | | | | | | harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed. Only 1 minor code change was necessary: can't use cdecl as variable name anymore. llvm-svn: 158063
* Replace some custom hash combines with the standard stuff from DenseMapInfo.Benjamin Kramer2012-05-271-4/+2
| | | | llvm-svn: 157531
* [libclang] Report CXType_ObjCId for 'const id', not CXType_Typedef.Argyrios Kyrtzidis2012-05-231-4/+5
| | | | | | rdar://11357807 llvm-svn: 157356
* [libclang] Properly handle @encode() in RecursiveASTVisitor and traverseArgyrios Kyrtzidis2012-05-161-2/+6
| | | | | | its type source info. Fixes indexing references inside @encode(). llvm-svn: 156936
* [libclang/AST] Index references of protocols in "@protocol(...)" syntax.Argyrios Kyrtzidis2012-05-161-0/+6
| | | | | | | | | To do that, keep track of the location of the protocol id in the ObjCProtocolExpr AST node. rdar://11190837 llvm-svn: 156890
* This patch fixes the cmake build to create libclang.so/libclang.a on linuxManuel Klimek2012-05-151-6/+14
| | | | | | | | instead of liblibclang.so/liblibclang.a. Patch by Arnaud de Grandmaison. llvm-svn: 156809
* Fix an assertion hit when the serialized diagnostics writer receive a diagnosticArgyrios Kyrtzidis2012-05-101-10/+20
| | | | | | | | | | | | | | from the frontend when the location is invalid and the SourceManager null. Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it to the calls accordingly (as reference when it is expected to not be null, or pointer when it may be null). This effectively makes DiagnosticRenderer not tied to a specific SourceManager, removing a hack from TextDiagnosticPrinter. rdar://11386874 llvm-svn: 156536
* [AST/libclang] Speed up clang_getOverriddenCursors() considerably by ↵Argyrios Kyrtzidis2012-05-091-21/+81
| | | | | | | | | | | | | reserving a bit in ObjCMethodDecl to indicate whether the method does not override any other method, which is the majority of cases. That way we can avoid unnecessary work doing lookups, especially when PCH is involved. rdar://11360082 llvm-svn: 156476
* [libclang] Map 'id'/'Class'/'SEL' to the corresponding CXType kinds.Argyrios Kyrtzidis2012-05-081-1/+16
| | | | | | rdar://11357807 llvm-svn: 156352
* Introduce a new libclang API to determine the platform availability ofDouglas Gregor2012-05-082-0/+86
| | | | | | | | a given entity, so that we can tell when the entity was introduced/deprecated/obsoleted on each platform for which we have an annotation. Addresses <rdar://problem/11365715>. llvm-svn: 156347
* [libclang] Actually commit the changes to make libclang's RecursiveASTVisitorArgyrios Kyrtzidis2012-05-071-190/+121
| | | | | | data-recursive for statements. llvm-svn: 156339
* [libclang] Put the RecursiveASTVisitor in libclang in a cxindex namespace.Argyrios Kyrtzidis2012-05-073-2/+4
| | | | llvm-svn: 156331
* Un-revert r156142, "[libclang] Bring back ↵Argyrios Kyrtzidis2012-05-071-0/+6
| | | | | | | | BodyIndexer::TraverseCXXOperatorCallExpr". It was reverted on r156253. llvm-svn: 156330
* [libclang] Use a copy of the data-recursive RecursiveASTVisitor inside libclang.Argyrios Kyrtzidis2012-05-073-2/+2245
| | | | | | | | | | This is temporary until we settle on how to make the main RecursiveASTVisitor safe. There are some modifications on the original version, to avoid extreme memory usage when compiling for release. rdar://11179167 llvm-svn: 156329
* Revert r156142, "[libclang] Bring back ↵NAKAMURA Takumi2012-05-061-6/+0
| | | | | | | | BodyIndexer::TraverseCXXOperatorCallExpr which" It caused test/Index/index-many-call-ops.cpp to fail in stage2 c-index-test on selfhosting i686-cygwin and x86_64-linux since r156229 (Reverting making RecursiveASTVisitor data recursive). llvm-svn: 156253
* [libclang] Bring back BodyIndexer::TraverseCXXOperatorCallExpr whichArgyrios Kyrtzidis2012-05-041-0/+6
| | | | | | | was removed in r155969 to address a deficiency of RecursiveASTVisitor prior to recent changes on it. llvm-svn: 156142
* Unrevert r155951, reverted in r155962, with two changes:Richard Smith2012-05-021-6/+0
| | | | | | | | | * 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. llvm-svn: 155969
* clang_getCursorLexicalParent should return a translation unit cursor for ↵Douglas Gregor2012-04-301-2/+2
| | | | | | declarations at the global scope, from Evan P. Fixes PR9083. llvm-svn: 155858
* Fix C versus C++ linkage issue.Ted Kremenek2012-04-301-1/+3
| | | | llvm-svn: 155842
* Reduce malloc() traffic of clang_getOverridenCursors() by using a pool of ↵Ted Kremenek2012-04-304-32/+113
| | | | | | | | | | SmallVector<CXCursor> objects under the covers. Fixes <rdar://problem/11289160>. llvm-svn: 155841
* don't use soname on OpenBSD, it doesn't support it. Patch byChris Lattner2012-04-251-1/+1
| | | | | | Brad Smith! llvm-svn: 155534
* [libclang] Don't set dylib load address to 0xe000000.Argyrios Kyrtzidis2012-04-202-2/+2
| | | | | | | | | | | | Per Greg Clayton: libclang.dylib is trying to be smart and load itself at a valid address to be able to load faster which would work for 32 bit systems, bit won't make any difference on 64 bit systems. It should either pick a better 64 bit address, or just let itself be loaded at zero. rdar://11159142 llvm-svn: 155246
* 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
OpenPOWER on IntegriCloud