summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach SourceManager::getSLocEntry() that it can fail due to problemsDouglas Gregor2011-04-202-5/+6
| | | | | | | | during deserialization from a precompiled header, and update all of its callers to note when this problem occurs and recover (more) gracefully. Fixes <rdar://problem/9119249>. llvm-svn: 129839
* Add missing break statements.Ted Kremenek2011-04-191-0/+2
| | | | llvm-svn: 129750
* Report memory usage for global code completion results in CXTUMemoryUsage.Ted Kremenek2011-04-181-0/+12
| | | | llvm-svn: 129733
* Add libclang API to query how much memory is used by a CXTranslationUnit. ↵Ted Kremenek2011-04-183-0/+73
| | | | | | | | This is a WIP. Currently we report the amount used for expressions, types, identifiers, and selectors. llvm-svn: 129730
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-152-2/+13
| | | | llvm-svn: 129567
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-0/+1
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-0/+1
| | | | | | draft standard (N3291). llvm-svn: 129541
* Harden Clang's cursor visitation logic against NULL declaration,Douglas Gregor2011-04-141-5/+16
| | | | | | | statement, and expression pointers. While these shouldn't happen, it's better to be safe in libclang. llvm-svn: 129539
* libclang output name is now libclang. This solves a name collisionOscar Fuentes2011-04-101-2/+2
| | | | | | | | | | when building with Visual Studio. `clang.dll' and `clang.exe' would have the same `clang.ilk' and `clang.pdb'. On a serial build those files would be overwritten as clang.exe/clang.dll are created. On a parallel build there is a risk of both files being written at the same time. On that case VS fails. llvm-svn: 129239
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-072-0/+2
| | | | | | | | | | | | The idea is that you can create a VarDecl with an unknown type, or a FunctionDecl with an unknown return type, and it will still be valid to access that object as long as you explicitly cast it at every use. I'm still going back and forth about how I want to test this effectively, but I wanted to go ahead and provide a skeletal implementation for the LLDB folks' benefit and because it also improves some diagnostic goodness for placeholder expressions. llvm-svn: 129065
* Fix crash in clang_getInstantiationLoc() when ↵Ted Kremenek2011-03-231-9/+26
| | | | | | | | SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid FileID on invalid code. Fixes <rdar://problem/9164623>. llvm-svn: 128139
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-231-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Hopefully fix VS build by not using std::vector::data().Ted Kremenek2011-03-221-3/+6
| | | | llvm-svn: 128105
* Rework crash recovery cleanup in ASTUnit and CIndex to recover more memory ↵Ted Kremenek2011-03-221-21/+43
| | | | | | | | during a Sema crash (we have just a handful of leaks left) and to use the simplified cleanup registration API. llvm-svn: 128059
* Improve crash recovery cleanup to recovery CompilerInstances during crash ↵Ted Kremenek2011-03-211-6/+6
| | | | | | | | | | recovery. This was a huge resource "root" during crashes. This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance object. llvm-svn: 128011
* In clang_parseTranslationUnit_Impl,p ut the source file after ↵Argyrios Kyrtzidis2011-03-201-6/+8
| | | | | | | | command_line_args otherwise if '-x' flag is present it will be unused. llvm-svn: 127971
* Add libclang hook 'clang_toggleCrashRecovery()', which provides a mechanism ↵Ted Kremenek2011-03-183-1/+10
| | | | | | for a client to enable/disable CrashRecovery within libclang function calls. llvm-svn: 127920
* Run all functional logic of clang_annotateTokens() within a ↵Ted Kremenek2011-03-181-72/+89
| | | | | | CrashRecoveryContext. Fixes <rdar://problem/9121698>. llvm-svn: 127919
* Correctly store and keep track of the FileSystemOptions in ASTUnit and in ↵Anders Carlsson2011-03-181-3/+6
| | | | | | clang_codeCompleteAt. llvm-svn: 127890
* When libclang visits a translation unit via clang_visitChildren(),Douglas Gregor2011-03-161-37/+51
| | | | | | | | | | | | | walk the preprocessing record *before* walking the declarations, so they we pretend that we actually respect the phases of translation. We still walk the preprocessing record after the declarations when performing token annotation or finding the cursor at a location, since those routines depend on those semantics. Fixes <rdar://problem/9137195>. llvm-svn: 127776
* c-index-test shouldn't crash when a goto has no matching label. Fixes ↵Ted Kremenek2011-03-151-1/+3
| | | | | | <rdar://problem/9123493>. llvm-svn: 127711
* Fix LIBCLANG_LINK_FLAGS for Darwin.Oscar Fuentes2011-03-141-2/+2
| | | | | | | The previous syntax created a list with the usual semicolon as separator, which breaks the link command. llvm-svn: 127579
* Build libclang as a static library too. Now tested on Windows!Oscar Fuentes2011-03-131-28/+36
| | | | | | | | On Windows only the shared library is created. The reason for this is that clang.lib the static library would clash with clang.lib the export library of the dll. llvm-svn: 127566
* 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
OpenPOWER on IntegriCloud