summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression caused by r108911.Devang Patel2010-07-211-1/+2
| | | | | | | Do not override known debug loc with unknown debug loc. This is tested by sections.exp in gdb testsuite. llvm-svn: 109022
* Don't crash when sending a message inside a block with the non-fragile ABI ↵David Chisnall2010-07-211-1/+1
| | | | | | (GNU runtime). llvm-svn: 109012
* Mark the load after calling objc_msg_lookup_sender() so that it doesn't get ↵David Chisnall2010-07-211-2/+2
| | | | | | optimised away (GNU runtime). llvm-svn: 109010
* Rename LazyCleanup -> Cleanup. No functionality change for these last threeJohn McCall2010-07-2110-178/+173
| | | | | | commits. llvm-svn: 109000
* Rip out EHCleanupScope.John McCall2010-07-214-296/+13
| | | | llvm-svn: 108999
* Kill the CleanupBlock API.John McCall2010-07-212-84/+0
| | | | llvm-svn: 108998
* Switch the fragile-ABI @finally/@synchronized cleanup over to using a lazyJohn McCall2010-07-211-32/+53
| | | | | | cleanup. llvm-svn: 108997
* Code simplification.John McCall2010-07-211-14/+4
| | | | llvm-svn: 108996
* Switch the main possibly-conditional temporary cleanup over to being lazy.John McCall2010-07-211-33/+37
| | | | llvm-svn: 108995
* Switch the destructor for a temporary arising from a reference binding over toJohn McCall2010-07-213-12/+14
| | | | | | using a lazy cleanup. llvm-svn: 108994
* Switch the __cxa_guard_abort cleanup to being a lazy cleanup.John McCall2010-07-211-5/+17
| | | | llvm-svn: 108993
* Switch some random local-decl cleanups over to using lazy cleanups. Turn onJohn McCall2010-07-211-52/+57
| | | | | | | the block-release unwind cleanup: we're never going to test it if we don't turn it on. llvm-svn: 108992
* Switch finally cleanups over to being lazy cleanups. We get basically nothingJohn McCall2010-07-212-46/+70
| | | | | | | from the laziness features here except better block ordering, but it removes yet another CleanupBlock use. llvm-svn: 108990
* Implement proper base/member destructor EH chaining.John McCall2010-07-212-156/+175
| | | | llvm-svn: 108989
* Change PushDestructorCleanup to use lazy cleanups.John McCall2010-07-211-8/+16
| | | | llvm-svn: 108979
* Convert the EH cleanups for base and member destructors in a constructor intoJohn McCall2010-07-211-18/+42
| | | | | | lazy cleanups. llvm-svn: 108978
* Implement zero-initialization for array new when there is anDouglas Gregor2010-07-213-21/+82
| | | | | | | | | initializer of (). Make sure to use a simple memset() when we can, or fall back to generating a loop when a simple memset will not suffice. Fixes <rdar://problem/8212208>, a regression due to my work in r107857. llvm-svn: 108977
* Convert the end-catch call for finally blocks to a lazy cleanup. This kills offJohn McCall2010-07-211-13/+25
| | | | | | the last of the shared-code cleanups. llvm-svn: 108975
* Convert the ObjC @synchronized cleanups to laziness. This is not actuallyJohn McCall2010-07-212-13/+32
| | | | | | | a big deal, except that I want to eliminate the shared-code EH cleanups in preparation for a significant algorithmic fix. llvm-svn: 108973
* Add a little helper method which will be useful soon.John McCall2010-07-211-0/+4
| | | | llvm-svn: 108972
* Remove unintended code that was checked in as part of r108916.Devang Patel2010-07-201-12/+0
| | | | llvm-svn: 108951
* Remove unused argument.Devang Patel2010-07-204-13/+13
| | | | llvm-svn: 108946
* Fix the IR generation for catching pointers by references.John McCall2010-07-202-2/+59
| | | | | | Fixes <rdar://problem/8212123>. llvm-svn: 108944
* in 'new int[4]', constant fold the 4*4=16 instead of Chris Lattner2010-07-201-34/+56
| | | | | | doing an overflow check. llvm-svn: 108943
* Follow the implementation approach suggested by PR6687,Chris Lattner2010-07-203-49/+18
| | | | | | | | | | | | | | | | | | | | | | which generates more efficient and more obviously conformant code. We now test for overflow of the multiply then force the result to -1 if so. On X86, this generates nice code like this: __Z4testl: ## @_Z4testl ## BB#0: ## %entry subl $12, %esp movl $4, %eax mull 16(%esp) testl %edx, %edx movl $-1, %ecx cmovel %eax, %ecx movl %ecx, (%esp) call __Znam addl $12, %esp ret llvm-svn: 108927
* Adopt objc_assign_threadlocal() for __thread variables of GC types.Fariborz Jahanian2010-07-205-17/+57
| | | | | | Implements radar 8203301. llvm-svn: 108917
* Print template argument names for template class.Devang Patel2010-07-202-1/+57
| | | | llvm-svn: 108916
* implement rdar://5739832 - operator new should check for overflow in multiply,Chris Lattner2010-07-204-11/+68
| | | | | | | | | | | | | | | | | | | | causing clang to compile this code into something that correctly throws a length error, fixing a potential integer overflow security attack: void *test(long N) { return new int[N]; } int main() { test(1L << 62); } We do this even when exceptions are disabled, because it is better for the code to abort than for the attack to succeed. This is heavily based on a patch that Fariborz wrote. llvm-svn: 108915
* Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,Dan Gohman2010-07-201-4/+3
| | | | | | avoiding MDNode overhead. llvm-svn: 108911
* delete a loop that just generates dead code. In an exampleChris Lattner2010-07-201-10/+0
| | | | | | | | | | | | | | | | | | | | like this: void *test(long N) { return new int[N][42][42]; } the loop generates two dead mul instructions: %tmp = load i64* %N.addr ; <i64> [#uses=2] %0 = mul i64 %tmp, 7056 ; <i64> [#uses=1] %1 = mul i64 %tmp, 42 ; <i64> [#uses=1] %2 = mul i64 %1, 42 ; <i64> [#uses=0] %call = call noalias i8* @_Znam(i64 %0) ; <i8*> [#uses=1] The scale of these multiplies is already handled by the typesize stuff. llvm-svn: 108884
* remove the special case for constant array sizes from Chris Lattner2010-07-201-24/+2
| | | | | | | EmitCXXNewAllocSize. This code uses IRBuilder, which does constant folding already. llvm-svn: 108882
* Re-apply fixed version of 108749, correctly conditionalizing the new sections onJim Grosbach2010-07-201-5/+15
| | | | | | ObjC ABI version 2 this time. llvm-svn: 108847
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-202-3/+4
| | | | llvm-svn: 108807
* Correct line info for declarations/definitions. Radar 8063111.Stuart Hastings2010-07-191-0/+1
| | | | llvm-svn: 108785
* Temporarily revert. Some odd internal breakage is likely related.Jim Grosbach2010-07-191-4/+4
| | | | llvm-svn: 108764
* Put ObjC method names, method types and class names in separate string literalJim Grosbach2010-07-191-4/+4
| | | | | | sections. rdar://8207705 llvm-svn: 108749
* Fix mangling for static member variables of classes inside an extern "C"Eli Friedman2010-07-181-0/+4
| | | | | | | linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. llvm-svn: 108656
* Improve the representation of the atomic builtins in a few ways. First, we makeChandler Carruth2010-07-181-30/+86
| | | | | | | | | | | | | | | their call expressions synthetically have the "deduced" types based on their first argument. We only insert conversions in the AST for arguments whose values require conversion to match the value type expected. This keeps PR7600 closed by maintaining the return type, but avoids assertions due to unexpected implicit casts making the type unsigned (test case added from Daniel). The magic is moved into the codegen for the atomic builtin which inserts the casts as needed at the IR level to raise the type to an integer suitable for the LLVM intrinsic. This shouldn't cause any real change in functionality, but now we can make the builtin be more truly polymorphic. llvm-svn: 108638
* BUILD_ARCHIVE is the default for libraries, no need to set it.Chris Lattner2010-07-181-1/+0
| | | | llvm-svn: 108633
* Fix crash initializing a bit-field with a non-constant in a place where weEli Friedman2010-07-171-4/+3
| | | | | | try to evaluate the initializer as a constant. llvm-svn: 108632
* The GNU-runtime ObjC personality function doesn't let us rethrow with URR forJohn McCall2010-07-172-43/+92
| | | | | | multiple reasons. Rethrow with _objc_exception_throw instead. Fixes PR7656. llvm-svn: 108595
* Fix for PR3800: make sure not to evaluate the expression for a read-writeEli Friedman2010-07-162-16/+32
| | | | | | asm operand twice. llvm-svn: 108489
* IRgen: Support user defined attributes on block runtime functions.Daniel Dunbar2010-07-162-0/+60
| | | | | | | | | | | | | | | | | | - This issue here is that /usr/include/Blocks.h wants to define some of the block runtime globals as weak, depending on the target. This doesn't work in Clang because we aren't using the AST decl for these globals. - The fix is a pretty gross hack which just watches all the decls for the specific blocks globals we need to know about; if we see one we use it, otherwise we use the hand coded type. In time, I would like to clean this up by changing IRgen to ask Sema/AST for the decl, which would then be lazily loaded from the builtin table if necessary. This could be used in a whole host of places in IRgen and would get rid of a lot of grotty hand coding of LLVM IR; however, we need some extra Sema support for this as well as support for builtin global variables. llvm-svn: 108482
* IRgen: Move blocks runtime interfaces to CodeGenModule.Daniel Dunbar2010-07-164-67/+80
| | | | llvm-svn: 108481
* 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
OpenPOWER on IntegriCloud