summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Constify some more ASTContext& uses.Craig Topper2013-08-221-1/+1
| | | | llvm-svn: 188989
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-191-0/+61
| | | | llvm-svn: 186647
* PR12086, PR15117Richard Smith2013-06-121-0/+4
| | | | | | | | | | | | | | | | | | | Introduce CXXStdInitializerListExpr node, representing the implicit construction of a std::initializer_list<T> object from its underlying array. The AST representation of such an expression goes from an InitListExpr with a flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr). This more detailed representation has several advantages, the most important of which is that the new MaterializeTemporaryExpr allows us to directly model lifetime extension of the underlying temporary array. Using that, this patch *drastically* simplifies the IR generation of this construct, provides IR generation support for nested global initializer_list objects, fixes several bugs where the destructors for the underlying array would accidentally not get invoked, and provides constant expression evaluation support for std::initializer_list objects. llvm-svn: 183872
* Fix printing CXXTemporaryObjectExpr with default args.Rafael Espindola2013-05-241-0/+2
| | | | | | Patch by Will Wilson. llvm-svn: 182651
* First pass of semantic analysis for init-captures: check the initializer, buildRichard Smith2013-05-161-0/+7
| | | | | | | | | | | | | a FieldDecl from it, and propagate both into the closure type and the LambdaExpr. You can't do much useful with them yet -- you can't use them within the body of the lambda, because we don't have a representation for "the this of the lambda, not the this of the enclosing context". We also don't have support or a representation for a nested capture of an init-capture yet, which was intended to work despite not being allowed by the current standard wording. llvm-svn: 181985
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* Fix spurious trailing comma when printing some of the __c11_atomic_* ↵Richard Smith2013-05-011-5/+6
| | | | | | builtins. Patch by Joe Sprowes! llvm-svn: 180867
* C++1y: Allow aggregates to have default initializers.Richard Smith2013-04-201-1/+5
| | | | | | | | | | | Add a CXXDefaultInitExpr, analogous to CXXDefaultArgExpr, and use it both in CXXCtorInitializers and in InitListExprs to represent a default initializer. There's an additional complication here: because the default initializer can refer to the initialized object via its 'this' pointer, we need to make sure that 'this' points to the right thing within the evaluation. llvm-svn: 179958
* Sema for Captured StatementsTareq A. Siraj2013-04-161-1/+1
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Implement CapturedStmt ASTTareq A. Siraj2013-04-161-0/+4
| | | | | | | | | | | | | | | CapturedStmt can be used to implement generic function outlining as described in http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html. CapturedStmt is not exposed to the C api. Serialization and template support are pending. Author: Wei Pan <wei.pan@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D370 llvm-svn: 179615
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+12
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Implement compiler intrinsics needed for compatibility with MSVC 2012 ↵Joao Matos2013-03-271-0/+3
| | | | | | | | <type_traits>. Patch by me and Ryan Molden. llvm-svn: 178111
* Streamify getNameForDiagnostic and remove the string versions of ↵Benjamin Kramer2013-02-221-33/+15
| | | | | | PrintTemplateArgumentList. llvm-svn: 175894
* StmtPrinter: Directly print types to the stream instead of taking a detour ↵Benjamin Kramer2013-02-221-51/+68
| | | | | | through getAsString. llvm-svn: 175891
* StmtPrinter: Write large char values using \u or \U.Jordan Rose2013-02-081-8/+9
| | | | | | | | | This may not always be valid, but we were previously just emitting them raw. While here, s/isprint/isPrintable/ (using the new CharInfo). llvm-svn: 174766
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-201-1/+1
| | | | | | which is wrong here. llvm-svn: 170721
* Implement AST dumper for Decls.Alexander Kornienko2012-12-201-5/+0
| | | | | | | | http://llvm-reviews.chandlerc.com/D52 Patch by Philip Craig! llvm-svn: 170634
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-1/+1
| | | | | | single attribute in the future. llvm-svn: 170500
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-191-0/+6
| | | | | | | | | | | | copy-list-initialization (and doesn't add an additional copy step): Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it when instantiating initializers in order to correctly handle instantiation of copy-list-initialization. Teach TreeTransform that function arguments are initializations, and so need this special treatment too. Finally, remove some hacks which were working around SubstInitializer's shortcomings. llvm-svn: 170489
* Testing C declarations embedded inFariborz Jahanian2012-12-041-0/+1
| | | | | | | | <declaration> tag of Comment XML and fixed a missing block literal printout as result of the testing. // rdar://12378714 llvm-svn: 169307
* Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't ↵Benjamin Kramer2012-12-011-2/+3
| | | | | | | | | pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. llvm-svn: 169092
* 80 cols & unnecessary braces from r167736.David Blaikie2012-11-121-3/+3
| | | | | | Post-commit review feedback by Eli Friedman. llvm-svn: 167739
* Correct printing of nested anonymous type member accesses.David Blaikie2012-11-121-1/+9
| | | | | | Patch by Florent Bruneau! llvm-svn: 167736
* Fix pretty-printing pseudo-destructor calls. Patch by Grzegorz Jablonski.Eli Friedman2012-10-231-0/+1
| | | | llvm-svn: 166500
* Use the type as written when pretty-printing C-style casts. Patch by ↵Eli Friedman2012-10-181-1/+1
| | | | | | Grzegorz Jablonski. llvm-svn: 166237
* Fix AST pretty-printing for C++ new expressions with placement arguments ↵Eli Friedman2012-10-181-1/+3
| | | | | | | | with default values. Based on patch by Grzegorz Jablonski. llvm-svn: 166226
* Fix pretty-printing for variables declared in a condition. Patch by ↵Eli Friedman2012-10-161-6/+15
| | | | | | Grzegorz Jablonski. llvm-svn: 166073
* Fix -ast-print for uses of operator->.Eli Friedman2012-10-121-0/+2
| | | | | | Patch by Grzegorz Jablonski. llvm-svn: 165832
* Add the Microsoft __is_interface_class type trait.John McCall2012-09-251-0/+1
| | | | | | Patch by Andy Gibbs! llvm-svn: 164591
* StmtPrinter: Print floating point literals with the right suffix to ↵Benjamin Kramer2012-09-201-2/+27
| | | | | | | | disambiguate them from integers. Based on a patch by Olaf Krzikalla, UDL fixes by me. llvm-svn: 164303
* PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith2012-09-121-0/+4
| | | | | | | parameter packs where the reference is not being expanded but the pack has been. Previously, Clang would segfault in such cases. llvm-svn: 163672
* Revert r163083 per chandlerc's request.Joao Matos2012-09-041-6/+1
| | | | llvm-svn: 163149
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-021-1/+6
| | | | | | Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review. llvm-svn: 163083
* [ms-inline asm] Rename getClobber to getClobberStringLiteral. No functionalChad Rosier2012-08-271-1/+1
| | | | | | change intended. llvm-svn: 162710
* [ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.Chad Rosier2012-08-251-1/+1
| | | | | | No functional change intended. llvm-svn: 162632
* Store SourceManager pointer on PrintingPolicy in the case where we're dumping,Richard Smith2012-08-161-13/+10
| | | | | | | | | and remove ASTContext reference (which was frequently bound to a dereferenced null pointer) from the recursive lump of printPretty functions. In so doing, fix (at least) one case where we intended to use the 'dump' mode, but that failed because a null ASTContext reference had been passed in. llvm-svn: 162011
* Don't constant-fold when pretty-printing alignment attribute. This fixes aRichard Smith2012-08-161-1/+1
| | | | | | potential crasher -- Context is sometimes a null reference (!!) here. llvm-svn: 162007
* [ms-inline asm] Add the left brace source location and improve the prettyChad Rosier2012-08-151-1/+6
| | | | | | printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>. llvm-svn: 161958
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-3/+3
| | | | llvm-svn: 159925
* Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer2012-07-041-0/+1
| | | | llvm-svn: 159723
* Add support for the C11 _Alignof keyword.Jordan Rose2012-06-301-1/+6
| | | | | | | This behaves like the existing GNU __alignof and C++11 alignof keywords; most of the patch is simply adding the third token spelling to various places. llvm-svn: 159494
* Support L__FUNCTION__ in microsoft mode, PR11789Nico Weber2012-06-231-0/+3
| | | | | | | | | | Heavily based on a patch from Aaron Wishnick <aaron.s.wishnick@gmail.com>. I'll clean up the duplicated function in CodeGen as a follow-up, later today or tomorrow. llvm-svn: 159060
* Moved the StringLiteral printing code from StmtPrinter into the StringLiteralRichard Trieu2012-06-131-87/+1
| | | | | | | class and have StmtPrinter and StmtDumper refer to it. This fixes an assertion failure when dumping wchar string literals. llvm-svn: 158417
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-0/+5
| | | | llvm-svn: 158325
* Plug a long standing memory leak in TemplateArgument.Benjamin Kramer2012-06-071-1/+1
| | | | | | | | | | | | | | | The integral APSInt value is now stored in a decomposed form and the backing store for large values is allocated via the ASTContext. This way its not leaked as TemplateArguments are never destructed when they are allocated in the ASTContext. Since the integral data is immutable it is now shared between instances, making copying TemplateArguments a trivial operation. Currently getting the integral data out of a TemplateArgument requires creating a new APSInt object. This is cheap when the value is small but can be expensive if it's not. If this turns out to be an issue a more efficient accessor could be added. llvm-svn: 158150
* move some stuff to .rodataNuno Lopes2012-04-211-1/+1
| | | | llvm-svn: 155282
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-2/+2
| | | | llvm-svn: 155082
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-0/+17
| | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! llvm-svn: 154723
* Implement support for 18 of the GNU-compatible __atomic builtins.Richard Smith2012-04-121-36/+18
| | | | | | | | | | | | This is not quite sufficient for libstdc++'s <atomic>: we still need __atomic_test_and_set and __atomic_clear, and may need a more complete __atomic_is_lock_free implementation. We are also missing an implementation of __atomic_always_lock_free, __atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed for libstdc++. llvm-svn: 154579
* Provide, and document, a set of __c11_atomic_* intrinsics to implement C11'sRichard Smith2012-04-111-11/+11
| | | | | | | | | <stdatomic.h> header. In passing, fix LanguageExtensions to note that C11 and C++11 are no longer "upcoming standards" but are now actually standardized. llvm-svn: 154513
OpenPOWER on IntegriCloud