summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-276-65/+28
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* remove unneeded config.h includesDylan Noblesmith2011-12-221-1/+1
| | | | llvm-svn: 147195
* [libclang] In visitPreprocessedEntitiesInRange we are interested in a file ↵Argyrios Kyrtzidis2011-12-211-2/+2
| | | | | | | | region so translate the range to file locations. llvm-svn: 147058
* Keep track of all declarations of an Objective-C class (both forwardDouglas Gregor2011-12-153-14/+14
| | | | | | | | | | declarations and definitions) as ObjCInterfaceDecls within the same redeclaration chain. This new representation matches what we do for C/C++ variables/functions/classes/templates/etc., and makes it possible to answer the query "where are all of the declarations of this class?" llvm-svn: 146679
* [libclang] Give up on using write(); hopefully unbreaks mingw build.Argyrios Kyrtzidis2011-12-151-15/+1
| | | | llvm-svn: 146648
* Revert r146646 that was a mistake, and make the intended change in the right ↵Argyrios Kyrtzidis2011-12-151-0/+10
| | | | | | | | | file. Log: [libclang] Try to unbreak mingw build. llvm-svn: 146647
* Move the definition-specific data of ObjCInterfaceDecl into aDouglas Gregor2011-12-151-1/+4
| | | | | | | | | | | | | | | | separately-allocated DefinitionData structure, which we manage the same way as CXXRecordDecl::DefinitionData. This prepares the way for making ObjCInterfaceDecls redeclarable, to more accurately model forward declarations of Objective-C classes and eliminate the mutation of ObjCInterfaceDecl that causes us serious trouble in the AST reader. Note that ObjCInterfaceDecl's accessors are fairly robust against being applied to forward declarations, because Clang (and Sema in particular) doesn't perform RequireCompleteType/hasDefinition() checks everywhere it has to. Each of these overly-robust cases is marked with a FIXME, which we can tackle over time. llvm-svn: 146644
* [libclang] Install a fatal error handler that will call abort() instead of ↵Argyrios Kyrtzidis2011-12-151-0/+12
| | | | | | | | | | exit() when there is a report_fatal_error() call. rdar://10507984 llvm-svn: 146641
* [libclang] Indexing API: provide an attribute list inside CXIdxEntityInfoArgyrios Kyrtzidis2011-12-152-52/+126
| | | | | | so that we can access the attributes of an entity for a reference. llvm-svn: 146616
* [libclang] Suppress indexing references for occurrences of the interfaceArgyrios Kyrtzidis2011-12-151-0/+6
| | | | | | in a superclass and the protocols in a protocol list. llvm-svn: 146615
* Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline itsDouglas Gregor2011-12-142-4/+3
| | | | | | | members into ObjCClassDecl, saving ourselves one pointer per forward declaration. llvm-svn: 146564
* [libclang] Indexing API: Provide the protocols list for objc categories as well.Argyrios Kyrtzidis2011-12-133-0/+11
| | | | | | rdar://10573361 llvm-svn: 146498
* [libclang] Indexing API: Fix indexing of missed references.Argyrios Kyrtzidis2011-12-134-29/+100
| | | | | | rdar://10567864&10567916 llvm-svn: 146497
* [libclang] Indexing API: Fix suppressing of references in macros and suppressArgyrios Kyrtzidis2011-12-131-2/+15
| | | | | | | | @class forward references. rdar://10568080&10568103&10568119 llvm-svn: 146496
* [libclang] Add defensive checks to make sure we don't try to dereferenceArgyrios Kyrtzidis2011-12-105-22/+52
| | | | | | a null pointer after getCursorDecl() is called. rdar://10298421. llvm-svn: 146312
* Add clang_getDiagnosticSetFromTU() to libclang. Fixes ↵Ted Kremenek2011-12-092-2/+10
| | | | | | <rdar://problem/10553081>. llvm-svn: 146287
* Sort exports list.Ted Kremenek2011-12-091-8/+8
| | | | llvm-svn: 146286
* Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!Argyrios Kyrtzidis2011-12-091-1/+1
| | | | llvm-svn: 146213
* [libclang] Make sure we don't try to handle a CXCursor_NoDeclFoundArgyrios Kyrtzidis2011-12-092-2/+9
| | | | | | passed to clang_findReferencesInFile. llvm-svn: 146211
* [libclang] When doing clang_findReferencesInFile, make sure we don't crashArgyrios Kyrtzidis2011-12-081-3/+15
| | | | | | | | if we come up against a null Decl. No test case unfortunately. rdar://10457799. llvm-svn: 146127
* [libclang] Remove IndexingContext's getScopedContext(), it's not usefulArgyrios Kyrtzidis2011-12-082-28/+0
| | | | | | now that client containers can be set via function calls. llvm-svn: 146117
* [libclang] Indexing API: provide both the semantic and the lexical container.Argyrios Kyrtzidis2011-12-072-8/+11
| | | | | | They are generally the same except in C++ cases like out-of-line member functions. llvm-svn: 146069
* [libclang] Fix indexing of C++ bases in a C++ class.Argyrios Kyrtzidis2011-12-072-4/+38
| | | | llvm-svn: 146068
* [libclang] Introduce CXIdxEntityLanguage that indicates the languageArgyrios Kyrtzidis2011-12-071-18/+54
| | | | | | of an indexed entity. llvm-svn: 146067
* [libclang] Index C++ namespaces.Argyrios Kyrtzidis2011-12-073-0/+15
| | | | llvm-svn: 146019
* Tweak serialized diagnostics to support errors with no categories. Fixes ↵Ted Kremenek2011-12-071-1/+2
| | | | | | <rdar://problem/10538300>. llvm-svn: 146011
* [libclang] API enhancements by Joe Groff!Argyrios Kyrtzidis2011-12-064-2/+204
| | | | | | | | | | | | | - Exposes a CXType_Vector type kind for vector types. - Adds generalized versions of the clang_getArrayElementType and clang_getArraySize functions, named clang_getElementType and clang_getNumElements, which work on array, vector, or complex types. - Adds additional functions for querying function types. clang_isFunctionTypeVariadic returns true if a function type is variadic. clang_getFunctionCallingConv returns an enumeration value indicating the calling convention of the function type. clang_getNumArgTypes returns the number of static argument types, and clang_getArgType gets the type of an argument. - Adds a clang_getTypedefDeclUnderlyingType function to get the underlying type from a TypedefDecl cursor. - Adds a clang_getEnumDeclIntegerType function to get the integer type from an EnumDecl cursor. - Adds clang_getEnumConstantDeclValue and clang_getEnumConstantDeclUnsignedValue functions to get the value of an EnumConstantDecl as a signed or unsigned long long, respectively. - Exposes a CXCursor_AsmLabelAttr cursor kind for __asm__("label") attributes. - Alters clang_getCursorSpelling to return the label value for AsmLabelAttr-kind cursors. llvm-svn: 145972
* [libclang] When indexing a field in a C++ class, return an entityArgyrios Kyrtzidis2011-12-051-1/+6
| | | | | | of kind CXIdxEntity_CXXInstanceVariable. rdar://10522503. llvm-svn: 145859
* [libclang] Fix infinite loop when doing visitation of an OpaqueValueExpr.Argyrios Kyrtzidis2011-12-031-1/+0
| | | | llvm-svn: 145751
* [libclang] Allow indexing/get-cursor/etc. for the exception variable in a ↵Argyrios Kyrtzidis2011-12-031-0/+7
| | | | | | C++ catch. llvm-svn: 145750
* Introduce a module import declaration, so that we properly represent, e.g.,Douglas Gregor2011-12-021-0/+1
| | | | | | | | __import_module__ std.vector; in the AST. llvm-svn: 145725
* [libclang] Create a diagnostic set to pass at the end of indexing.Argyrios Kyrtzidis2011-12-014-8/+26
| | | | llvm-svn: 145557
* [libclang] Do the ConcurrencyCheck at the beginning of ↵Argyrios Kyrtzidis2011-11-291-3/+6
| | | | | | clang_findReferencesInFile. llvm-svn: 145455
* Preserve constness.Benjamin Kramer2011-11-291-4/+4
| | | | llvm-svn: 145397
* Silence GCC warnings, RefCountedBase is meant to be default-initialized here.Benjamin Kramer2011-11-291-1/+0
| | | | llvm-svn: 145396
* [libclang] Fix leak in clang_indexSourceFile_ImplArgyrios Kyrtzidis2011-11-291-1/+2
| | | | llvm-svn: 145393
* [libclang] Make clang_findReferencesInFile also work on macros (find all ↵Argyrios Kyrtzidis2011-11-293-11/+124
| | | | | | | | | | | | | expansions/definition of a macro in a file). As a bonus, also make searching for declarations more efficient by ignoring preprocessing entities when we know that we are looking for a declaration. Fixes rdar://10427411. llvm-svn: 145369
* Fix serialized diagnostics to handle FixIts that only remove text. Fixes ↵Ted Kremenek2011-11-291-6/+17
| | | | | | <rdar://problem/10473903>. llvm-svn: 145339
* [libclang] Protect against the declaration's SourceRange being invalidArgyrios Kyrtzidis2011-11-281-0/+2
| | | | | | | | | before passing to RangeCompare. Though no idea how this can occur with the decls returned from findFileRegionDecls(). llvm-svn: 145301
* [libclang] Indexing API: If the client requested to get a CXTranslationUnit ↵Argyrios Kyrtzidis2011-11-281-4/+30
| | | | | | | | after indexing, honor all the TU options. llvm-svn: 145229
* [libclang] Indexing API: Capture diagnostics during indexing.Argyrios Kyrtzidis2011-11-281-1/+2
| | | | llvm-svn: 145228
* [libclang] Fix operations (token annotation, getting cursor, etc.) with a ↵Argyrios Kyrtzidis2011-11-231-1/+1
| | | | | | | | | | | | | | | file region inside an objc container that "contains" other file-level declarations. When getting the array of file-level declarations that overlap with a file region, we failed to report that the region overlaps with an objc container, if the container had other file-level declarations declared lexically inside it. Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST and handling them appropriately. llvm-svn: 145109
* [libclang] Indexing API: Fix issues, mostly C++ related.Argyrios Kyrtzidis2011-11-233-40/+58
| | | | llvm-svn: 145107
* [libclang] Indexing API: Support C++ symbols.Argyrios Kyrtzidis2011-11-228-76/+435
| | | | llvm-svn: 145058
* Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continueArgyrios Kyrtzidis2011-11-181-5/+2
| | | | | | parsing or false to abort parsing. llvm-svn: 144943
* [libclang] Indexing API:Argyrios Kyrtzidis2011-11-189-154/+342
| | | | | | | | | -For indexDeclaration, also pass the declaration attributes as an array of cursors. -Rename CXIndexOpt_OneRefPerFile -> CXIndexOpt_SuppressRedundantRefs, and only pass a reference if a declaration/definition does not exist in the file. -Other fixes. llvm-svn: 144942
* [libclang] Indexing API: make sure we don't pass declarations/references ↵Argyrios Kyrtzidis2011-11-181-7/+13
| | | | | | without USR or location. llvm-svn: 144941
* Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek2011-11-171-1/+1
| | | | | | | | | | | | | | | | | object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. llvm-svn: 144930
* [libclang] Add a comment in lazyCreateDiags to explain why the check and ↵Argyrios Kyrtzidis2011-11-161-0/+17
| | | | | | | | reset of diagnostic set is necessary. llvm-svn: 144793
* [libclang] Make clang_annotateTokens use "file-targeted" deserialization and ↵Argyrios Kyrtzidis2011-11-162-22/+45
| | | | | | | | avoid unnecessary deserializations. llvm-svn: 144792
OpenPOWER on IntegriCloud