summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* [libclang] Make clang_findReferencesInFile use "file-targeted" ↵Argyrios Kyrtzidis2011-11-162-30/+31
| | | | | | | | deserialization and avoid unnecessary deserializations. llvm-svn: 144791
* [libclang] Indexing API: fill the objc category info for a category ↵Argyrios Kyrtzidis2011-11-161-3/+16
| | | | | | | | implementation and do not crash if no client container is registered for a declaration context. llvm-svn: 144765
* [libclang] Indexing API: make sure we do not try to index local declarations.Argyrios Kyrtzidis2011-11-163-21/+10
| | | | llvm-svn: 144764
* [libclang] Indexing API: if the CXIndexOpt_OneRefPerFile option is set, only ↵Argyrios Kyrtzidis2011-11-162-6/+76
| | | | | | | | report one reference per file. llvm-svn: 144763
* [libclang] In lazyCreateDiags, recreate the diagnostic set if the number of ↵Argyrios Kyrtzidis2011-11-161-3/+16
| | | | | | | | diagnostics in the ASTUnit changed. llvm-svn: 144762
* [libclang] Indexing API: Pass an implicit ObjCInterfaceDecl (@implementation ↵Argyrios Kyrtzidis2011-11-152-2/+5
| | | | | | | | without @interface) in a separate indexing callback than its implementation. llvm-svn: 144625
* [libclang] Introduce a new function to apply the indexing callbacks on an ↵Argyrios Kyrtzidis2011-11-155-20/+199
| | | | | | | | existing CXTranslationUnit, mainly to be used for indexing a PCH. llvm-svn: 144623
* Fix potential memory leak for clients of clang_getOverriddenCursors(). If ↵Ted Kremenek2011-11-141-0/+4
| | | | | | the number of overriden cursors is 0, do not allocate an array of CXCursors. This fixes a memory leak in c-index-test, and clients who use this API in a similar way. llvm-svn: 144595
* [libclang] Slight changes to the indexing API and bigger internal changes ↵Argyrios Kyrtzidis2011-11-144-122/+189
| | | | | | for it. llvm-svn: 144577
* [libclang] Further simplify the indexing API.Argyrios Kyrtzidis2011-11-126-291/+150
| | | | | | | That stuff can be added later on if we need them. Also add some const goodness. llvm-svn: 144446
* Tweak CXLoadedDiagnosticSetImpl::makeString() to include an extra null ↵Ted Kremenek2011-11-111-5/+8
| | | | | | character, and change the creation of the FixIT's string to again just rely on this string (instead of duplicating it when calling createCXString). llvm-svn: 144389
* libclang/CXLoadedDiagnostic.cpp: Work around not to miss the string ↵NAKAMURA Takumi2011-11-111-1/+1
| | | | | | | | terminator on fixit. FixIts might be exposed as C string via clang_getCString(), though the zero terminator is not allocated in CXLoadedDiagnosticSetImpl::makeString. llvm-svn: 144379
* [libclang] Simplify the indexing API.Argyrios Kyrtzidis2011-11-116-402/+412
| | | | | | | | Cut down the number of callbacks to more generic ones. Clients can check an enum to find out what kind of declaration it is and they can call functions to get more specific information than the generic provided info. llvm-svn: 144343
* serialized diagnostics: implement full deserialization of clang diagnostics ↵Ted Kremenek2011-11-1010-101/+977
| | | | | | | | via the libclang API. I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks. llvm-svn: 144269
* Sort contents of exports file. No functionality change.Ted Kremenek2011-11-081-4/+4
| | | | llvm-svn: 144116
* Change the AST representation of operations on Objective-CJohn McCall2011-11-062-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* [libclang] Move CursorVisitor to its own header.Argyrios Kyrtzidis2011-11-033-239/+264
| | | | llvm-svn: 143639
* [libclang] Use CursorVisitor::Visit instead of invoking the visitor directly.Argyrios Kyrtzidis2011-11-031-18/+2
| | | | llvm-svn: 143637
* [libclang] Add missing return in clang_getExpansionLocation that resulted in ↵Argyrios Kyrtzidis2011-11-031-0/+1
| | | | | | | | | | | that function always returning a null file/line/column. Also add at least one use of clang_getExpansionLocation inside c-index-test that would have made the tests to catch that. llvm-svn: 143606
* [libclang] Add infrastructure to be able to only deserialize decls in a file ↵Argyrios Kyrtzidis2011-11-031-5/+144
| | | | | | | | region and use it for clang_getCursor. llvm-svn: 143605
* Add missing export. Spotted by Leandro Melo.Eli Friedman2011-11-011-0/+1
| | | | llvm-svn: 143508
* [libclang] For a class extension, give it a unique USR but for any property ↵Argyrios Kyrtzidis2011-11-011-4/+16
| | | | | | | | | | or ivar it contains give it a USR based on its semantic context, which is the interface. This follows what we already did for objc methods. rdar://10371669 llvm-svn: 143464
* Rework the AST for the initializer of a delegating constructor, soDouglas Gregor2011-11-011-2/+2
| | | | | | | | | that it retains source location information for the type. Aside from general goodness (being able to walk the types described in that information), we now have a proper representation for dependent delegating constructors. Fixes PR10457 (for real). llvm-svn: 143410
* [libclang] Tweak internals of CXSourceLocation to allow an alternate ↵Ted Kremenek2011-10-311-75/+111
| | | | | | | | implementation if the lowest bit of ptr_data[0] is not 0. This is prep for work on serialized diagnostics. llvm-svn: 143373
OpenPOWER on IntegriCloud