summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Fix assertions and wrong output from StmtPrinter's string literal printing.Richard Smith2012-04-051-5/+46
| | | | | | | | | | String literals (including unicode ones) can contain non-Unicode codepoints if they were written using \x or similar. Write those out using \x, but be careful that the following character can't be misinterpreted as part of the \x escape sequence. Convert UTF-16 surrogate pairs back to codepoints before rendering them. llvm-svn: 154069
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-4/+0
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Fix statement printing for raw and template user-defined literals.Richard Smith2012-03-091-6/+9
| | | | llvm-svn: 152401
* Ensure we don't print 123ULL_foo when printing a user-defined integer literal.Richard Smith2012-03-081-1/+6
| | | | llvm-svn: 152303
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+25
| | | | | | | | | | | | | | | | | | | | | analysis to make the AST representation testable. They are represented by a new UserDefinedLiteral AST node, which is a sugared CallExpr. All semantic properties, including full CodeGen support, are achieved for free by this representation. UserDefinedLiterals can never be dependent, so no custom instantiation behavior is required. They are mangled as if they were direct calls to the underlying literal operator. This matches g++'s apparent behavior (but not its actual mangling, which is broken for literal-operator-ids). User-defined *string* literals are now fully-operational, but the semantic analysis is quite hacky and needs more work. No other forms of user-defined literal are created yet, but the AST support for them is present. This patch committed after midnight because we had already hit the quota for new kinds of literal yesterday. llvm-svn: 152211
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-0/+47
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-241-0/+17
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* Provide the __is_trivially_assignable type trait, which providesDouglas Gregor2012-02-231-5/+6
| | | | | | | compiler support for the std::is_trivially_assignable library type trait. llvm-svn: 151240
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-161-11/+7
| | | | | | | | hold the used constructor itself."" This reintroduces commit r150682 with a fix for the Bullet benchmark crash. llvm-svn: 150685
* Revert "Make CXXNewExpr contain only a single initialier, and not hold the ↵Sebastian Redl2012-02-161-7/+11
| | | | | | | | | | used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. llvm-svn: 150684
* Make CXXNewExpr contain only a single initialier, and not hold the used ↵Sebastian Redl2012-02-161-11/+7
| | | | | | | | | | constructor itself. Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities. This breaks the static analysis of new expressions. I've filed PR12014 to track this. llvm-svn: 150682
* Introduce support for template instantiation of lambdaDouglas Gregor2012-02-131-3/+3
| | | | | | | | | | | | | | | | | | expressions. This is mostly a simple refact, splitting the main "start a lambda expression" function into smaller chunks that are driven either from the parser (Sema::ActOnLambdaExpr) or during AST transformation (TreeTransform::TransformLambdaExpr). A few minor interesting points: - Added new entry points for TreeTransform, so that we can explicitly establish the link between the lambda closure type in the template and the lambda closure type in the instantiation. - Added a bit into LambdaExpr specifying whether it had an explicit result type or not. We should have had this anyway. This code is 'lightly' tested. llvm-svn: 150417
* Print NamedDecls directly to a raw_ostream where possible.Benjamin Kramer2012-02-071-2/+2
| | | | llvm-svn: 149982
OpenPOWER on IntegriCloud