summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* P0217R3: Parsing support and framework for AST representation of C++1zRichard Smith2016-07-221-0/+7
| | | | | | | | | | | decomposition declarations. There are a couple of things in the wording that seem strange here: decomposition declarations are permitted at namespace scope (which we partially support here) and they are permitted as the declaration in a template (which we reject). llvm-svn: 276492
* P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:Richard Smith2016-06-281-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace inheriting constructors implementation with new approach, voted into C++ last year as a DR against C++11. Instead of synthesizing a set of derived class constructors for each inherited base class constructor, we make the constructors of the base class visible to constructor lookup in the derived class, using the normal rules for using-declarations. For constructors, UsingShadowDecl now has a ConstructorUsingShadowDecl derived class that tracks the requisite additional information. We create shadow constructors (not found by name lookup) in the derived class to model the actual initialization, and have a new expression node, CXXInheritedCtorInitExpr, to model the initialization of a base class from such a constructor. (This initialization is special because it performs real perfect forwarding of arguments.) In cases where argument forwarding is not possible (for inalloca calls, variadic calls, and calls with callee parameter cleanup), the shadow inheriting constructor is not emitted and instead we directly emit the initialization code into the caller of the inherited constructor. Note that this new model is not perfectly compatible with the old model in some corner cases. In particular: * if B inherits a private constructor from A, and C uses that constructor to construct a B, then we previously required that A befriends B and B befriends C, but the new rules require A to befriend C directly, and * if a derived class has its own constructors (and so its implicit default constructor is suppressed), it may still inherit a default constructor from a base class llvm-svn: 274049
* Implement C++17 P0386R2, inline variables. (The 'inline' specifier gives aRichard Smith2016-06-251-0/+4
| | | | | | | variable weak discardable linkage and partially-ordered initialization, and is implied for constexpr static data members.) llvm-svn: 273754
* Use even more ArrayRefsDavid Majnemer2016-06-241-8/+4
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273650
* Use more ArrayRefsDavid Majnemer2016-06-241-1/+1
| | | | | | No functional change is intended, just a small refactoring. llvm-svn: 273647
* Fix a crash in the AST dumper.Richard Trieu2016-06-091-2/+4
| | | | | | | Boxed expressions in a template context may have a null method decl. If so, don't try to access the selector. llvm-svn: 272318
* [OpenCL] Fix pipe type dump.Xiuli Pan2016-05-031-0/+3
| | | | | | | | | | | | | | Summary: Fix the dump of PipeType. Now we will have "pipe int" and element type. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits, bader Differential Revision: http://reviews.llvm.org/D19524 llvm-svn: 268364
* [OPENMP] Support dumping OpenMP specific constructs.Alexey Bataev2016-03-311-0/+75
| | | | | | | Add proper dumping support for OpenMP declarations, directives and clauses. llvm-svn: 265004
* Serialize `#pragma detect_mismatch`.Nico Weber2016-03-021-0/+7
| | | | | | | This is like r262493, but for pragma detect_mismatch instead of pragma comment. The two pragmas have similar behavior, so use the same approach for both. llvm-svn: 262506
* Serialize `#pragma comment`.Nico Weber2016-03-021-0/+16
| | | | | | | | | | | | | | `#pragma comment` was handled by Sema calling a function on ASTConsumer, and CodeGen then implementing this function and writing things to its output. Instead, introduce a PragmaCommentDecl AST node and hang one off the TranslationUnitDecl for every `#pragma comment` line, and then use the regular serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's eagerly deserialized.) http://reviews.llvm.org/D17799 llvm-svn: 262493
* Infrastructure improvements to Clang attribute TableGen.John McCall2016-03-011-2/+0
| | | | | | This should make it easier to add new Attr subclasses. llvm-svn: 262275
* Move LocInfoType from Sema to AST.Benjamin Kramer2016-02-011-1/+1
| | | | | | | While transient and only used during parsing, LocInfoTypes are still used from ASTDumper and are part of the AST. llvm-svn: 259376
* Class Property: parse property attribute (class).Manman Ren2016-01-261-0/+2
| | | | | | | | | This is the third patch in a series of patches to support class properties in addition to instance properties in objective-c. rdar://23891898 llvm-svn: 258834
* Improve AST dumping:Richard Smith2016-01-121-0/+4
| | | | | | | | 1) When dumping a declaration that declares a name for a type, also dump the named type. 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in the current context. llvm-svn: 257529
* Avoid crash when dumping LocInfoType.Serge Pavlov2015-12-281-0/+10
| | | | | | | | | LocInfoType is a helper type used internally inside Sema and Parser, it does not exist in valid AST. LocInfoType uses code value outside the range of valid Type codes, as a result, dumping such type causes error. The fix allows correct dumping LocInfoType. llvm-svn: 256503
* Fix crash in ASTDumper when dumping NamedDecl with NULL getQualifier().Dawn Perchik2015-12-051-3/+6
| | | | | | | | Reviewed by: aaron.ballman Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15254 llvm-svn: 254867
* [Sema] Implement __make_integer_seqDavid Majnemer2015-11-041-0/+7
| | | | | | | | | | | | | | | | | | This new builtin template allows for incredibly fast instantiations of templates like std::integer_sequence. Performance numbers follow: My work station has 64 GB of ram + 20 Xeon Cores at 2.8 GHz. __make_integer_seq<std::integer_sequence, int, 90000> takes 0.25 seconds. std::make_integer_sequence<int, 90000> takes unbound time, it is still running. Clang is consuming gigabytes of memory. Differential Revision: http://reviews.llvm.org/D13786 llvm-svn: 252036
* PR14858: Initial support for proper sizeof... handling within alias templates.Richard Smith2015-09-231-0/+3
| | | | | | | This doesn't quite get alias template equivalence right yet, but handles the egregious cases where we would silently give the wrong answers. llvm-svn: 248431
* Implement variance for Objective-C type parameters.Douglas Gregor2015-07-071-0/+13
| | | | | | | | | | | | | | | Introduce co- and contra-variance for Objective-C type parameters, which allows us to express that (for example) an NSArray is covariant in its type parameter. This means that NSArray<NSMutableString *> * is a subtype of NSArray<NSString *> *, which is expected of the immutable Foundation collections. Type parameters can be annotated with __covariant or __contravariant to make them co- or contra-variant, respectively. This feature can be detected by __has_feature(objc_generics_variance). Implements rdar://problem/20217490. llvm-svn: 241549
* Parsing, semantic analysis, and AST for Objective-C type parameters.Douglas Gregor2015-07-071-0/+25
| | | | | | | | | | | | | | | | | | | | Produce type parameter declarations for Objective-C type parameters, and attach lists of type parameters to Objective-C classes, categories, forward declarations, and extensions as appropriate. Perform semantic analysis of type bounds for type parameters, both in isolation and across classes/categories/extensions to ensure consistency. Also handle (de-)serialization of Objective-C type parameter lists, along with sundry other things one must do to add a new declaration to Clang. Note that Objective-C type parameters are typedef name declarations, like typedefs and C++11 type aliases, in support of type erasure. Part of rdar://problem/6294649. llvm-svn: 241541
* Switch users of the 'for (StmtRange range = stmt->children(); range; ↵Benjamin Kramer2015-07-021-2/+2
| | | | | | | | | ++range)‘ pattern to range for loops. The pattern was born out of the lack of range-based for loops in C++98 and is somewhat obscure. No functionality change intended. llvm-svn: 241300
* [OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for ↵Alexey Bataev2015-07-021-0/+3
| | | | | | | | | default simd alignment. Adds type trait "__builtin_omp_required_simd_align" after discussions here http://reviews.llvm.org/D9894 Differential Revision: http://reviews.llvm.org/D10597 llvm-svn: 241237
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* [modules] Include merged definition information in AST dumps.Richard Smith2015-06-221-0/+4
| | | | llvm-svn: 240313
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* [modules] Add local submodule visibility support for declarations.Richard Smith2015-05-151-1/+3
| | | | | | | | | | | | With this change, enabling -fmodules-local-submodule-visibility results in name visibility rules being applied to submodules of the current module in addition to imported modules (that is, names no longer "leak" between submodules of the same top-level module). This also makes it much safer to textually include a non-modular library into a module: each submodule that textually includes that library will get its own "copy" of that library, and so the library becomes visible no matter which including submodule you import. llvm-svn: 237473
* Add a dump function to Stmt that takes only an output stream. No ↵Faisal Vali2015-03-221-0/+5
| | | | | | | | | | functionality change. This allows dumping to any given output stream but without requiring a SourceManager, similar to the interface provided by Decl. It's useful when writing certain generic debug functions, external to the clang code base (for e.g.). llvm-svn: 232912
* Fix -ast-dump of dependent new and delete exprsReid Kleckner2015-03-191-8/+12
| | | | llvm-svn: 232748
* Add -ast-dump support for new and delete expressions to help figure out ↵Reid Kleckner2015-03-191-0/+24
| | | | | | which operator got selected llvm-svn: 232740
* Enhance printing SizeOfPackExpr in dump.Serge Pavlov2015-02-161-0/+8
| | | | llvm-svn: 229428
* [modules] Sometimes we can deserialize a class member but not have yetRichard Smith2015-01-241-4/+7
| | | | | | | | | | | encountered any definition for the class; this happens when the definition is added by an update record that is not yet loaded. In such a case, eagerly pick the original parent of the member as the canonical definition of the class rather than muddling through with the canonical declaration (the latter can lead to us failing to merge properly later if the canonical definition turns out to be some other declaration). llvm-svn: 226977
* 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
OpenPOWER on IntegriCloud