- Feb 20, 2012
-
-
Douglas Gregor authored
of that variable; it will need to be recomputed with the resolved type. llvm-svn: 150984
-
Douglas Gregor authored
name mangling in the Itanium C++ ABI for lambda expressions is so dependent on context, we encode the number used to encode each lambda as part of the lambda closure type, and maintain this value within Sema. Note that there are a several pieces still missing: - We still get the linkage of lambda expressions wrong - We aren't properly numbering or mangling lambda expressions that occur in default function arguments or in data member initializers. - We aren't (de-)serializing the lambda numbering tables llvm-svn: 150982
-
Eric Christopher authored
handled by the caching and rauw. Also fix one cache that wasn't being added to highlighted by this patch. Update all testcases accordingly. This should fix the deall failure. llvm-svn: 150977
-
- Feb 19, 2012
-
-
Benjamin Kramer authored
llvm-svn: 150932
-
Sebastian Redl authored
llvm-svn: 150931
-
Sebastian Redl authored
llvm-svn: 150930
-
Sebastian Redl authored
Get recursive initializer lists to work and add a test. Codegen of std::initializer_list is now complete. Onward to array new. llvm-svn: 150926
-
Sebastian Redl authored
Add a testcase for using objects with list-constructors, and fix a Sema crash by repeating an old hack. llvm-svn: 150925
-
Sebastian Redl authored
llvm-svn: 150924
-
Sebastian Redl authored
llvm-svn: 150923
-
- Feb 18, 2012
-
-
Eric Christopher authored
with full types if they exist. rdar://10809898 and rdar://10209967 and rdar://10400981 llvm-svn: 150858
-
- Feb 17, 2012
-
-
Richard Smith authored
llvm-svn: 150838
-
Sebastian Redl authored
We now generate temporary arrays to back std::initializer_list objects initialized with braces. The initializer_list is then made to point at the array. We support both ptr+size and start+end forms, although the latter is untested. Array lifetime is correct for temporary std::initializer_lists (e.g. call arguments) and local variables. It is untested for new expressions and member initializers. Things left to do: Massively increase the amount of testing. I need to write tests for start+end init lists, temporary objects created as a side effect of initializing init list objects, new expressions, member initialization, creation of temporary objects (e.g. std::vector) for initializer lists, and probably more. Get lifetime "right" for member initializers and new expressions. Not that either are very useful. Implement list-initialization of array new expressions. llvm-svn: 150803
-
Richard Smith authored
variable ends, if the variable has a trivial destructor and no mutable subobjects then emit an llvm.invariant.start call for it. globalopt knows to make the variable const when evaluating this. llvm-svn: 150798
-
Richard Smith authored
as constants. Refactor and simplify all the separate checks for whether a type can be emitted as a constant. llvm-svn: 150793
-
Richard Smith authored
1) It has a const-qualified type, and 2) It has no mutable members, and 3) It has no dynamic initialization, and 4) It has trivial destruction. Remove the unnecessary requirement that the type be POD. This allows us to mark all constexpr objects with no mutable members as 'constant'. llvm-svn: 150792
-
Richard Smith authored
can be represented by an LValue, and use that to simplify the code a little. llvm-svn: 150789
-
Douglas Gregor authored
conversion to function pointer. Rather than having IRgen synthesize the body of this function, we instead introduce a static member function "__invoke" with the same signature as the lambda's operator() in the AST. Sema then generates a body for the conversion to function pointer which simply returns the address of __invoke. This approach makes it easier to evaluate a call to the conversion function as a constant, makes the linkage of the __invoke function follow the normal rules for member functions, and may make life easier down the road if we ever want to constexpr'ify some of lambdas. Note that IR generation is responsible for filling in the body of __invoke (Sema just adds a dummy body), because the body can't generally be expressed in C++. Eli, please review! llvm-svn: 150783
-
Richard Smith authored
zero-initialize class types with virtual bases when constant-evaluating an initializer. llvm-svn: 150770
-
- Feb 16, 2012
-
-
Eric Christopher authored
"Add a completed/incomplete type difference. This allows us to have partial types for contexts and forward decls while allowing us to complete types later on for debug purposes. This piggy-backs on the metadata replacement and rauw changes for temporary nodes and takes advantage of the incremental support I added in earlier. This allows us to, if we decide, to limit adding methods and variables to structures in order to limit the amount of debug information output into a .o file. The caching is a bit complicated though so any thoughts on untangling that are welcome." with a fix: - Remove all RAUW during type construction by adding stub versions of types that we later complete. and some TODOs: - Add an RAUW cache for forward declared types so that we can replace them at the end of compilation. - Remove the code that updates on completed types because we no longer need to have that happen. We emit incomplete types on purpose and only want to know when we want to complete them. llvm-svn: 150752
-
Eli Friedman authored
llvm-svn: 150738
-
Richard Smith authored
restriction and add some tests. llvm-svn: 150721
-
Eric Christopher authored
This reverts commit 9a68d4584afcd0853b930bd80235b58736e785b4. llvm-svn: 150637
-
Eric Christopher authored
partial types for contexts and forward decls while allowing us to complete types later on for debug purposes. This piggy-backs on the metadata replacement and rauw changes for temporary nodes and takes advantage of the incremental support I added in earlier. This allows us to, if we decide, to limit adding methods and variables to structures in order to limit the amount of debug information output into a .o file. The caching is a bit complicated though so any thoughts on untangling that are welcome. llvm-svn: 150631
-
- Feb 15, 2012
-
-
John McCall authored
is general goodness because representations of member pointers are not always equivalent across member pointer types on all ABIs (even though this isn't really standard-endorsed). Take advantage of the new information to teach IR-generation how to do these reinterprets in constant initializers. Make sure this works when intermingled with hierarchy conversions (although this is not part of our motivating use case). Doing this in the constant-evaluator would probably have been better, but that would require a *lot* of extra structure in the representation of constant member pointers: you'd really have to track an arbitrary chain of hierarchy conversions and reinterpretations in order to get this right. Ultimately, this seems less complex. I also wasn't quite sure how to extend the constant evaluator to handle foldings that we don't actually want to treat as extended constant expressions. llvm-svn: 150551
-
- Feb 14, 2012
-
-
Richard Smith authored
used to construct an object of union type with a deleted default constructor (plus fixes for some related value-initialization corner cases). llvm-svn: 150502
-
Eli Friedman authored
llvm-svn: 150458
-
- Feb 13, 2012
-
-
Richard Smith authored
constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. llvm-svn: 150419
-
Eric Christopher authored
PR11970. llvm-svn: 150389
-
Eric Christopher authored
while reworking how we handle wanting to emit only parts of structures. Fixes PR11970. llvm-svn: 150388
-
- Feb 09, 2012
-
-
Eric Christopher authored
difference in the qual type. This is a workaround for the fact that the type isn't artificial but the this decl is, however, we don't have any way of representing it in the current metadata. For now, however, just don't cache the full type. Fixes rdar://10831526 and probably a couple of others. llvm-svn: 150159
-
- Feb 08, 2012
-
-
Eric Christopher authored
llvm-svn: 150026
-
Eric Christopher authored
caching of results after we create them. Fixes rdar://10809898 llvm-svn: 150025
-
- Feb 06, 2012
-
-
Craig Topper authored
llvm-svn: 149862
-
Richard Smith authored
llvm-svn: 149854
-
- Feb 04, 2012
-
-
Devang Patel authored
llvm-svn: 149726
-
- Feb 03, 2012
-
-
Douglas Gregor authored
size. Otherwise, we can end up with bogus layouts. llvm-svn: 149703
-
Douglas Gregor authored
template without a corresponding parameter pack, don't immediately substitute the alias template. This is under discussion in the C++ committee, and may become ill-formed, but for now we match GCC. llvm-svn: 149697
-
- Feb 02, 2012
-
-
Rafael Espindola authored
llvm-svn: 149559
-
- Feb 01, 2012
-
-
Eric Christopher authored
instead of the entire class definition. llvm-svn: 149474
-