summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Implement __builtin_init_dwarf_reg_size_table and __builtin_dwarf_sp_columnJohn McCall2010-05-271-39/+78
| | | | | | | for 32-bit MIPS processors. Hat-tip to rdivacky for providing gcc dumps on this. llvm-svn: 104816
* When deciding whether a deferred declaration has already been emitted,John McCall2010-05-271-3/+13
| | | | | | | aliases count as definitions regardless of whether their target has been emitted yet. Fixes PR 7142. llvm-svn: 104796
* AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.Daniel Dunbar2010-05-271-2/+3
| | | | llvm-svn: 104795
* Correctly pass aggregates by reference when emitting thunks.John McCall2010-05-264-34/+37
| | | | llvm-svn: 104778
* Patch to fix a irgen crash accessing an initialized local staticFariborz Jahanian2010-05-261-2/+3
| | | | | | variable in a local function. Fixes pr7101. llvm-svn: 104743
* Extract the ObjC and blocks manglers into their own class. No functionalityCharles Davis2010-05-262-60/+98
| | | | | | change. llvm-svn: 104715
* Be sure to use the standard substitutions when mangling the names ofDouglas Gregor2010-05-261-5/+11
| | | | | | vtables, VTTs, and construction vtables. Fixes PR7201. llvm-svn: 104675
* IRgen: Add a stub class for generating ABI-specific C++ code.Charles Davis2010-05-256-4/+110
| | | | | | | | This class only supports name mangling (which is apparently used during C/ObjC codegen). For now only the Itanium C++ ABI is supported. Patches to add a second C++ ABI are forthcoming. llvm-svn: 104630
* Fix compilation failureDouglas Gregor2010-05-251-2/+2
| | | | llvm-svn: 104613
* Improve name mangling for blocks and support mangling of static localDouglas Gregor2010-05-256-5/+67
| | | | | | | | | variables within blocks. We loosely follow GCC's mangling, but since these are always internal symbols the names don't really matter. I intend to revisit block mangling later, because GCC's mangling is rather verbose. <rdar://problem/8015719>. llvm-svn: 104610
* If a function definition has any sort of weak linkage, its static localJohn McCall2010-05-255-10/+16
| | | | | | | | | | | | variables should have that linkage. Otherwise, its static local variables should have internal linkage. To avoid computing this excessively, set a function's linkage before we emit code for it. Previously we were assigning weak linkage to the static variables of static inline functions in C++, with predictably terrible results. This fixes that and also gives better linkage than 'weak' when merging is required. llvm-svn: 104581
* Add a comment for r104472.Benjamin Kramer2010-05-231-0/+3
| | | | llvm-svn: 104473
* PR5863: Don't erase unreachable BBs which have an associated cleanup size.Benjamin Kramer2010-05-231-1/+1
| | | | | | | This works around a crash where malloc reused the memory of an erased BB for a new BB leaving old cleanup information pointing at the new block. llvm-svn: 104472
* Re-teach IR gen to perform GC moves on rvalues resulting from various ObjCJohn McCall2010-05-221-17/+54
| | | | | | | expressions. Essentially, GC breaks a certain form of the return-value optimization. llvm-svn: 104454
* Really fix PR7139. There was one boost test that we still failed, and my ↵Anders Carlsson2010-05-221-3/+19
| | | | | | first fix broke self-host. llvm-svn: 104447
* Re-land the fix for PR7139.Anders Carlsson2010-05-226-11/+28
| | | | llvm-svn: 104446
* Improve our handling of reference binding for subobjects ofDouglas Gregor2010-05-222-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | temporaries. There are actually several interrelated fixes here: - When converting an object to a base class, it's only an lvalue cast when the original object was an lvalue and we aren't casting pointer-to-derived to pointer-to-base. Previously, we were misclassifying derived-to-base casts of class rvalues as lvalues, causing various oddities (including problems with reference binding not extending the lifetimes of some temporaries). - Teach the code for emitting a reference binding how to look through no-op casts and parentheses directly, since Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make sure that we properly look through multiple levels of indirection from the temporary object, but destroy the actual temporary object; this fixes the reference-binding issue mentioned above. - Teach Objective-C message sends to bind the result as a temporary when needed. This is actually John's change, but it triggered the reference-binding problem above, so it's included here. Now John can actually test his return-slot improvements. llvm-svn: 104434
* Push a return-value slot throughout ObjC message-send codegen. Will beJohn McCall2010-05-226-33/+66
| | | | | | | critical for ObjC++ correctness; hard to test independently of various required Sema changes, though. llvm-svn: 104422
* Unbreak self-host.Anders Carlsson2010-05-217-30/+13
| | | | llvm-svn: 104390
* Rename CodeGenFunction::EmitMemSetToZero to EmitNullInitialization. Handle ↵Anders Carlsson2010-05-217-13/+30
| | | | | | setting null data member pointers correctly. Fixes PR7139. llvm-svn: 104387
* Don't remove the break/continue scope of a for loop until after we'veDouglas Gregor2010-05-211-4/+2
| | | | | | | | emitted the increment expression. Fixes PR7189. If someone knows how to write a useful test for this, I'd be grateful. llvm-svn: 104335
* When generating the call arguments in a thunk to call the thunkee, doDouglas Gregor2010-05-211-3/+9
| | | | | | | | not make copies non-POD arguments or arguments passed by reference: just copy the pointers directly. This eliminates another source of the dreaded memcpy-of-non-PODs. Fixes PR7188. llvm-svn: 104327
* Add braces to avoid an ambiguous else, fixing a GCC warning.Chandler Carruth2010-05-211-1/+2
| | | | llvm-svn: 104314
* Allocate space in a block record for implicit references to the Objective CJohn McCall2010-05-214-115/+125
| | | | | | | | | | 'self' variable arising from uses of the 'super' keyword. Also reorganize some code so that BlockInfo (now CGBlockInfo) can be opaque outside of CGBlocks.cpp. Fixes rdar://problem/8010633. llvm-svn: 104312
* When emitting an lvalue for an anonymous struct or union member duringJohn McCall2010-05-213-2/+36
| | | | | | | class initialization, drill down through an arbitrary number of anonymous records. llvm-svn: 104310
* Adds support for generation of objc_memmove_collectable APIFariborz Jahanian2010-05-201-1/+5
| | | | | | in Objective-C++ mode. llvm-svn: 104281
* Copy construction of non-trivial properties must notFariborz Jahanian2010-05-202-8/+4
| | | | | | be turned into a setter call (fixes radar 8008649). llvm-svn: 104235
* Picky, pickyDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104230
* Fix a thinkoDouglas Gregor2010-05-201-1/+1
| | | | llvm-svn: 104229
* Assert that we do not try to memcpy a non-POD class type in C++. ThisDouglas Gregor2010-05-201-1/+7
| | | | | | | | | | | | | | particular issue was the cause of the Boost.Interprocess failures, and in general will lead to horrendous, hard-to-diagnose miscompiles. The assertion itself has survives self-host and a full Boost build, so we are close to eradicating this problem in C++. Note that the assertion is *not* turned on for Objective-C++, where we still have problems with introducing memcpy's of non-POD class types. That part of the assertion will go away as soon as we fix the known issues in Objective-C++. llvm-svn: 104227
* Fix my inability to spell 'continue' and a case where message sends ↵David Chisnall2010-05-201-4/+7
| | | | | | returning non-pointer-sized things were generating invalid IR inside @try blocks. llvm-svn: 104222
* Rework our handling of binding a reference to a temporaryDouglas Gregor2010-05-201-18/+100
| | | | | | | | | | | | | | | | | | | | subobject. Previously, we could only properly bind to a base class subobject while extending the lifetime of the complete object (of a derived type); for non-static data member subobjects, we could memcpy (!) the result and bind to that, which is rather broken. Now, we pull apart the expression that we're binding to, to figure out which subobject we're accessing, then construct the temporary object (adding a destruction if needed) and, finally, dig out the subobject we actually meant to access. This fixes yet another instance where we were memcpy'ing rather than doing the right thing. However, note the FIXME in references.cpp: there's more work to be done for binding to subobjects, since the AST is incorrectly modeling some member accesses in base classes as lvalues when they are really rvalues. llvm-svn: 104219
* When creating a this-adjustment thunk where the return value is of C++Douglas Gregor2010-05-201-2/+9
| | | | | | | | | class type (that uses a return slot), pass the return slot to the callee directly rather than allocating new storage and trying to copy the object. This appears to have been the cause of the remaining two Boost.Interprocess failures. llvm-svn: 104215
* Support implicitly closing on 'this' in a block. Fixed PR7165.John McCall2010-05-203-138/+200
| | | | | | (the codegen works here, too, but that's annoying to test without execution) llvm-svn: 104202
* Implement codegen for __builtin_isnormal.Benjamin Kramer2010-05-191-5/+19
| | | | llvm-svn: 104118
* Add support for Microsoft's __thiscall, from Steven Watanabe!Douglas Gregor2010-05-181-0/+4
| | | | llvm-svn: 104026
* Correctly initialize bases with member pointers. This should fix PR6441 but ↵Anders Carlsson2010-05-182-14/+139
| | | | | | that test case is a bit weird and I'd like to investigate further before closing that bug. llvm-svn: 104025
* Keep track of the LLVM field numbers for non-virtual bases.Anders Carlsson2010-05-182-4/+25
| | | | llvm-svn: 104013
* Start laying out bases as individual fields. We still use ugly i8 arrays but ↵Anders Carlsson2010-05-181-14/+61
| | | | | | this is a step in the right direction. llvm-svn: 104012
* Add CodeGenTypes::ContainsPointerToDataMember overload that takes a ↵Anders Carlsson2010-05-182-6/+15
| | | | | | CXXRecordDecl. llvm-svn: 104011
* Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointedJohn McCall2010-05-172-14/+14
| | | | | | out. The remaining ones are okay. llvm-svn: 103973
* Fix an ambiguous else warning from GCC by adding some much needed curlies.Chandler Carruth2010-05-171-2/+3
| | | | llvm-svn: 103972
* Correctly generate IR for ObjC messages sends to protocol-qualified types.John McCall2010-05-171-4/+5
| | | | | | Fixes rdar://problem/7992749 llvm-svn: 103965
* IRgen: Remove dead function.Daniel Dunbar2010-05-171-17/+0
| | | | llvm-svn: 103945
* C++/Darwin/i386 ABI: Fix some problems with empty record handling.Daniel Dunbar2010-05-171-3/+20
| | | | | | | | - Check bases as part of isEmptyRecord(). - C++ record fields are never empty in the Itanium ABI. llvm-svn: 103944
* Ensure that destructors are called for NRVO'd objects when theDouglas Gregor2010-05-173-3/+44
| | | | | | | function does not return. Thanks to Eli for pointing out this corner case. llvm-svn: 103941
* Pick the correct personality function based on the language. This prevents ↵David Chisnall2010-05-171-25/+26
| | | | | | | | link failures when C/ObjC code uses __attribute__((cleanup())) (previously this was inserting references to two libstc++ symbols; the personality function and the __terminate() function). This is still probably wrong for Objective-C++ and adds a couple of lines in CGException that should probably be in the CGObjCRuntime subclass. The personality function is now only looked up in one place in CGException though, so this should be easier to fix in the future. llvm-svn: 103938
* When initializing thread-safe statics, put the call toDouglas Gregor2010-05-163-19/+76
| | | | | | | | | | | | | __cxa_guard_abort along the exceptional edge into (in effect) a nested "try" that rethrows after aborting. Fixes PR7144 and the remaining Boost.ProgramOptions failures, along with the regressions that r103880 caused. The crucial difference between this and r103880 is that we now follow LLVM's little dance with the llvm.eh.exception and llvm.eh.selector calls, then use _Unwind_Resume_or_Rethrow to rethrow. llvm-svn: 103892
* Revert r103880 (thread-safe static initialization w/ exceptions),Douglas Gregor2010-05-163-44/+20
| | | | | | because it's causing strange linker errors. Unfixes PR7144. llvm-svn: 103890
* Minor twik to my last patch. (for radar 7986354).Fariborz Jahanian2010-05-161-2/+2
| | | | llvm-svn: 103889
OpenPOWER on IntegriCloud