summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Pretty Printer: Fix printing of conversion operator decls and calls.Benjamin Kramer2014-02-251-0/+6
| | | | | | | | | | | | | - Don't emit anything when we encounter a call to a conversion operator. "bar(a & b)" instead of "bar(a & b.operator int())" This preserves the semantics and is still idempotent if we print the AST multiple times. - Properly print declarations of conversion operators. "explicit operator bool();" instead of "bool operator _Bool();" PR18776. llvm-svn: 202167
* [OPENMP] 'if' clause support (no CodeGen support)Alexey Bataev2014-02-131-2/+10
| | | | llvm-svn: 201297
* Fixes PR18762, stop the StmtPrinter for ObjCPropertyRefExpr from crashing onRichard Trieu2014-02-061-1/+3
| | | | | | certain receiver types. llvm-svn: 200953
* 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
* Fixed a FIXME; created a print method for Selectors that accepts a ↵Aaron Ballman2014-01-031-2/+4
| | | | | | | | raw_ostream, and started using it in places it made sense. No functional changes intended, just API cleanliness. llvm-svn: 198428
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-011-15/+2
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. llvm-svn: 198271
* Remove an unused parameter and include after r197273Alp Toker2013-12-131-1/+0
| | | | llvm-svn: 197274
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-131-17/+3
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. llvm-svn: 197273
* Unify type trait parsingAlp Toker2013-12-121-54/+9
| | | | | | | | | | | | | | | | | Type trait parsing is all over the place at the moment with unary, binary and n-ary C++11 type traits that were developed independently at different points in clang's history. There's no good reason to handle them separately -- there are three parsers, three AST nodes and lots of duplicated handling code with slightly different implementations and diags for each kind. This commit unifies parsing of type traits and sets the stage for further consolidation. No change in behaviour other than more consistent error recovery. llvm-svn: 197179
* Add new PrintingPolicy entry to trim number of newlines. Useful for the CFG ↵Ted Kremenek2013-12-111-7/+14
| | | | | | | | | printer. The change isn't completely comprehensive. This can be filled in lazily as needed. There is one consumer right now. llvm-svn: 197093
* Fix code typos spotted while working on type traitsAlp Toker2013-12-061-2/+2
| | | | llvm-svn: 196587
* [-fms-extensions] Add support for __FUNCDNAME__David Majnemer2013-11-061-0/+3
| | | | | | | | | | | | | | | | 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
* [-fms-extensions] Permit 'override' in C++98 and 'sealed' as a synonym for ↵David Majnemer2013-10-181-0/+1
| | | | | | | | | | | | | | 'final' Summary: Some MS headers use these features. Reviewers: rnk, rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1948 llvm-svn: 192936
* [OpenMP] Added parsing and semantic analysis for firstprivate clauseAlexey Bataev2013-10-011-0/+8
| | | | llvm-svn: 191730
* Per latest drafting, switch to implementing init-captures as if by declaringRichard Smith2013-09-281-10/+4
| | | | | | and capturing a variable declaration, and complete the implementation of them. llvm-svn: 191605
* AST: Handle qualified array types in typeid() expressionsDavid Majnemer2013-09-271-2/+2
| | | | | | | | | | | | The intent of getTypeOperand() was to yield an unqualified type. However QualType::getUnqualifiedType() does not strip away qualifiers on arrays. N.B. This worked fine when typeid() was applied to an expression because we would inject as implicit cast to the unqualified array type in the AST. llvm-svn: 191487
* [OPENMP] Bug fixes and improvements.Alexey Bataev2013-09-241-8/+12
| | | | | | | | 1. Fixed constructor of shared clause. 2. Some macros for clauses processing are replaced by private template methods. 3. Additional checks in sema analysis of OpenMP clauses. llvm-svn: 191265
* Add the intrinsic __builtin_convertvectorHal Finkel2013-09-181-0/+8
| | | | | | | | | | | | | | | | | | LLVM supports applying conversion instructions to vectors of the same number of elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to cause such instructions to be generated when using builtin vector types. C-style casting on vectors is already defined in terms of bitcasts, and so cannot be used for these conversions as well (without leading to a very confusing set of semantics). As a result, this adds a __builtin_convertvector intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is intended to aid the creation of vector intrinsic headers that create generic IR instead of target-dependent intrinsics (in other words, this is a generic _mm_cvtepi32_ps). As noted in the documentation, the action of __builtin_convertvector is defined in terms of the action of a C-style cast on each vector element. llvm-svn: 190915
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-061-0/+8
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"Rafael Espindola2013-09-031-8/+0
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-031-0/+8
| | | | llvm-svn: 189795
* 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
OpenPOWER on IntegriCloud