summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* Use NestedNameSpecifierLoc within out-of-line variables, function, andDouglas Gregor2011-02-251-4/+14
| | | | | | | tag definitions. Also, add support for template instantiation of NestedNameSpecifierLocs. llvm-svn: 126470
* Update UsingDecl, UnresolvedUsingTypenameDecl, andDouglas Gregor2011-02-251-6/+51
| | | | | | | | | | | | | | UnresolvedUsingValueDecl to use NestedNameSpecifierLoc rather than the extremely-lossy NestedNameSpecifier/SourceRange pair it used to use, improving source-location information. Various infrastructure updates to support NestedNameSpecifierLoc: - AST/PCH (de-)serialization - Recursive AST visitor - libclang traversal (including the first tests of this functionality) llvm-svn: 126459
* Teach NestedNameSpecifier to keep track of namespace aliases the sameDouglas Gregor2011-02-241-2/+4
| | | | | | | | way it keeps track of namespaces. Previously, we would map from the namespace alias to its underlying namespace when building a nested-name-specifier, losing source information in the process. llvm-svn: 126358
* Add null check in CursorVisitor::RunVisitorWorkList() when visiting ↵Ted Kremenek2011-02-231-4/+6
| | | | | | LabelDecls. Fixes <rdar://problem/9040579>. llvm-svn: 126304
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-202-4/+0
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Re-instate r125819 and r125820 with no functionality changePeter Collingbourne2011-02-192-3/+2
| | | | llvm-svn: 126060
* Revert 125820 and 125819 to fix PR9266.Rafael Espindola2011-02-192-2/+3
| | | | llvm-svn: 126050
* Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne2011-02-182-3/+2
| | | | | | | | | This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. llvm-svn: 125820
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-8/+9
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Teach the CXCodeCompleteResults results structure, which storesDouglas Gregor2011-02-161-1/+11
| | | | | | | | | code-completion results accessed via libclang, to extend the lifetime of the allocator used for cached global code-completion results at least until these completion results are destroyed. Fixes <rdar://problem/8997369>. llvm-svn: 125678
* Give some convenient idiomatic accessors to Stmt::child_range andJohn McCall2011-02-131-2/+1
| | | | | | | Stmt::const_child_range, then make a bunch of places use them instead of the individual iterator accessors. llvm-svn: 125450
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | llvm-svn: 125275
* AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actionsPeter Collingbourne2011-02-091-0/+1
| | | | llvm-svn: 125217
* Remove vtables from the Stmt hierarchy; this was pretty easy asJohn McCall2011-02-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | there were only three virtual methods of any significance. The primary way to grab child iterators now is with Stmt::child_range children(); Stmt::const_child_range children() const; where a child_range is just a std::pair of iterators suitable for being llvm::tie'd to some locals. I've left the old child_begin() and child_end() accessors in place, but it's probably a substantial penalty to grab the iterators individually now, since the switch-based dispatch is kindof inherently slower than vtable dispatch. Grabbing them together is probably a slight win over the status quo, although of course we could've achieved that with vtables, too. I also reclassified SwitchCase (correctly) as an abstract Stmt class, which (as the first such class that wasn't an Expr subclass) required some fiddling in a few places. There are somewhat gross metaprogramming hooks in place to ensure that new statements/expressions continue to implement getSourceRange() and children(). I had to work around a recent clang bug; dgregor actually fixed it already, but I didn't want to introduce a selfhosting dependency on ToT. llvm-svn: 125183
* CMake: libclang shall be named libclang.so, not liblibclang.so.Oscar Fuentes2011-02-051-0/+1
| | | | | | | It is not possible to simply change that target name to `clang' because we already have one. llvm-svn: 124972
* Don't crash when generating USRs for ObjC methods in protocols.Ted Kremenek2011-02-051-8/+13
| | | | llvm-svn: 124920
* USRs for Objective-C methods use the USR of the @interface as their base, ↵Ted Kremenek2011-02-041-18/+6
| | | | | | not the USR of the class category or extension. llvm-svn: 124859
* Teach SourceManager::getLocation() how to cope with a source fileDouglas Gregor2011-02-031-4/+14
| | | | | | | | | | | | | | | | whose inode has changed since the file was first created and that is being seen through a different path name (e.g., due to symlinks or relative path elements), such that its FileEntry pointer doesn't match a known FileEntry pointer. Since this requires a system call (to stat()), we only perform this deeper checking if we can't find the file by comparing FileEntry pointers. Also, add a micro-optimization where we don't bother to compute line numbers when given the location (1, 1). This improves the efficiency of clang_getLocationForOffset(). llvm-svn: 124800
* Fix name lookup issueDouglas Gregor2011-02-011-1/+1
| | | | llvm-svn: 124700
* Create a special allocator class for code completion, so that all ofDouglas Gregor2011-02-011-2/+2
| | | | | | | the string copying goes through a single place that can have associated state. llvm-svn: 124698
* Allocate CodeCompletionString and all of its components in aDouglas Gregor2011-02-011-48/+26
| | | | | | | | | | | | BumpPtrAllocator, rather than manually new/delete'ing them. This optimization also allows us to avoid allocating memory for and copying constant strings (e.g., "return", "class"). This also required embedding the priority and availability of results within the code completion string, to avoid extra memory allocation within libclang. llvm-svn: 124673
* Add libclang functions to determine the const/volatile/restrictDouglas Gregor2011-01-273-0/+21
| | | | | | qualifiers on a CXType. Patch from Stefan Seefeld, test by me. llvm-svn: 124377
* Eliminate the use of getTypeForDecl from clang_getCursorType() andDouglas Gregor2011-01-241-19/+20
| | | | | | | | clang_getDeclObjCTypeEncoding(); use ASTContext's methods instead, which will (lazily) create the type as needed. Otherwise, we can end up with null QualTypes. llvm-svn: 124133
* Teach libclang to generate USRs containing parameter packs and pack expansions.Douglas Gregor2011-01-191-3/+18
| | | | llvm-svn: 123848
* Teach libclang about SizeOfPackExpr.Douglas Gregor2011-01-191-2/+36
| | | | llvm-svn: 123846
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-192-4/+4
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Don't silently drop warning flags passed in toDouglas Gregor2011-01-191-1/+2
| | | | | | clang_createTranslationUnitFromSourceFile(). llvm-svn: 123793
* Fix warnings found by gcc-4.6, from -Wunused-but-set-variable andJeffrey Yasskin2011-01-182-7/+6
| | | | | | -Wint-to-pointer-cast. llvm-svn: 123719
* Introduce a new kind of TemplateName that captures a substitutedDouglas Gregor2011-01-151-0/+5
| | | | | | | | | | | | | | | template template parameter pack that cannot be fully expanded because its enclosing pack expansion could not be expanded. This form of TemplateName plays the same role as SubstTemplateTypeParmPackType and SubstNonTypeTemplateParmPackExpr do for template type parameter packs and non-type template parameter packs, respectively. We should now handle these multi-level pack expansion substitutions anywhere. The largest remaining gap in our variadic-templates support is that we cannot cope with non-type template parameter packs whose type is a pack expansion. llvm-svn: 123521
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-152-0/+4
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-081-8/+8
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
* Replace the representation of template template argument packDouglas Gregor2011-01-052-2/+5
| | | | | | | | | | | | | expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. llvm-svn: 122896
* Implement the sizeof...(pack) expression to compute the length of aDouglas Gregor2011-01-042-1/+3
| | | | | | | | | parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-0/+1
| | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. llvm-svn: 122751
* Expose Objective-C type encodings of declarations to libclang users. This ↵David Chisnall2010-12-303-0/+31
| | | | | | also adds a method in ASTContext which encodes FunctionDecls using the same encoding format that is used for Objective-C methods. llvm-svn: 122639
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-253-4/+7
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Introduced raw_identifier token kind.Abramo Bagnara2010-12-221-14/+5
| | | | llvm-svn: 122394
* When determining which preprocessed entities to traverse in libclang,Douglas Gregor2010-12-211-1/+14
| | | | | | | | take into account the region of interest. Otherwise, we may fail to traverse some important preprocessed entity cursors. Fixes <rdar://problem/8554072>. llvm-svn: 122350
* Teach clang_getCursorSemanticParent() andDouglas Gregor2010-12-211-3/+29
| | | | | | | | clang_getCursorLexicalParent() to cope with class and function templates, along with the parent of the translation unit. Fixes PR8761 and PR8766. llvm-svn: 122324
* Clean up the handling of template argument packs, especially in theDouglas Gregor2010-12-201-4/+1
| | | | | | | area of printing template arguments. The functionality changes here are limited to cases of variadic templates that aren't yet enabled. llvm-svn: 122250
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-201-0/+5
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Replace all uses of PathV1::getLast with PathV2::filename.Michael J. Spencer2010-12-181-2/+1
| | | | llvm-svn: 122117
* Added missing IgnoreParens().Abramo Bagnara2010-12-141-1/+1
| | | | llvm-svn: 121795
* Eliminate the branching in QualType::getTypePtr() by providing aDouglas Gregor2010-12-101-6/+6
| | | | | | | | | | | | | | | | | | | | common base for ExtQuals and Type that stores the underlying type pointer. This results in a 2% performance win for -emit-llvm on a typical C file, with 1% memory growth in the AST. Note that there is an API change in this optimization: QualType::getTypePtr() can no longer be invoked on a NULL QualType. If the QualType might be NULL, use QualType::getTypePtrOrNull(). I've audited all uses of getTypePtr() in the code base and changed the appropriate uses over to getTypePtrOrNull(). A future optimization opportunity would be to distinguish between cast/dyn_cast and cast_or_null/dyn_cast_or_null; for the former, we could use getTypePtr() rather than getTypePtrOrNull(), to take another branch out of the cast/dyn_cast implementation. llvm-svn: 121489
* Added ParenType type node.Abramo Bagnara2010-12-101-0/+5
| | | | llvm-svn: 121488
* In clang_getCursor(), don't override a preprocessing cursor withinDouglas Gregor2010-12-101-0/+6
| | | | | | another preprocessing cursor, since we want the outermost one. llvm-svn: 121470
* Extend libclang debugging output for clang_getCursor() to show the ↵Douglas Gregor2010-12-101-0/+18
| | | | | | definition we found llvm-svn: 121451
* Fix build.Anders Carlsson2010-12-091-1/+1
| | | | llvm-svn: 121341
* Remove extra namespace specifier.Ted Kremenek2010-12-091-1/+1
| | | | llvm-svn: 121334
OpenPOWER on IntegriCloud