summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Switch to APFloat constructor taking fltSemantics.Tim Northover2013-01-221-1/+2
| | | | | | | | This change also makes the serialisation store the required semantics, fixing an issue where PPC128 was always assumed when re-reading a 128-bit value. llvm-svn: 173139
* Move the common source locations of CastStmt & DefaultStmt into their base ↵Argyrios Kyrtzidis2013-01-041-4/+2
| | | | | | class, SwitchCase. llvm-svn: 171483
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-191-0/+1
| | | | | | | | | | | | 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
* Allow to pass from syntactic form of InitListExpr to semantic form (just as ↵Abramo Bagnara2012-11-081-0/+2
| | | | | | viceversa). No functionality change. llvm-svn: 167591
* PR13552: Fix the end location of a CXXNewExpr.David Blaikie2012-11-071-1/+1
| | | | | | | | | Spent longer than reasonable looking for a nice way to test this & decided to give up for now. Open to suggestions/requests. Richard Smith suggested adding something to ASTMatchers but it wasn't readily apparent how to test this with that. llvm-svn: 167507
* DR1442: In a range-based for statement, namespace 'std' is not an associatedRichard Smith2012-10-181-2/+0
| | | | | | namespace. llvm-svn: 166194
* Add FP_CONTRACT support for clang.Lang Hames2012-10-021-0/+2
| | | | | | | | Clang will now honor the FP_CONTRACT pragma and emit LLVM fmuladd intrinsics for expressions of the form A * B + C (when they occur in a single statement). llvm-svn: 164989
* PR13811: Add a FunctionParmPackExpr node to handle references to functionRichard Smith2012-09-121-0/+11
| | | | | | | 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/+0
| | | | llvm-svn: 163149
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-021-0/+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-2/+2
| | | | | | No functional change intended. llvm-svn: 162632
* [ms-inline asm] Update the AST Reader/Writer for MS-style inline asms.Chad Rosier2012-08-241-0/+2
| | | | llvm-svn: 162629
* [ms-inline asm] Remove old cruft now that MS-style asms their own code path.Chad Rosier2012-08-201-1/+0
| | | | llvm-svn: 162210
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-0/+1
| | | | llvm-svn: 159925
* Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer2012-07-041-0/+1
| | | | llvm-svn: 159723
* Etch out the code path for MS-style inline assembly.Chad Rosier2012-06-111-0/+5
| | | | llvm-svn: 158325
* [libclang/AST] Index references of protocols in "@protocol(...)" syntax.Argyrios Kyrtzidis2012-05-161-0/+1
| | | | | | | | | To do that, keep track of the location of the protocol id in the ObjCProtocolExpr AST node. rdar://11190837 llvm-svn: 156890
* Store the source range of a CXXOperatorCallExpr in the Expr object instead ofArgyrios Kyrtzidis2012-04-301-0/+1
| | | | | | | | | | | | | | | calculating it recursively. boost::assign::tuple_list_of uses the trick of chaining call operator expressions in order to declare a "list of tuples", e.g: std::vector<tuple> v = boost::assign::tuple_list_of(1, "foo")(2, "bar")(3, "qqq"); Due to CXXOperatorCallExpr calculating its source range recursively we would get significant slowdowns with a large number of chained call operator expressions and the potential for stack overflow. rdar://11350116 llvm-svn: 155848
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-5/+5
| | | | llvm-svn: 155082
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-141-0/+8
| | | | | | | | | 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
* AtomicExpr: make ASTStmtReader a friend and remove setters. Also fix savingRichard Smith2012-04-101-8/+2
| | | | | | | of an uninitialized Stmt* in serialization of __atomic_init and add a test of atomics serialization. llvm-svn: 154448
* Add info to ObjCPropertyRefExpr to indicate whether the dot syntax propertyArgyrios Kyrtzidis2012-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | reference is going to message the setter, the getter, or both. Having this info on the ObjCPropertyRefExpr node makes it easier for AST clients (like libclang) to reason about the meaning of the property reference. [AST/Sema] -Use 2 bits (with a PointerIntPair) in ObjCPropertyRefExpr to record the above info -Have ObjCPropertyOpBuilder set the info appropriately. [libclang] -When there is an implicit property reference (property syntax using methods) have clang_getCursorReferenced return a cursor for the method. If the property reference is going to result in messaging both the getter and the setter choose to return a cursor for the setter because it is less obvious from source inspection that the setter is getting called. The general idea has the seal of approval by John. rdar://11151621 llvm-svn: 153709
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-9/+1
| | | | | | | | 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
* AST representation for user-defined literals, plus just enough of semanticRichard Smith2012-03-071-0/+6
| | | | | | | | | | | | | | | | | | | | | 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-2/+58
| | | | | | | | | | | | | 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
* ASTWriter: Cache some DenseMaps we use repeatedly.Daniel Dunbar2012-02-291-5/+4
| | | | | | | | - This reduces our total # of allocations building a PCH for Cocoa.h by almost a whopping 50%. - A SmallPtrMap would be cleaner, but since we don't have one yet... llvm-svn: 151697
* Serialize InitListExpr's initializesStdInitializerList bit, so it's not left ↵Benjamin Kramer2012-02-271-0/+1
| | | | | | | | uninitialized. Found by valgrind. llvm-svn: 151527
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-241-0/+10
| | | | | | | | | | | | | | | | 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
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-161-9/+4
| | | | | | | | 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-4/+9
| | | | | | | | | | 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-9/+4
| | | | | | | | | | 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
* Implement AST (de-)serialization for lambda expressions.Douglas Gregor2012-02-141-1/+28
| | | | llvm-svn: 150491
* Introduce basic ASTs for lambda expressions. This covers:Douglas Gregor2012-02-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | - Capturing variables by-reference and by-copy within a lambda - The representation of lambda captures - The creation of the non-static data members in the lambda class that store the captured variables - The initialization of the non-static data members from the captured variables - Pretty-printing lambda expressions There are a number of FIXMEs, both explicit and implied, including: - Creating a field for a capture of 'this' - Improved diagnostics for initialization failures when capturing variables by copy - Dealing with temporaries created during said initialization - Template instantiation - AST (de-)serialization - Binding and returning the lambda expression; turning it into a proper temporary - Lots and lots of semantic constraints - Parameter pack captures llvm-svn: 149977
* Added source location for the template keyword in AST template-id expressions.Abramo Bagnara2012-01-271-30/+34
| | | | llvm-svn: 149127
* Add IsImplicit field in ObjCMessageExpr that is true when the messageArgyrios Kyrtzidis2012-01-121-0/+1
| | | | | | | | | | was constructed, e.g. for a property access. This allows the selector identifier locations machinery for ObjCMessageExpr to function correctly, in that there are not real locations to handle/report for such a message. llvm-svn: 148013
* [PCH] Make sure that the SourceExpr of a OpaqueValueExpr is always initializedArgyrios Kyrtzidis2011-12-031-9/+1
| | | | | | | | | | when deserialized, fixing random crashes in libclang. Also simplifies how OpaqueValueExprs are [de]serialized. The reader/writer automatically retains pointer equality of sub-statements (when a statement node is referenced in multiple nodes), so no need to manually handle it. llvm-svn: 145752
* [PCH] When serializing an PseudoObjectExpr or AtomicExpr, the serialization ↵Argyrios Kyrtzidis2011-11-151-0/+4
| | | | | | | | code must be set otherwise it will crash with asserts on or it will be written as null pointer. llvm-svn: 144626
* There's no good reason to track temporaries in ExprWithCleanups,John McCall2011-11-101-3/+3
| | | | | | | but it is sometimes useful to track blocks. Do so. Also optimize the storage of these expressions. llvm-svn: 144263
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Fix the representation of wide strings in the AST and IR so that it uses the ↵Eli Friedman2011-11-011-1/+1
| | | | | | | | | | native representation of integers for the elements. This fixes a bunch of nastiness involving treating wide strings as a series of bytes. Patch by Seth Cantrell. llvm-svn: 143417
* Implement support for dependent Microsoft __if_exists/__if_not_existsDouglas Gregor2011-10-251-0/+10
| | | | | | | | | | statements. As noted in the documentation for the AST node, the semantics of __if_exists/__if_not_exists are somewhat different from the way Visual C++ implements them, because our parsed-template representation can't accommodate VC++ semantics without serious contortions. Hopefully this implementation is "good enough". llvm-svn: 142901
* [PCH] When serializing Stmts, keep track of when sub statements are ↵Argyrios Kyrtzidis2011-10-211-3/+42
| | | | | | | | | | | | referenced again and in such a case just write out a reference of a previously serialized Stmt, instead of serializing it all over again. This saves memory + space + [de]serializing time, and avoids blowing up memory with pathological cases. rdar://10293911 llvm-svn: 142696
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+15
| | | | llvm-svn: 141632
* Added a flag to identify resolved overloaded function references.Abramo Bagnara2011-10-051-1/+6
| | | | llvm-svn: 141171
* Allow getting all source locations of selector identifiers in a ObjCMessageExpr.Argyrios Kyrtzidis2011-10-031-1/+7
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: [foo first:1 second:2] -With a space between the arguments: [foo first: 1 second: 2] -For nullary selectors, immediately before ']': [foo release] In such cases we infer the locations instead of storing them. llvm-svn: 140987
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-1/+1
| | | | llvm-svn: 140367
* Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no ↵Argyrios Kyrtzidis2011-09-221-5/+5
| | | | | | functionality change. llvm-svn: 140330
* Don't try keeping a 'LeadingEmptyMacroLoc' in NullStmt. This failsArgyrios Kyrtzidis2011-09-011-1/+1
| | | | | | in the face of buffering C++/ObjC method bodies. llvm-svn: 138972
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-2/+2
| | | | llvm-svn: 136210
OpenPOWER on IntegriCloud