summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* CodeGen support for global variables of type std::initializer_list<X>.Sebastian Redl2012-02-253-3/+121
| | | | | | | | | | | | | This emits a backing array with internal linkage and fills it with data, then has the initializer_list point at the array. Dynamic initialization and global destructors are correctly supported. What doesn't work is nested initializer_lists. I have no idea how to get them to work, either. However, these should be very rare, and so I'll just call it a known bug and declare generalized initializers DONE! llvm-svn: 151457
* Fix crashers on unexpected std::initializer_list layouts. Found by inspection.Sebastian Redl2012-02-251-0/+4
| | | | llvm-svn: 151456
* Prevent llvm.lifetime intrinsics from being emitted at -O0.Chad Rosier2012-02-251-1/+5
| | | | | | rdar://10921594 llvm-svn: 151430
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-254-27/+85
| | | | | | implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
* Trying to increase my Ohloh ranking with trivial tweaksDouglas Gregor2012-02-251-6/+2
| | | | llvm-svn: 151414
* Simplify check per Eli's commentDouglas Gregor2012-02-251-4/+1
| | | | llvm-svn: 151412
* Fix a stupid mistake in r151133. Reported to me by Joerg Sonnenberger.Eli Friedman2012-02-241-3/+5
| | | | llvm-svn: 151407
* For the purposes of building LLVM types, a forward-declaredDouglas Gregor2012-02-241-1/+6
| | | | | | | enumeration type with a fixed underlying type is complete. Fixes <rdar://problem/10916155>. llvm-svn: 151403
* Reapply r151172 - Unwind path cleanup for array new list initializers - with aChad Rosier2012-02-241-7/+32
| | | | | | test case that only runs on debug builds. llvm-svn: 151311
* Replace a use of hasTrivialDefaultConstructor() with the appropriateDouglas Gregor2012-02-231-1/+1
| | | | | | isTrivial() call. llvm-svn: 151259
* PR12067: When emitting an evaluated constant structure in C++11 mode, don'tRichard Smith2012-02-231-12/+82
| | | | | | forget the vptrs. llvm-svn: 151245
* Try to handle qualifiers more consistently for array InitListExprs. Fixes ↵Eli Friedman2012-02-231-4/+2
| | | | | | | | <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent. (I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.) llvm-svn: 151229
* Add a quick TODO.Eric Christopher2012-02-231-0/+1
| | | | llvm-svn: 151217
* Fold debug scope emission into the cleanup scope.Eric Christopher2012-02-231-9/+2
| | | | llvm-svn: 151216
* Revert r151172: Unwind path cleanup for array new list initializers.Chad Rosier2012-02-221-32/+7
| | | | llvm-svn: 151203
* Unwind path cleanup for array new list initializers.Sebastian Redl2012-02-221-7/+32
| | | | llvm-svn: 151172
* CodeGen for array new list initializers. Doesn't correctly clean up in the ↵Sebastian Redl2012-02-221-27/+69
| | | | | | face of exceptions yet. llvm-svn: 151171
* Use an ArrayRef when we can instead of passing in a SmallVectorImpl reference.Bill Wendling2012-02-224-35/+33
| | | | llvm-svn: 151150
* Make sure null initialization in arrays works correctly with ARC types. ↵Eli Friedman2012-02-221-2/+7
| | | | | | <rdar://problem/10907547>. llvm-svn: 151133
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-225-1/+9
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Adding support for Microsoft's thiscall calling convention. Clang side of ↵Aaron Ballman2012-02-221-9/+23
| | | | | | the patch. llvm-svn: 151122
* Emit the exact size for the invariant intrinsics.Nick Lewycky2012-02-211-4/+7
| | | | llvm-svn: 151010
* Formatting.Eric Christopher2012-02-201-6/+6
| | | | llvm-svn: 150996
* objc IRGen: force CSE of load of ivar offsets by settingFariborz Jahanian2012-02-201-1/+6
| | | | | | | the 'invariant.load' metadata tag onto those loads. // rdar://10840980 llvm-svn: 150994
* Remove the type retaining from the clang frontend. This is nowEric Christopher2012-02-201-4/+6
| | | | | | | | | | 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
* Make forward declarations for objective-c types use the newEric Christopher2012-02-201-17/+14
| | | | | | | temporary forward declaration nodes. Fixes a problem building Chrome. llvm-svn: 150976
* Add 3dNOW intrinsic header to x86intrin.h, conditioned on __3dNOW__ toChandler Carruth2012-02-201-0/+2
| | | | | | | | | | | | | | | | match the behavior of GCC. Also add a test for these intrinsics, which apparently have *zero* tests. =[ Not surprisingly, Clang crashed when compiling these. Fix the bug in CodeGen where we failed to bitcast the argument type to x86mmx prior to calling the LLVM intrinsic. This fixes an assert on the new 3dnow-builtins.c test. This is one issue impacting the efforts to get Clang to emulate the Microsoft intrinsics headers -- 3dnow intrinsics are implictitly made available there. llvm-svn: 150948
* Make heap-allocation of std::initializer_list 'work'.Sebastian Redl2012-02-195-10/+10
| | | | llvm-svn: 150931
* Make std::initializer_list member initializers 'work'.Sebastian Redl2012-02-191-31/+37
| | | | llvm-svn: 150930
* Refuse to compile global std::initializer_lists instead of doing completely ↵Sebastian Redl2012-02-191-0/+5
| | | | | | the wrong thing. llvm-svn: 150928
* Get recursive initializer lists to work and add a test. Codegen of ↵Sebastian Redl2012-02-192-13/+43
| | | | | | std::initializer_list is now complete. Onward to array new. llvm-svn: 150926
* Remove dead code.Ahmed Charles2012-02-191-6/+2
| | | | llvm-svn: 150919
* Fix wrong-code bug: __imag on a scalar lvalue should produce a zero rvalue,Richard Smith2012-02-182-4/+8
| | | | | | rather than an lvalue referring to the scalar. llvm-svn: 150889
* Fix comment.Chad Rosier2012-02-181-1/+1
| | | | llvm-svn: 150859
* Add in a caching mechanism so that forward declarations are replacedEric Christopher2012-02-182-9/+38
| | | | | | | | with full types if they exist. rdar://10809898 and rdar://10209967 and rdar://10400981 llvm-svn: 150858
* Formatting.Eric Christopher2012-02-181-2/+1
| | | | llvm-svn: 150857
* Remove UpdateCompletedType from the debug info emission. We nowEric Christopher2012-02-183-20/+0
| | | | | | | emit less than complete types on purpose on occasion and so our caches aren't useful for this kind of lazy emitting. llvm-svn: 150856
* Remove redundant check.Chad Rosier2012-02-181-3/+2
| | | | llvm-svn: 150855
* Don't emit optimization-specific intrinsic at -O0.Richard Smith2012-02-171-0/+4
| | | | llvm-svn: 150838
* Basic code generation support for std::initializer_list.Sebastian Redl2012-02-173-132/+266
| | | | | | | | | | | | | | | | | | | | | | | 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
* The clang half of r150794: after the construction of a global or static constRichard Smith2012-02-171-1/+17
| | | | | | | | 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
* Index "12" holds the vtable, not "9".Eric Christopher2012-02-171-1/+1
| | | | | | Fixes lots of gdb testsuite failures. llvm-svn: 150797
* Bug fix: do not emit static const local variables with mutable membersRichard Smith2012-02-173-30/+30
| | | | | | | | | as constants. Refactor and simplify all the separate checks for whether a type can be emitted as a constant. llvm-svn: 150793
* When performing IRGen on a global, emit it as a constant if:Richard Smith2012-02-171-1/+0
| | | | | | | | | | | 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
* Whether an argument is required (in contrast with being anJohn McCall2012-02-1722-417/+671
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor2012-02-173-62/+20
| | | | | | | | | | | | | | | | | | | | 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
* Reapply r150631:Eric Christopher2012-02-162-103/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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
* Elide copy construction in new expressions. PR11757.Eli Friedman2012-02-161-14/+0
| | | | llvm-svn: 150738
* Revert "Revert "Make CXXNewExpr contain only a single initialier, and not ↵Sebastian Redl2012-02-161-29/+22
| | | | | | | | 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-22/+29
| | | | | | | | | | used constructor itself." It leads to a compiler crash in the Bullet benchmark. This reverts commit r12014. llvm-svn: 150684
OpenPOWER on IntegriCloud