summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
* Reverting "Build libclang as a static library too."Oscar Fuentes2011-03-131-42/+28
| | | | | | This reverts commit r127556. It breaks the build for MSVC. llvm-svn: 127564
* Build libclang as a static library too.Oscar Fuentes2011-03-121-28/+42
| | | | llvm-svn: 127556
* Renamed OffsetOfNode::getRange to getSourceRange for uniformity.Abramo Bagnara2011-03-121-1/+1
| | | | llvm-svn: 127534
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-112-3/+4
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true ↵Argyrios Kyrtzidis2011-03-081-0/+1
| | | | | | | | | | | the SourceManager should report the original file name for contents of files that were overriden by other files, otherwise it should report the name of the new file. Default is true. Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine. llvm-svn: 127289
* libclang/CIndexer.cpp: Apply a new API for Cygwin-1.7, instead of deprecated ↵NAKAMURA Takumi2011-03-081-0/+5
| | | | | | one. llvm-svn: 127283
* Teach libclang's token-annotation logic about context-sensitiveDouglas Gregor2011-03-081-3/+142
| | | | | | keywords for Objective-C+ and C++0x. llvm-svn: 127253
* Rename the type argument for the iboutletcollection attribute to notDouglas Gregor2011-03-061-1/+1
| | | | | | conflict with MinGW headers, from Kirk Beitz! llvm-svn: 127127
* Currently we can only remap a file by creating a MemoryBuffer and replacing ↵Argyrios Kyrtzidis2011-03-051-2/+2
| | | | | | | | | the file contents with it. Allow remapping a file by specifying another filename whose contents should be loaded if the original file gets loaded. This allows to override files without having to create & load buffers in advance. llvm-svn: 127052
* Fix the source range for a member access expression that includes aDouglas Gregor2011-03-021-6/+2
| | | | | | | nested-name-specifier and improve the detection of implicit 'this' bases. Fixes <rdar://problem/8750392>. llvm-svn: 126880
* Teach libclang how to visit the children of a C++ base-class specifierDouglas Gregor2011-03-021-1/+10
| | | | | | (i.e., the TypeLoc describing the base class type). llvm-svn: 126861
* Push nested-name-specifier source location information into templateDouglas Gregor2011-03-021-0/+3
| | | | | | | | | | | | template arguments. I believe that this is the last place in the AST where we were storing a source range for a nested-name-specifier rather than a proper nested-name-specifier location structure. (Yay!) There is still a lot of cleanup to do in the TreeTransform, which doesn't take advantage of nested-name-specifiers with source-location information everywhere it could. llvm-svn: 126844
* Push nested-name-specifier source-location information into dependentDouglas Gregor2011-03-011-0/+17
| | | | | | | | template specialization types. There are still a few rough edges to clean up with some of the parser actions dropping nested-name-specifiers too early. llvm-svn: 126776
* Reinstate the introduction of source-location information forDouglas Gregor2011-03-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | nested-name-speciciers within elaborated type names, e.g., enum clang::NestedNameSpecifier::SpecifierKind Fixes in this iteration include: (1) Compute the type-source range properly for a dependent template specialization type that starts with "template template-id ::", as in a member access expression dep->template f<T>::f() This is a latent bug I triggered with this change (because now we're checking the computed source ranges for dependent template specialization types). But the real problem was... (2) Make sure to set the qualifier range on a dependent template specialization type appropriately. This will go away once we push nested-name-specifier locations into dependent template specialization types, but it was the source of the valgrind errors on the buildbots. llvm-svn: 126765
* Revert r126748, my second attempt at nested-name-specifier sourceDouglas Gregor2011-03-011-8/+0
| | | | | | location information for elaborated types. *sigh* llvm-svn: 126753
* Reinstate r126737, extending the generation of type-source locationDouglas Gregor2011-03-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | information for qualifier type names throughout the parser to address several problems. The commit message from r126737: Push nested-name-specifier source location information into elaborated name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. llvm-svn: 126748
* Revert r126737, the most recent nested-name-specifier location change, for ↵Douglas Gregor2011-03-011-8/+0
| | | | | | buildbot breakage. llvm-svn: 126746
* Push nested-name-specifier source location information into elaboratedDouglas Gregor2011-03-011-0/+8
| | | | | | | | | | | | | | | | | | | name types, e.g., "enum clang::NestedNameSpecifier::SpecifierKind". Aside from the normal changes, this also required some tweaks to the parser. Essentially, when we're looking at a type name (via getTypeName()) specifically for the purpose of creating an annotation token, we pass down the flag that asks for full type-source location information to be stored within the returned type. That way, we retain source-location information involving nested-name-specifiers rather than trying to reconstruct that information later, long after it's been lost in the parser. With this change, test/Index/recursive-cxx-member-calls.cpp is showing much improved results again, since that code has lots of nested-name-specifiers. llvm-svn: 126737
* Push nested-name-specifier source location information intoDouglas Gregor2011-03-011-25/+42
| | | | | | | | | | | | DependentNameTypeLoc. Teach the recursive AST visitor and libclang how to walk DependentNameTypeLoc nodes. Also, teach libclang about TypedefDecl source ranges, so that we get those. The massive churn in test/Index/recursive-cxx-member-calls.cpp is a good thing: we're annotating a lot more of this test correctly now. llvm-svn: 126729
* Push nested-name-specifier location information into DeclRefExpr andDouglas Gregor2011-02-281-4/+4
| | | | | | MemberExpr, the last of the expressions with qualifiers! llvm-svn: 126688
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-281-2/+2
| | | | | | | | | | | | | UnresolvedLookupExpr and UnresolvedMemberExpr. Also, improve the computation that checks whether the base of a member expression (either unresolved or dependent-scoped) is implicit. The previous check didn't cover all of the cases we use in our representation, which threw off source-location information for these expressions (which, in turn, caused some breakage in libclang's token annotation). llvm-svn: 126681
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-281-2/+2
| | | | | | | | CXXDependentScopeMemberExpr, and clean up instantiation of nested-name-specifiers with dependent template specialization types in the process. llvm-svn: 126663
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-251-2/+1
| | | | | | | DependentScopeDeclRefExpr. Plus, give NestedNameSpecifierLoc == and != operators, since we're going to need 'em elsewhere. llvm-svn: 126508
* CMake: add version information into the clang executable and libclangDouglas Gregor2011-02-251-8/+6
| | | | | | shared library. llvm-svn: 126502
* Push nested-name-specifier source-location information intoDouglas Gregor2011-02-251-2/+38
| | | | | | | | pseudo-destructor expressions. Also, clean up some template-instantiation and type-checking issues with pseudo-destructors. llvm-svn: 126498
* Push nested-name-specifier source location information into namespaceDouglas Gregor2011-02-251-2/+2
| | | | | | aliases. llvm-svn: 126496
* Push nested-name-specifier source location information into using directives.Douglas Gregor2011-02-251-2/+2
| | | | llvm-svn: 126489
* 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
OpenPOWER on IntegriCloud