summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang
Commit message (Collapse)AuthorAgeFilesLines
...
* NestedMacroInstantiations -> NestedMacroExpansionsChandler Carruth2011-07-141-5/+5
| | | | | | | | | | | | | | | | This is switches all the interfaces points (and most of the commenst / local variables I saw on my way through) regarding the NestedMacroInstantiations bit. The libclang enums corresponding to this state were renamed, but a legacy enum was added with the old name, and the same value to keep existing clients working. I've added a documentation blurb for it, but let me know if there is a canonical way to document legacy elemenst of the libclang interface. No functionality changed here, even in tests. llvm-svn: 135141
* Update all of the libclang code corresponding to the preprocessorChandler Carruth2011-07-142-10/+10
| | | | | | | | | | | | | | MacroInstantiation -> MacroExpansion rename. Internally, everything is switched. Introduce a new cursor kind enum with the new name, but retain the old name as an alias so that we don't break backwards compatibility. Also update the debug printing routine to use 'macro expansions' as its explicitly not guaranteed to be stable, and mechanically switch the test cases over to that. llvm-svn: 135140
* Move the rest of the preprocessor terminology from 'instantiate' andChandler Carruth2011-07-143-16/+16
| | | | | | | | | | | | | variants to 'expand'. This changed a couple of public APIs, including one public type "MacroInstantiation" which is now "MacroExpansion". The rest of the codebase was updated to reflect this, especially the libclang code. Two of the C++ (and thus easily changed) libclang APIs were updated as well because they pertained directly to the old MacroInstantiation class. No functionality changed. llvm-svn: 135139
* Fix CMake.Argyrios Kyrtzidis2011-07-111-1/+0
| | | | llvm-svn: 134918
* [arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' ↵Argyrios Kyrtzidis2011-07-113-24/+24
| | | | | | prefix to 'clang_'. llvm-svn: 134916
* [libclang] Fix linker error in buildbots.Argyrios Kyrtzidis2011-07-092-1/+3
| | | | llvm-svn: 134847
* [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.Argyrios Kyrtzidis2011-07-095-2/+111
| | | | | | | | | | | | | | | | | | | | This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844
* Introduce a new libclang aPI function,Douglas Gregor2011-07-073-0/+194
| | | | | | | | | clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! llvm-svn: 134615
* libclang: Allow callers of clang_saveTranslationUnit() to distinguishDouglas Gregor2011-07-061-2/+2
| | | | | | | between different classes of errors. Addresses most of <rdar://problem/9660328>. llvm-svn: 134495
* Improve the Python bindings for libclang in a few ways, from EliDouglas Gregor2011-07-063-0/+6
| | | | | | | | | | | | | | | | | Bendersky. Specifically: * Implemented a new function in libclang: clang_isAttribute * Fixing TranslationUnit.get_includes to only go through the argument * buffer when it contains something. This fixed a crash on Windows * clang_getFileName returns CXString, not char*. Made appropriate * fixes in cindex.py - now the relevant tests pass and we can see the * full locations correctly again (previously there was garbage in * place of the file name) * Exposed clang_getCursorDisplayName to the python bindings llvm-svn: 134460
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-301-0/+5
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* [libclang] Introduce cxcursor::getCursorParentDecl(CXCursor Cursor) and use ↵Argyrios Kyrtzidis2011-06-293-1/+6
| | | | | | | | it at the appropriate place in CIndex.cpp No functionality change. llvm-svn: 134104
* Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no ↵Argyrios Kyrtzidis2011-06-291-2/+1
| | | | | | functionality change. llvm-svn: 134103
* [libclang] Avoid having the cursor of an expression replace the declaration ↵Argyrios Kyrtzidis2011-06-271-3/+27
| | | | | | | | | | | | | | | cursor when the expression source range overlaps the declaration range. This can happen for C++ constructor expressions whose range generally include the variable declaration, e.g.: MyCXXClass foo; // Make sure pointing at 'foo' returns a VarDecl cursor. rdar://9124499. llvm-svn: 133930
* [libclang] Avoid having the cursor of an expression "overwrite" the ↵Argyrios Kyrtzidis2011-06-271-0/+18
| | | | | | | | | | | | | | | annotation of the variable declaration that it belongs to. This can happen for C++ constructor expressions whose range generally include the variable declaration, e.g.: MyCXXClass foo; // Make sure we don't annotate 'foo' as a CallExpr cursor. rdar://9124499. llvm-svn: 133929
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* Remove more unnecessary dependencies now that the Frontend -> ARCMigrateChandler Carruth2011-06-182-4/+1
| | | | | | edge has been broken. llvm-svn: 133343
* Remove ARCMigrate from more builds that it isn't needed in now that theChandler Carruth2011-06-162-2/+1
| | | | | | layering problem has been addressed. llvm-svn: 133217
* ARCMigrate depends on libAnalysis, and on unhelpful linkers must appearJohn McCall2011-06-162-1/+2
| | | | | | before it on the link line. llvm-svn: 133145
* Grr. Of course libARCMigrate depends on libRewrite. This is a lot to beJohn McCall2011-06-162-2/+3
| | | | | | linking unnecessarily into libclang. llvm-svn: 133129
* libFrontend depends on ARCMigrate, so link it into libclang.John McCall2011-06-162-1/+3
| | | | llvm-svn: 133116
* Automatic Reference Counting.John McCall2011-06-153-3/+14
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Add support for builtin astype:Tanya Lattner2011-06-041-0/+1
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
* Expose @synthesize and @dynamic via their own cursor kinds inDouglas Gregor2011-06-031-1/+5
| | | | | | libclang. Fixes <rdar://problem/9537904>. llvm-svn: 132603
* Objective-C doesn't consider the use of incomplete types as methodDouglas Gregor2011-05-271-3/+4
| | | | | | | | | | | | | | parameter types to be ill-formed. However, it relies on the completeness of method parameter types when producing metadata, e.g., for a protocol, leading IR generating to crash in such cases. Since there's no real way to tighten down the semantics of Objective-C here without breaking existing code, do something safe but lame: suppress the generation of metadata when this happens. Fixes <rdar://problem/9123036>. llvm-svn: 132171
* A StringRef-ication of the DiagnosticIDs API and internals.Argyrios Kyrtzidis2011-05-251-1/+2
| | | | | | | | | Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static diagnostic data structures, which resulted in a huge global-var-init function. Depends on llvm commit r132046. llvm-svn: 132047
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-0/+8
| | | | | | | | type that turns one type into another. This is used as the basis to implement __underlying_type properly - with TypeSourceInfo and proper behavior in the face of templates. llvm-svn: 132017
* Do some safety checks.Argyrios Kyrtzidis2011-05-171-11/+5
| | | | llvm-svn: 131491
* Add clang_CXXMethod_isVirtual() to libclang, from Erik Verbruggen!Douglas Gregor2011-05-123-0/+15
| | | | llvm-svn: 131230
* Modify some deleted function methods to better reflect reality:Alexis Hunt2011-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | - New isDefined() function checks for deletedness - isThisDeclarationADefinition checks for deletedness - New doesThisDeclarationHaveABody() does what isThisDeclarationADefinition() used to do - The IsDeleted bit is not propagated across redeclarations - isDeleted() now checks the canoncial declaration - New isDeletedAsWritten() does what it says on the tin. - isUserProvided() now correct (thanks Richard!) This fixes the bug that we weren't catching void foo() = delete; void foo() {} as being a redefinition. llvm-svn: 131013
* Introduce a new libclang parsing flag,Douglas Gregor2011-05-061-2/+8
| | | | | | | | | | | | | CXTranslationUnit_NestedMacroInstantiations, which indicates whether we want to see "nested" macro instantiations (e.g., those that occur inside other macro instantiations) within the detailed preprocessing record. Many clients (e.g., those that only care about visible tokens) don't care about this information, and in code that uses preprocessor metaprogramming, this information can have a very high cost. Addresses <rdar://problem/9389320>. llvm-svn: 130990
* Implement support for C++0x alias templates.Richard Smith2011-05-051-0/+1
| | | | llvm-svn: 130953
* When the environment variable LIBCLANG_RESOURCE_USAGE is set, teachDouglas Gregor2011-05-053-5/+24
| | | | | | | libclang to emit information about resource usage after parsing, code completion, etc. llvm-svn: 130946
* Enhance clang_getCXTUResourceUsage() to return the amount of memory used by ↵Ted Kremenek2011-05-041-2/+22
| | | | | | the Preprocessor's bump allocator as well as those from the PreprocessingRecord. llvm-svn: 130823
* Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),Douglas Gregor2011-05-043-0/+13
| | | | | | | | which determines whether a particular file is actually a header that is intended to be guarded from multiple inclusions within the same translation unit. llvm-svn: 130808
* Use the canonical decl when generating the locations for USRs.Ted Kremenek2011-05-031-0/+3
| | | | llvm-svn: 130748
* Based on the new information in the AST provided by r130628, writeChandler Carruth2011-05-011-4/+1
| | | | | | | | | | | 3 lines of code and improve a bunch of information in the libclang view of the code. Updates the two tests that exercise this with the new data, checking that each new source location actually points back to the declared template parameter. llvm-svn: 130656
* Guard in USRGenerator::GenLoc() against null Decl* from invalid code.Ted Kremenek2011-04-291-0/+6
| | | | llvm-svn: 130541
* Enhance clang_getCXTUResourceUsage() to report the sizes of the memory ↵Ted Kremenek2011-04-281-1/+20
| | | | | | buffers used by PCH. llvm-svn: 130460
* Enhance clang_getCXTUResourceUsage() to report how much memory is used by ↵Ted Kremenek2011-04-281-1/+17
| | | | | | SourceManager's memory buffers. llvm-svn: 130433
* Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ↵Ted Kremenek2011-04-281-2/+9
| | | | | | ASTContext's side tables. llvm-svn: 130383
* Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ↵Ted Kremenek2011-04-281-2/+11
| | | | | | SourceManager's content cache allocator. llvm-svn: 130380
* Parsing/AST support for Structured Exception HandlingJohn Wiegley2011-04-281-0/+3
| | | | | | | | Patch authored by Sohail Somani. Provide parsing and AST support for Windows structured exception handling. llvm-svn: 130366
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-282-0/+7
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-262-0/+2
| | | | | | | | | | | bound member function, i.e. something of the form 'x.f' where 'f' is a non-static member function. Diagnose this in the general case. Some of the new diagnostics are probably worse than the old ones, but we now get this right much more universally, and there's certainly room for improvement in the diagnostics. llvm-svn: 130239
* t/clang/expr-traitsJohn Wiegley2011-04-252-0/+6
| | | | | | | | | Patch authored by David Abrahams. These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for parsing code that employs certain features of the Embarcadero C++ compiler. llvm-svn: 130122
* Teach libclang to be more careful around BlockDecls, and don't assumeDouglas Gregor2011-04-221-2/+3
| | | | | | | that a TypeSourceInfo is always available, like we do everywhere else in libclang. Fixes <rdar://problem/9311140>. llvm-svn: 130034
* Add -fdelayed-template-parsing option. Using this option all templated ↵Francois Pichet2011-04-221-1/+1
| | | | | | | | | function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup. Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
* When translating a Clang source range into a libclang source range,Douglas Gregor2011-04-201-1/+1
| | | | | | | | adjust the a ending macro location to the end of the instantiation location before adjusting it to the end of the token. Fixes <rdar://problem/9021561>. llvm-svn: 129872
* Rename 'CXTUMemoryUsage…' to 'CXTUResourceUsage…'.Ted Kremenek2011-04-203-23/+23
| | | | llvm-svn: 129857
OpenPOWER on IntegriCloud