summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ASTDumper: print whether a function is constexprHans Wennborg2014-12-051-0/+4
| | | | llvm-svn: 223538
* Make QualType::dump() produce a useful dump of the structure of the type,Richard Smith2014-10-311-5/+247
| | | | | | rather than simply pretty-printing it. llvm-svn: 220942
* ASTDumper.cpp: Appease g++, for now.NAKAMURA Takumi2014-10-311-4/+4
| | | | llvm-svn: 220940
* Refactor tree printing in AST dumping.Richard Smith2014-10-301-541/+345
| | | | | | | | | | | Instead of manually maintaining a flag indicating whether we're about to print out the last child of the parent node (to determine whether we print "`" or "|"), capture a callable to print that child and defer printing it until we either see a next child or finish the parent. No functionality change intended. llvm-svn: 220930
* Fix for bug http://llvm.org/PR17427.Alexey Bataev2014-10-091-9/+1
| | | | | | | | Assertion failed: "Computed __func__ length differs from type!" Reworked PredefinedExpr representation with internal StringLiteral field for function declaration. Differential Revision: http://reviews.llvm.org/D5365 llvm-svn: 219393
* Don't print 'NULL TYPE' when dumping a delegating constructor.Richard Trieu2014-09-121-1/+5
| | | | llvm-svn: 217707
* [modules] When performing a lookup into a namespace, ensure that any laterRichard Smith2014-08-131-1/+1
| | | | | | | | | | redefinitions of that namespace have already been loaded. When writing out the names in a namespace, if we see a name that is locally declared and had imported declarations merged on top of it, export the local declaration as the lookup result, because it will be the most recent declaration of that entity in the redeclaration chain of an importer of the module. llvm-svn: 215518
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-111-5/+23
| | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. llvm-svn: 215393
* Factor out exception specification information fromRichard Smith2014-07-311-3/+3
| | | | | | | | FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care about the other ExtProtoInfo bits and just want to talk about the exception specification. llvm-svn: 214450
* Add AST dumping for VarDecl init kind.Richard Smith2014-07-101-0/+5
| | | | llvm-svn: 212774
* Extend AST dump to include 'used' and 'referenced' flags, and put 'invalid' ↵Richard Smith2014-06-131-3/+6
| | | | | | flag in the right place. llvm-svn: 210872
* Teach AST dumper to dump the array filler in an initializer list.Richard Smith2014-06-031-0/+17
| | | | llvm-svn: 210090
* AST Dump: print the Inherited flag on attributesHans Wennborg2014-05-311-1/+3
| | | | | | | | | Also move the attribute-specific dumping to after dumping this and the Implicit flag. Differential Revision: http://reviews.llvm.org/D3971 llvm-svn: 209965
* Retain isImplicit flag for local variable declarations when instantiatingAlexander Kornienko2014-05-271-0/+2
| | | | | | | | | | | | | | templates. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3924 llvm-svn: 209686
* [C++11] Use 'nullptr'. AST edition.Craig Topper2014-05-121-11/+13
| | | | llvm-svn: 208517
* 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
OpenPOWER on IntegriCloud