summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* When deferring the emission of declarations with initializers in C++, rememberJohn McCall2010-07-154-7/+39
| | | | | | | the order they appeared in the translation unit. If they get emitted, put them in their proper order. Fixes rdar://problem/7458115 llvm-svn: 108477
* Set "optimization is ON" and supply other optional parameters. This helps ↵Devang Patel2010-07-151-2/+6
| | | | | | codegenerator preserve info in case the symbol is deleted. llvm-svn: 108471
* Don't suppress the emission of available_externally functions markedDouglas Gregor2010-07-151-1/+2
| | | | | | with always_inline attribute. Thanks to Howard for the tip. llvm-svn: 108469
* Mark implementation generated methods as artificial.Devang Patel2010-07-151-1/+2
| | | | | | Tested by namespace.exp and virtfunc.exp from gdb testsuite. llvm-svn: 108468
* After some discussion, the ABI list settled on a much more sensible manglingJohn McCall2010-07-151-6/+3
| | | | | | for string literals. llvm-svn: 108464
* Reinstate the scalar-cast-to-const-reference improvements, this timeDouglas Gregor2010-07-151-12/+43
| | | | | | | | | with the proper spelling of "non-class prvalue". Silly me, I think class rvalues were xvalues rather than prvalues! Hah hah hah. llvm-svn: 108443
* Revert r108431 and r108433 (the cast-to-const-reference fixes), whichDouglas Gregor2010-07-151-42/+12
| | | | | | broke nightlytest. llvm-svn: 108439
* Revert 108220 and subsequent patch. Devang Patel2010-07-151-12/+0
| | | | | | This is not required (I am not 100% sure why) but method.exp from gdb testsuite flagged regression due to this patch. llvm-svn: 108434
* Spell isPRValue() properly.Douglas Gregor2010-07-151-2/+1
| | | | llvm-svn: 108433
* Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalueDouglas Gregor2010-07-151-12/+43
| | | | | | | | that involve binding a reference to a pure rvalue temporary (e.g., not a class temporary), by creating a new temporary and copying the result there. Fixes PR6024. llvm-svn: 108431
* CK_BitCast is not an lvalue bitcast any longerDouglas Gregor2010-07-151-1/+0
| | | | llvm-svn: 108428
* CodeGen: Tweak ABI handling for Minix, patch by Kees van Reeuwijk!Daniel Dunbar2010-07-151-1/+0
| | | | llvm-svn: 108423
* CodeGen/ObjC/NeXT: Fix Obj-C message send to match llvm-gcc when choosingDaniel Dunbar2010-07-144-32/+37
| | | | | | | | whether to use objc_msgSend_fpret; the choice is target dependent, not Obj-C ABI dependent. - <rdar://problem/8139758> arm objc _objc_msgSend_fpret bug llvm-svn: 108379
* Add lvalue-bitcast support for complex numbers.Douglas Gregor2010-07-141-5/+16
| | | | llvm-svn: 108363
* Fix the mangling of template template arguments, which do not alwaysJohn McCall2010-07-141-3/+50
| | | | | | | | follow <name>; instead they follow <type>, which has <name> as a subset. Fixes PR7446. llvm-svn: 108326
* Remove a few mangling FIXMEs:John McCall2010-07-141-5/+0
| | | | | | | | - TSTs whose template is a template template parameter already work - we don't provide an imaginary type, so we can't mangle one - we don't need a generic FIXME for vendor type qualifiers llvm-svn: 108317
* Implement the standard mangling for array-subscript expressions, and implementJohn McCall2010-07-141-15/+180
| | | | | | | the current proposals from David Vandervoorde for new, delete, throw, typeid, imaginary literals, string literals, and null literals. llvm-svn: 108315
* Work around an obnoxious GCC warning by changing semantics in a hopefully-John McCall2010-07-132-8/+15
| | | | | | harmless way. llvm-svn: 108295
* Introduce a new cast kind for an "lvalue bitcast", which handlesDouglas Gregor2010-07-133-1/+15
| | | | | | | | | | | | | | | | reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g., int i; reinterpret_cast<short&>(i); The IR generated for this is essentially the same as for *reinterpret_cast<short*>(&i). Fixes PR6437, PR7593, and PR7344. llvm-svn: 108294
* Switch the __cxa_rethrow cleanup to be lazy.John McCall2010-07-131-6/+12
| | | | llvm-svn: 108288
* Allow for the possibility that __cxa_end_catch might throw for a catch-all blockJohn McCall2010-07-133-20/+80
| | | | | | | or a catch of a record type by value or reference. Also convert this to a lazy cleanup. llvm-svn: 108287
* Switch the __cxa_free_exception cleanup to be lazy.John McCall2010-07-131-16/+32
| | | | llvm-svn: 108276
* Teach IR generation how to lazily emit cleanups. This has a lot of advantages,John McCall2010-07-138-75/+449
| | | | | | | | | | | | | | | mostly in avoiding unnecessary work at compile time but also in producing more sensible block orderings. Move the destructor cleanups for local variables over to use lazy cleanups. Eventually all cleanups will do this; for now we have some awkward code duplication. Tell IR generation just to never produce landing pads in -fno-exceptions. This is a much more comprehensive solution to a problem which previously was half-solved by checks in most cleanup-generation spots. llvm-svn: 108270
* Whenever we're creating an expression that is typically an rvalueDouglas Gregor2010-07-131-2/+2
| | | | | | | | | | | | | | | | (e.g., a call, cast, etc.), immediately adjust the expression's type to strip cv-qualifiers off of all non-class types (in C++) or all types (in C). This effectively extends my previous fix for PR7463, which was restricted to calls, to other kinds of expressions within similar characteristics. I've audited every use of getNonReferenceType() in the code base, switching to the newly-renamed getNonLValueExprType() where necessary. Big thanks to Eli for pointing out just how incomplete my original fix for PR7463 actually was. We've been handling cv-qualifiers on rvalues wrong for a very, very long time. Fixes PR7463. llvm-svn: 108253
* Add volatile qualifiers for "this".Devang Patel2010-07-131-1/+7
| | | | llvm-svn: 108245
* Reinstate the optimization suppressing available_externally functionsDouglas Gregor2010-07-131-8/+17
| | | | | | | | at -O0. The only change from the previous patch is that we don't try to generate virtual method thunks for an available_externally function. llvm-svn: 108230
* const qualify debug info for "this" for const methods.Devang Patel2010-07-131-0/+7
| | | | llvm-svn: 108220
* While collecting members for a class, always create delcaration entry for ↵Devang Patel2010-07-121-1/+1
| | | | | | | | methods. Debug info for method definition will be generated while generating code for method body. Tested by classes.exp in gdb testsuite. llvm-svn: 108205
* Speculatively revert r108156; it appears to be breaking self-host.Douglas Gregor2010-07-121-13/+5
| | | | llvm-svn: 108194
* Do not generate LLVM IR for available_externally function bodies atDouglas Gregor2010-07-121-5/+13
| | | | | | | | | | -O0, since we won't be using the definitions for anything anyway. For lib/System/Path.o when built in Debug+Asserts mode, this leads to a 4% improvement in compile time (and suppresses 440 function bodies). <rdar://problem/7987644> llvm-svn: 108156
* Handle forward declarations properly in debug info.Devang Patel2010-07-081-6/+14
| | | | | | | Patch by Alexander Kabaev. PR 7595. llvm-svn: 107900
* Mark calls to 'throw()' functions as nounwind, and mark the functions nounwindJohn McCall2010-07-081-0/+6
| | | | | | as well. llvm-svn: 107858
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-086-8/+16
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* fix the clang side of PR7437: EmitAggregateCopyChris Lattner2010-07-081-15/+8
| | | | | | | | | | | was not producing a memcpy with the right address spaces because of two places in it doing casts of the arguments to i8, one of which that didn't preserve the address space. There is also an optimizer bug here. llvm-svn: 107842
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-076-20/+11
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-075-8/+8
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Do not use CXXZeroValueInitExpr for class types. Instead, useDouglas Gregor2010-07-071-3/+12
| | | | | | | | | CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as appropriate. Fixes PR7556, and provides a slide codegen improvement when copy-initializing a POD class type from a value-initialized temporary. Previously, we weren't eliding the copy. llvm-svn: 107827
* add driver support for minix, patch by Kees van ReeuwijkChris Lattner2010-07-071-0/+1
| | | | | | from PR7583 llvm-svn: 107788
* getBody() -> hasBody()Argyrios Kyrtzidis2010-07-071-1/+1
| | | | llvm-svn: 107773
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-073-4/+4
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Teach function-try-blocks on constructors and destructors to implicitlyJohn McCall2010-07-073-18/+24
| | | | | | rethrow. Fixes rdar://problem/7696603 llvm-svn: 107757
* Provide a hook for the benefit of clients using clang IR gen as a subroutine:John McCall2010-07-064-0/+80
| | | | | | | | | | | | emit metadata associating allocas and global values with a Decl*. This feature is controlled by an option that (intentionally) cannot be enabled on the command line. To use this feature, simply set CodeGenOptions.EmitDeclMetadata = true; and then interpret the completely underspecified metadata. :) llvm-svn: 107739
* Make CGBuilderTy a typedef again; its functionality has been rolled backJohn McCall2010-07-061-49/+2
| | | | | | into IRBuilder. llvm-svn: 107687
* When destroying a cleanup, kill any references to instructions in the entryJohn McCall2010-07-061-0/+6
| | | | | | | | block before deleting it. Fixes PR7575. This really just a short-term fix before implementing lazy cleanups. llvm-svn: 107676
* When creating functions to run global initializers and destructors, mark themJohn McCall2010-07-061-0/+3
| | | | | | as nounwind in -fno-exceptions. Fixes rdar://problem/8090834. llvm-svn: 107639
* Validated by nightly-test runs on x86 and x86-64 darwin, including afterJohn McCall2010-07-0618-1794/+2964
| | | | | | | | | | | | | | | | | | | | | | | | self-host. Hopefully these results hold up on different platforms. I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request. Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with. Document a lot of previously poorly-understood (by me, at least) behavior. The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR. llvm-svn: 107631
* Generate fewer first class aggregate values for otherChris Lattner2010-07-051-35/+13
| | | | | | | coerce cases (e.g. {double,int}) which avoids fastisel bailing out at -O0. llvm-svn: 107628
* in the "coerce" case, the ABI handling code ends up making theChris Lattner2010-07-053-8/+10
| | | | | | | | | alloca for an argument. Make sure the argument gets the proper decl alignment, which may be different than the type alignment. This fixes PR7567 llvm-svn: 107627
* fix PR7564 a cast where the bitfield struct init codeChris Lattner2010-07-051-4/+31
| | | | | | wasn't handling array padding elements right. llvm-svn: 107621
* AppendBitField really can never fail, so return its return value. Chris Lattner2010-07-051-14/+8
| | | | | | Everyone knows that no bugs are ever possible with bitfields. llvm-svn: 107620
OpenPOWER on IntegriCloud