summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDumper.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Reverting r321223 and its follow-up commit because of failing bots due to ↵Aaron Ballman2017-12-201-28/+16
| | | | | | Misc/ast-dump-color.cpp. llvm-svn: 321229
* Silence a -Wreorder warning from r321223.Aaron Ballman2017-12-201-2/+2
| | | | llvm-svn: 321228
* Add a printing policy to the ASTDumper.Aaron Ballman2017-12-201-16/+28
| | | | | | This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms. llvm-svn: 321223
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-191-1/+1
| | | | llvm-svn: 321115
* Refactor overridden methods iteration to avoid double lookups.Benjamin Kramer2017-12-171-4/+3
| | | | | | Convert most uses to range-for loops. No functionality change intended. llvm-svn: 320954
* Extend -ast-dump for CXXRecordDecl to dump the flags from the DefinitionData.Richard Smith2017-09-221-0/+122
| | | | llvm-svn: 313943
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-061-0/+10
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. llvm-svn: 312638
* Fix mangling for dependent "type { expr-list }" expressions, and add ↵Richard Smith2017-08-231-0/+13
| | | | | | mangling for designated initializers matching recent cxx-abi-dev discussion. llvm-svn: 311612
* Improve readability of CXX method overrides listLenar Safin2017-07-291-2/+5
| | | | | | | | | | | | | | | Summary: Separate CXX method overrides list entries with commas. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35800 llvm-svn: 309496
* Use getNameAsString instead of getName to get method names when dumpingLang Hames2017-07-131-6/+2
| | | | | | | | overrides: getName can fail if the decl's name isn't a simple identifier. This is a more general replacement for the fix in r305860. llvm-svn: 307959
* Special-case handling of destructors in override lists when dumping ASTs.Lang Hames2017-06-201-3/+6
| | | | | | | Fixes a bug in r305850: CXXDestructors don't have names, so we need to handle printing of them separately. llvm-svn: 305860
* Preserve CXX method overrides in ASTImporterLang Hames2017-06-201-0/+22
| | | | | | | | | | | | | | Summary: The ASTImporter should import CXX method overrides from the source context when it imports a method decl. Reviewers: spyffe, rsmith, doug.gregor Reviewed By: spyffe Differential Revision: https://reviews.llvm.org/D34371 llvm-svn: 305850
* [modules] When creating a declaration, cache its owning module immediatelyRichard Smith2017-05-171-3/+3
| | | | | | | | | | | | | | | rather than waiting until it's queried. Currently this is only applied to local submodule visibility mode, as we don't yet allocate storage for the owning module in non-local-visibility modules compilations. This reinstates r302965, reverted in r303037, with a fix for the reported crash, which occurred when reparenting a local declaration to be a child of a hidden imported declaration (specifically during template instantiation). llvm-svn: 303224
* Revert r302965 - [modules] When creating a declaration, cache its owningDaniel Jasper2017-05-151-3/+3
| | | | | | | | | module immediately Also revert dependent r302969. This is leading to crashes. Will provide more details reproduction instructions to Richard. llvm-svn: 303037
* [modules] When creating a declaration, cache its owning module immediatelyRichard Smith2017-05-121-3/+3
| | | | | | | | | | rather than waiting until it's queried. Currently this is only applied to local submodule visibility mode, as we don't yet allocate storage for the owning module in non-local-visibility modules compilations. llvm-svn: 302965
* Add -cc1 flag -ast-dump-all to perform an AST dump including entities that ↵Richard Smith2017-03-091-18/+27
| | | | | | haven't yet been deserialized. llvm-svn: 297412
* Add template parameter depth and index to -ast-dump output.Richard Smith2017-02-211-0/+3
| | | | llvm-svn: 295689
* Add two new AST nodes to represent initialization of an array in terms ofRichard Smith2016-12-121-0/+10
| | | | | | | | | | | | | | | | | | | | initialization of each array element: * ArrayInitLoopExpr is a prvalue of array type with two subexpressions: a common expression (an OpaqueValueExpr) that represents the up-front computation of the source of the initialization, and a subexpression representing a per-element initializer * ArrayInitIndexExpr is a prvalue of type size_t representing the current position in the loop This will be used to replace the creation of explicit index variables in lambda capture of arrays and copy/move construction of classes with array elements, and also C++17 structured bindings of arrays by value (which inexplicably allow copying an array by value, unlike all of C++'s other array declarations). No uses of these nodes are introduced by this change, however. llvm-svn: 289413
* Store decls in prototypes on the declarator instead of in the ASTReid Kleckner2016-12-091-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This saves two pointers from FunctionDecl that were being used for some rare and questionable C-only functionality. The DeclsInPrototypeScope ArrayRef was added in r151712 in order to parse this kind of C code: enum e {x, y}; int f(enum {y, x} n) { return x; // should return 1, not 0 } The challenge is that we parse 'int f(enum {y, x} n)' it its own function prototype scope that gets popped before we build the FunctionDecl for 'f'. The original change was doing two questionable things: 1. Saving all tag decls introduced in prototype scope on a TU-global Sema variable. This is problematic when you have cases like this, where 'x' and 'y' shouldn't be visible in 'f': void f(void (*fp)(enum { x, y } e)) { /* no x */ } This patch fixes that, so now 'f' can't see 'x', which is consistent with GCC. 2. Storing the decls in FunctionDecl in ActOnFunctionDeclarator so that they could be used in ActOnStartOfFunctionDef. This is just an inefficient way to move information around. The AST lives forever, but the list of non-parameter decls in prototype scope is short lived. Moving these things to the Declarator solves both of these issues. Reviewers: rsmith Subscribers: jmolloy, cfe-commits Differential Revision: https://reviews.llvm.org/D27279 llvm-svn: 289225
* Indicate in AST dump whether special member functions are defaulted and trivial.Richard Smith2016-11-211-1/+8
| | | | llvm-svn: 287599
* [AST] Dump dependent scope member expression with its member nameAlex Lorenz2016-11-091-0/+7
| | | | llvm-svn: 286365
* Teach clang-query to dump types. I couldn't find any existing tests for ↵Richard Smith2016-11-021-3/+9
| | | | | | clang-query's dumping functionality. =( llvm-svn: 285869
* P0217R3: Perform semantic checks and initialization for the bindings in aRichard Smith2016-08-111-0/+8
| | | | | | | decomposition declaration for arrays, aggregate-like structs, tuple-like types, and (as an extension) for complex and vector types. llvm-svn: 278435
* 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
OpenPOWER on IntegriCloud