summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix null pointer segfault when calling dump() on a DeclStmt containing a ↵Alex McCarthy2014-05-021-0/+3
| | | | | | VarDecl. llvm-svn: 207867
* Add support for MSVC's __FUNCSIG__Reid Kleckner2014-04-081-0/+1
| | | | | | | | | | | It is very similar to GCC's __PRETTY_FUNCTION__, except it prints the calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D3311 llvm-svn: 205780
* Add the location of Decls to ast dump.David Blaikie2014-04-021-0/+2
| | | | | | | | | While investigating some debug info issues, Eric and I came across a particular template case where the location of a decl was quite different from the range of the same decl. It might've been rather helpful if the dumper had actually showed us this. llvm-svn: 205396
* Consistently dump default template arguments for template parameters as ↵Richard Smith2014-03-231-5/+11
| | | | | | 'TemplateArgument's. llvm-svn: 204572
* Comment parsing: fix a crash when dumping comment ast for a function templateDmitri Gribenko2014-03-191-1/+1
| | | | | | | | with variadic parameters Patch by Joe Ranieri. llvm-svn: 204236
* More working around a GCC range-based for scope bug.Richard Smith2014-03-181-4/+4
| | | | llvm-svn: 204108
* AST dumper: if we have multiple implicit instantiations of the same classRichard Smith2014-03-181-16/+48
| | | | | | | template specialization (from different modules), dump them all, so that every declaration is dumped somewhere. llvm-svn: 204100
* Fix variable shadowing. Due to a bug in GCC's implementation of range-based forRichard Smith2014-03-181-2/+2
| | | | | | loops, it was making this an error, resulting in buildbot failures. llvm-svn: 204097
* Factor out repeated code in dumping template declarations.Richard Smith2014-03-171-40/+18
| | | | llvm-svn: 204090
* Range-ify and simplify some of the AST dumping code by factoring out the ↵Richard Smith2014-03-171-81/+75
| | | | | | lastChild check. llvm-svn: 204086
* [C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with ↵Aaron Ballman2014-03-141-8/+7
| | | | | | iterator_range captures(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203958
* [C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with ↵Aaron Ballman2014-03-131-7/+5
| | | | | | iterator_range bases(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203803
* [C++11] Replacing Decl iterators attr_begin() and attr_end() with ↵Aaron Ballman2014-03-081-1/+1
| | | | | | | | iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops. This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage. llvm-svn: 203362
* [C++11] Replacing BlockDecl iterators param_begin() and param_end() with ↵Aaron Ballman2014-03-071-3/+2
| | | | | | iterator_range params(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203250
* Fully reverting r203236 -- it seems the only bots that are happy are the ↵Aaron Ballman2014-03-071-1/+1
| | | | | | MSVC bots. llvm-svn: 203237
* [C++11] Replacing iterators attr_begin() and attr_end() with iterator_range ↵Aaron Ballman2014-03-071-1/+1
| | | | | | attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203236
* Change the color of comment nodes from bright yellow to blue. Bright yellow onRichard Trieu2014-03-061-1/+12
| | | | | | | a white background is difficult to read. Also include a chart showing which colors are used by which elements in the AST dump. llvm-svn: 203050
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-251-1/+1
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Distinguish between attributes explicitly written at the request of the ↵Aaron Ballman2014-01-161-0/+3
| | | | | | | | user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute. Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it. llvm-svn: 199378
* Only mark dump() function definitions 'used' in debug buildsAlp Toker2014-01-041-16/+12
| | | | | | | | | | | | | | | | This has the dual effect of (1) enabling more dead-stripping in release builds and (2) ensuring that debug helper functions aren't stripped away in debug builds, as they're intended to be called from the debugger. Note that the attribute is applied to definitions rather than declarations in headers going forward because it's now conditional on NDEBUG: /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. Requires corresponding macro added in LLVM r198456. llvm-svn: 198489
* [objc] Refactor and improve functionality for the -Wunused-property-ivar ↵Argyrios Kyrtzidis2014-01-031-2/+0
| | | | | | | | | | | | | | warning. - Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor - Don't check immediately after the method body is finished, check when the @implementation is finished. This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor. - Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self. rdar://15727325 llvm-svn: 198432
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-031-7/+10
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. llvm-svn: 198428
* [-fms-extensions] Add support for __FUNCDNAME__David Majnemer2013-11-061-0/+1
| | | | | | | | | | | | | | | | Summary: Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled function name via __FUNCDNAME__. This implementation is very naive and unoptimized, it is expected that __FUNCDNAME__ would be used rarely in practice. Reviewers: rnk, rsmith, thakis CC: cfe-commits, silvas Differential Revision: http://llvm-reviews.chandlerc.com/D2109 llvm-svn: 194181
* ObjectiveC: under -Wunused-property-ivar warn if property'sFariborz Jahanian2013-10-251-0/+2
| | | | | | | backing warning is not used in one of its accessor methods. // rdar://14989999 llvm-svn: 193439
* Teach AST dumper to dump the containing module and hidden flag for declarations.Richard Smith2013-10-221-0/+7
| | | | llvm-svn: 193210
* Fix 80-column violation.Richard Smith2013-10-181-1/+2
| | | | llvm-svn: 192937
* Rename some functions for consistency.Rafael Espindola2013-10-171-1/+1
| | | | | | Every other function in Redeclarable.h was using Decl instead of Declaration. llvm-svn: 192900
* Teach the AST dumper to dump the canonical declaration for a mergeable ↵Richard Smith2013-10-151-9/+16
| | | | | | declaration. llvm-svn: 192739
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-09-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the following features are not included in this commit: - any sort of capturing within generic lambdas - generic lambdas within template functions and nested within other generic lambdas - conversion operator for captureless lambdas - ensuring all visitors are generic lambda aware (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit) As an example of what compiles through this commit: template <class F1, class F2> struct overload : F1, F2 { using F1::operator(); using F2::operator(); overload(F1 f1, F2 f2) : F1(f1), F2(f2) { } }; auto Recursive = [](auto Self, auto h, auto ... rest) { return 1 + Self(Self, rest...); }; auto Base = [](auto Self, auto h) { return 1; }; overload<decltype(Base), decltype(Recursive)> O(Base, Recursive); int num_params = O(O, 5, 3, "abc", 3.14, 'a'); Please see attached tests for more examples. This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics). Some implementation notes: - Add a new Declarator context => LambdaExprParameterContext to clang::Declarator to allow the use of 'auto' in declaring generic lambda parameters - Add various helpers to CXXRecordDecl to facilitate identifying and querying a closure class - LambdaScopeInfo (which maintains the current lambda's Sema state) was augmented to house the current depth of the template being parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth) so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately generate a template-parameter-type when 'auto' is parsed in a generic lambda parameter context. (i.e we do NOT use AutoType deduced to a template parameter type - Richard seemed ok with this approach). We encode that this template type was generated from an auto by simply adding $auto to the name which can be used for better diagnostics if needed. - SemaLambda.h was added to hold some common lambda utility functions (this file is likely to grow ...) - Teach Sema::ActOnStartOfFunctionDef to check whether it is being called to instantiate a generic lambda's call operator, and if so, push an appropriately prepared LambdaScopeInfo object on the stack. - various tests were added - but much more will be needed. There is obviously more work to be done, and both Richard (weakly) and Doug (strongly) have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData in a future patch which is forthcoming. A greatful thanks to all reviewers including Eli Friedman, James Dennett, and especially the two gracious wizards (Richard Smith and Doug Gregor) who spent hours providing feedback (in person in Chicago and on the mailing lists). And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified! Thanks! llvm-svn: 191453
* -ast-dump support for variable templates.Richard Smith2013-09-181-0/+48
| | | | llvm-svn: 190911
* ASTDumper: fix dump of CXXCatchStmtPavel Labath2013-09-041-0/+6
| | | | | | | | | | Summary: I added the display of the VarDecl contained in the statement. CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1596 llvm-svn: 189941
* Mention in AST dump whether a class declaration is a definition.Richard Smith2013-08-301-0/+2
| | | | llvm-svn: 189647
* Show which decls are marked invalid in -ast-dump.Nick Lewycky2013-08-271-0/+3
| | | | llvm-svn: 189306
* Use SmallVectorImpl instead of SmallVector for iterators and references to ↵Craig Topper2013-07-041-2/+2
| | | | | | avoid specifying the vector size unnecessarily. llvm-svn: 185610
* Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test toRichard Smith2013-06-241-3/+5
| | | | | | follow. llvm-svn: 184678
* Add dumping support for DeclContext's StoredDeclsMap.Richard Smith2013-06-221-0/+59
| | | | llvm-svn: 184648
* Model temporary lifetime-extension explicitly in the AST. Use this model toRichard Smith2013-06-051-0/+10
| | | | | | | | | handle temporaries which have been lifetime-extended to static storage duration within constant expressions. This correctly handles nested lifetime extension (through reference members of aggregates in aggregate initializers) but non-constant-expression emission hasn't yet been updated to do the same. llvm-svn: 183283
* Fix bitcode desynchronization when loading a PCH containing a class templateRichard Smith2013-05-231-3/+14
| | | | | | | | | | | specialization with modules enabled. Just don't merge them at all for now; we'll revisit this when support for template merging is added. In passing, make Decl::dump() a little safer to use with PCH/modules, by making it not deserialize any additional declarations. From a debugger you can call decls_begin() or similar first if you want to dump all child decls. llvm-svn: 182544
* In -ast-dump, only dump comments when dumping the actual Decl to which theyRichard Smith2013-05-211-4/+5
| | | | | | | | attach, rather than merging all comments on the declaration chain. This gives a more faithful dump, and has the side benefit of unbreaking uses of dump() from within AST deserialization (where the redeclaration chain may not be sane). llvm-svn: 182350
* AST dumping: if a declaration has an uncomputed or uninstantiated exception ↵Richard Smith2013-05-171-0/+13
| | | | | | specification, include that in the dump. llvm-svn: 182070
* Use only explicit bool conversion operatorDavid Blaikie2013-05-151-1/+1
| | | | | | | | | | | | | | | | | | | The most common (non-buggy) case are where such objects are used as return expressions in bool-returning functions or as boolean function arguments. In those cases I've used (& added if necessary) a named function to provide the equivalent (or sometimes negative, depending on convenient wording) test. DiagnosticBuilder kept its implicit conversion operator owing to the prevalent use of it in return statements. One bug was found in ExprConstant.cpp involving a comparison of two PointerUnions (PointerUnion did not previously have an operator==, so instead both operands were converted to bool & then compared). A test is included in test/SemaCXX/constant-expression-cxx1y.cpp for the fix (adding operator== to PointerUnion in LLVM). llvm-svn: 181869
* Provide operator<< for stream output of DeclarationNamesDavid Blaikie2013-05-141-3/+1
| | | | | | | | | | | ASTDumper was already trying to do this & instead got an implicit bool conversion by surprise (thus printing out 0 or 1 instead of the name of the declaration). To avoid that issue & simplify call sites, simply make it the normal/expected operator<<(raw_ostream&, ...) overload & simplify all the existing call sites. (bonus: this function doesn't need to be a member or friend, it's just using public API in DeclarationName) llvm-svn: 181832
* Annotate flavor of TLS variable (statically or dynamically initialized) onto ↵Richard Smith2013-04-131-2/+5
| | | | | | the AST. llvm-svn: 179447
* Add 178663 back.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-2/+2
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* AST dumping: dump template instantiations only onceDmitri Gribenko2013-02-211-2/+8
| | | | | | | | Fixes infinite loop in PR15220. Patch by Philip Craig. llvm-svn: 175805
* Remove const_casts by making spec_begin()/spec_end() constDmitri Gribenko2013-02-141-7/+5
| | | | llvm-svn: 175159
* AST dumping: indicate the previous declaration for a redeclaration, andRichard Smith2013-02-071-1/+27
| | | | | | | indicate the semantic DC if it's not the lexical DC. In passing, correct the ascii-art child marker for a child of a FriendDecl. llvm-svn: 174570
* Use const visitors in ASTDumper.Alexander Kornienko2013-02-011-225/+242
| | | | | | | http://llvm-reviews.chandlerc.com/D355 Patch by Philip Craig! llvm-svn: 174171
OpenPOWER on IntegriCloud