summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* ForArgyrios Kyrtzidis2011-04-221-3/+11
| | | | | | | | double data[20000000] = { [19999999] = 1 }; Don't serialize the filler multiple times. llvm-svn: 129983
* ForArgyrios Kyrtzidis2011-04-211-1/+6
| | | | | | | | | | | | | | double data[20000000] = {0}; we would blow out the memory by creating 20M Exprs to fill out the initializer. To fix this, if the initializer list initializes an array with more elements than there are initializers in the list, have InitListExpr store a single 'ArrayFiller' expression that specifies an expression to be used for value initialization of the rest of the elements. Fixes rdar://9275920. llvm-svn: 129896
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-0/+18
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Add support for C++0x's range-based for loops, as specified by the C++11 ↵Richard Smith2011-04-141-0/+17
| | | | | | draft standard (N3291). llvm-svn: 129541
* Add a flag to StringLiteral to keep track of whether the string is a pascal ↵Anders Carlsson2011-04-141-0/+1
| | | | | | string or not. llvm-svn: 129488
* Renamed OffsetOfNode::getRange to getSourceRange for uniformity.Abramo Bagnara2011-03-121-2/+2
| | | | llvm-svn: 127534
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-3/+3
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* When serializing a DeclRefExpr, always store the number of explicit templateAnders Carlsson2011-03-061-4/+6
| | | | | | | | arguments at the same offset, since it's needed when creating the empty DeclRefExpr when deserializing. Fixes a memory corruption issue that would lead to random bugs and crashes. llvm-svn: 127125
* Push nested-name-specifier location information into DeclRefExpr andDouglas Gregor2011-02-281-8/+4
| | | | | | MemberExpr, the last of the expressions with qualifiers! llvm-svn: 126688
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-281-2/+1
| | | | | | | | | | | | | UnresolvedLookupExpr and UnresolvedMemberExpr. Also, improve the computation that checks whether the base of a member expression (either unresolved or dependent-scoped) is implicit. The previous check didn't cover all of the cases we use in our representation, which threw off source-location information for these expressions (which, in turn, caused some breakage in libclang's token annotation). llvm-svn: 126681
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-281-2/+1
| | | | | | | | CXXDependentScopeMemberExpr, and clean up instantiation of nested-name-specifiers with dependent template specialization types in the process. llvm-svn: 126663
* Push nested-name-specifier source location information intoDouglas Gregor2011-02-251-2/+1
| | | | | | | DependentScopeDeclRefExpr. Plus, give NestedNameSpecifierLoc == and != operators, since we're going to need 'em elsewhere. llvm-svn: 126508
* Push nested-name-specifier source-location information intoDouglas Gregor2011-02-251-2/+1
| | | | | | | | pseudo-destructor expressions. Also, clean up some template-instantiation and type-checking issues with pseudo-destructors. llvm-svn: 126498
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-1/+21
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-171-18/+3
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* AST, Sema, Serialization: add CUDAKernelCallExpr and related semantic actionsPeter Collingbourne2011-02-091-0/+13
| | | | llvm-svn: 125217
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-1/+0
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Implement proper (de-)serialization for explicit template argumentDouglas Gregor2011-02-041-27/+17
| | | | | | | lists with zero template arguments. Fixes some seriously scary crashers in C++ PCH. llvm-svn: 124862
* An insomniac stab at making block declarations list the variables they closeJohn McCall2011-02-021-1/+0
| | | | | | | on, as well as more reliably limiting invalid references to locals from nested scopes. llvm-svn: 124721
* Give OpaqueValueExpr a source location, because its source locationDouglas Gregor2011-01-281-0/+1
| | | | | | | | might be queried in places where we absolutely require a valid location (e.g., for template instantiation). Fixes some major brokenness in the use of __is_convertible_to. llvm-svn: 124465
* Do a proper recursive lookup when deciding whether a class's usualJohn McCall2011-01-271-0/+2
| | | | | | | | | deallocation function has a two-argument form. Store the result of this check in new[] and delete[] nodes. Fixes rdar://problem/8913519 llvm-svn: 124373
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-151-0/+12
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Teach PackExpansionExpr to keep track of the number of pack expansionsDouglas Gregor2011-01-141-0/+1
| | | | | | it will expand to, if known. Propagate this information throughout Sema. llvm-svn: 123470
* Add the location of the right parenthesis of a C++ named castDouglas Gregor2011-01-121-1/+2
| | | | | | | (static_cast, dynamic_cast, reinterpret_cast, or const_cast) to improve source-location information. Fixes PR8960. llvm-svn: 123336
* Implement the sizeof...(pack) expression to compute the length of aDouglas Gregor2011-01-041-0/+11
| | | | | | | | | parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-1/+8
| | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. llvm-svn: 122751
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | and TemplateArgument with an operation that determines whether there are any unexpanded parameter packs within that construct. Use this information to diagnose the appearance of the names of parameter packs that have not been expanded (C++ [temp.variadic]p5). Since this property is checked often (every declaration, ever expression statement, etc.), we extend Type and Expr with a bit storing the result of this computation, rather than walking the AST each time to determine whether any unexpanded parameter packs occur. This commit is deficient in several ways, which will be remedied with future commits: - Expr has a bit to store the presence of an unexpanded parameter pack, but it is never set. - The error messages don't point out where the unexpanded parameter packs were named in the type/expression, but they should. - We don't check for unexpanded parameter packs in all of the places where we should. - Testing is sparse, pending the resolution of the above three issues. llvm-svn: 121724
* Keep the source location of the selector in ObjCMessageExpr.Argyrios Kyrtzidis2010-12-101-0/+1
| | | | llvm-svn: 121516
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-11/+1
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+11
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-3/+3
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-23/+17
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-201-1/+1
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
* Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:Argyrios Kyrtzidis2010-11-191-0/+1
| | | | | | | | | if (condition) CALL(0); // empty macro but don't warn for empty body. Fixes rdar://8436021. llvm-svn: 119838
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-2/+4
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+8
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Switch case IDs conflict between chained PCHs; since there is no need to be ↵Argyrios Kyrtzidis2010-10-281-0/+4
| | | | | | global, make them local to a decl. llvm-svn: 117540
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-251-1/+3
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClassFariborz Jahanian2010-10-151-1/+0
| | | | | | AST node. (finishing off radar 8525788). llvm-svn: 116603
* Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and ↵Argyrios Kyrtzidis2010-10-151-11/+6
| | | | | | QualifierInfos (rdar://8513756). llvm-svn: 116598
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-8/+9
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Don't warn for an unused label if it has 'unused' attribute. Fixes ↵Argyrios Kyrtzidis2010-09-281-0/+1
| | | | | | rdar://8483139. llvm-svn: 114954
* Implement -Wunused-label.Argyrios Kyrtzidis2010-09-191-0/+1
| | | | llvm-svn: 114315
* Eagerly evaluate type traits in Sema instead of lazily in AST. They actually ↵Sebastian Redl2010-09-131-0/+1
| | | | | | need Sema access to be correct, fixes coming up. llvm-svn: 113782
* When applying 'delete' on a pointer-to-array type match GCC and EDG behavior ↵Argyrios Kyrtzidis2010-09-131-0/+1
| | | | | | | | and treat it as 'delete[]'. Also offer a fix-it hint adding '[]'. llvm-svn: 113778
* Serialization support for CXXNoexceptExpr.Sebastian Redl2010-09-101-0/+9
| | | | llvm-svn: 113627
* Add proper type-source information to UnaryTypeTraitExpr, includingDouglas Gregor2010-09-091-1/+1
| | | | | | libclang visitation. llvm-svn: 113492
* When building SwitchStmts in Sema, record whether all the enum values of a ↵Ted Kremenek2010-09-091-0/+1
| | | | | | | | | | switch(enum) where covered by individual case statements. Flow-based analyses may wish to consult this information, and recording this in the AST allows us to obviate reconstructing this information later when we build the CFG. llvm-svn: 113447
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-0/+13
| | | | llvm-svn: 113356
OpenPOWER on IntegriCloud