summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* If an aggregate argument is passed indirectly because it has non trivialDevang Patel2011-02-095-9/+20
| | | | | | | | destructor or copy constructor than let debug info know about it. Radar 8945514. llvm-svn: 125142
* Fix an IRGen bug in property setter calls whenFariborz Jahanian2011-02-081-1/+11
| | | | | | setter and getter types mismatch. // rdar://8966864 llvm-svn: 125125
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-0821-499/+511
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Extend the const capture optimization to C++ record types with noJohn McCall2011-02-081-5/+42
| | | | | | mutable fields and with trivial destructors and copy constructors. llvm-svn: 125073
* Convert RecordLayout::NonVirtualAlign to CharUnits. No change inKen Dyck2011-02-081-5/+10
| | | | | | functionality intended. llvm-svn: 125069
* When copy-capturing values for a nested capture, use a BlockDeclRefExpr.John McCall2011-02-071-3/+11
| | | | llvm-svn: 125021
* A few more tweaks to the blocks AST representation: John McCall2011-02-0711-937/+1038
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* pre/post ++/-- for AltiVec vectors. (with builtins-ppc-altivec.c failure fixed)Anton Yartsev2011-02-071-23/+48
| | | | llvm-svn: 125000
* Fix self-host; if a thunk already exists and has available_externally ↵Anders Carlsson2011-02-061-2/+7
| | | | | | linkage, we should change its linkage instead of asserting. llvm-svn: 124986
* When building with optimizations, emit thunks with available_externally ↵Anders Carlsson2011-02-062-6/+43
| | | | | | linkage so devirtualized function calls can also be de-thunked. llvm-svn: 124984
* Simplify thunks code.Anders Carlsson2011-02-062-9/+7
| | | | llvm-svn: 124983
* Pass a 'ForVTable' flag to GetAddrOfThunk and pass it along to ↵Anders Carlsson2011-02-052-6/+8
| | | | | | | | GetOrCreateLLVMFunction so that we won't assert when building a thunk for an implicit virtual member function that is not marked used. llvm-svn: 124967
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-054-14/+24
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* minor refactoring of -fapple-kext stuff.Fariborz Jahanian2011-02-041-8/+6
| | | | llvm-svn: 124837
* What was I thinking?Fariborz Jahanian2011-02-041-3/+1
| | | | llvm-svn: 124835
* -fapple-kext cannot have 'weak' visibility in thisFariborz Jahanian2011-02-041-15/+32
| | | | | | abi. llvm-svn: 124834
* Clean up of -fapple-kext abi code. No change otherwise.Fariborz Jahanian2011-02-034-12/+10
| | | | llvm-svn: 124807
* More capturing of 'this': implicit member expressions. Getting thatJohn McCall2011-02-038-75/+59
| | | | | | | | | | | right for anonymous struct/union members led to me discovering some seemingly broken code in that area of Sema, which I fixed, partly by changing the representation of member pointer constants so that IndirectFieldDecls aren't expanded. This led to assorted cleanups with member pointers in CodeGen, and while I was doing that I saw some random other things to clean up. llvm-svn: 124785
* Revert 124768.Rafael Espindola2011-02-034-25/+14
| | | | | | | This reopens PR99114, but that one at least can be avoided with an #include. PR9130 cannot. llvm-svn: 124780
* Don't try to mark virtual members referenced for classes where the key functionAnders Carlsson2011-02-034-14/+25
| | | | | | | | | | | is not defined in the current translation unit. Doing so lead to compile errors such as PR9114. Instead, when CodeGen is building the vtable, don't try to emit a definition for functions that aren't marked used in the current translation unit. Fixes PR9114. llvm-svn: 124768
* -fapple-kext, elimination of all direct calls to virtual dtors.Fariborz Jahanian2011-02-021-0/+4
| | | | llvm-svn: 124757
* Emit debug info for template value parameters.Devang Patel2011-02-021-0/+7
| | | | llvm-svn: 124756
* Emit debug info for template type parameters.Devang Patel2011-02-021-1/+18
| | | | llvm-svn: 124753
* Add NetBSD target support. Patch by Joerg Sonnenberger.Benjamin Kramer2011-02-021-0/+1
| | | | llvm-svn: 124736
* -fapple-kext support for indirect call to virtuals dtors - wip.Fariborz Jahanian2011-02-014-2/+58
| | | | llvm-svn: 124701
* Do the right thing for zero-initializing VLAs that don't have a zeroJohn McCall2011-02-011-5/+60
| | | | | | | bit-pattern. It's not clear that this is actually useful given current language restrictions. llvm-svn: 124685
* Revert 124633. The linker has been told how to merge available_externally.Rafael Espindola2011-02-011-1/+2
| | | | llvm-svn: 124651
* Convert RecordLayout::NonVirtualSize from bit units to CharUnits.Ken Dyck2011-02-011-6/+7
| | | | llvm-svn: 124646
* Set visibility for available_externally globals. This is important for two ↵Rafael Espindola2011-02-011-2/+1
| | | | | | | | | | reasons: * llvm-link would complains about mismatched visibility * If we produce a relocation with an available_externally, it is good to know that it is hidden. llvm-svn: 124633
* Amazing that there are still issues with the fields of anonymous struct/unions..Argyrios Kyrtzidis2011-01-311-5/+29
| | | | | | Allow taking the address of such a field for a pointer-to-member constant. Fixes rdar://8818236. llvm-svn: 124575
* When building with optimizations, emit vtables where the key is not in the Anders Carlsson2011-01-303-1/+68
| | | | | | | | | | | | | | | | | | | | | | | current translation unit as available_externally. This helps devirtualize the second example in PR3100, comment 18: struct S { S() {}; virtual void xyzzy(); }; inline void foo(S *s) { s->xyzzy(); } void bar() { S s; foo(&s); } This involved four major changes: 1. In DefineUsedVTables, always mark virtual member functions as referenced for non-template classes and class template specializations. 2. In CodeGenVTables::ShouldEmitVTableInThisTU return true if optimizations are enabled, even if the key function is not implemented in this translation unit. We don't ever do this for code compiled with -fapple-kext, because we don't ever want to devirtualize virtual member function calls in that case. 3. Give the correct linkage for vtables where the key function is not defined. 4. Update the linkage for RTTI structures when necessary. llvm-svn: 124565
* Remove dead code.Anders Carlsson2011-01-291-57/+3
| | | | llvm-svn: 124554
* When emitting RTTI for a non-class type, compute the visibility of the RTTI ↵Anders Carlsson2011-01-291-10/+15
| | | | | | data based on the explicit visibility of the type. llvm-svn: 124553
* Move GetLLVMVisibility to CodeGenModule.Anders Carlsson2011-01-292-11/+10
| | | | llvm-svn: 124550
* Add RTTIBuilder::GetAddrOfTypeName which uses the newly added ↵Anders Carlsson2011-01-292-5/+42
| | | | | | | | CreateOrReplaceCXXRuntimeVariable. Set the visibility for typeinfo names. llvm-svn: 124548
* Change CodeGenModule::setTypeVisibility to take a TypeVisibilityKind enum ↵Anders Carlsson2011-01-295-6/+16
| | | | | | instead of an "IsForRTTI" flag. llvm-svn: 124546
* Replace an isa/cast with a dyn_cast.Anders Carlsson2011-01-291-2/+2
| | | | llvm-svn: 124542
* Get rid of an unneeded parameter from setGlobalVisibility.Anders Carlsson2011-01-293-10/+7
| | | | llvm-svn: 124541
* Give VTTs the right visibility.Anders Carlsson2011-01-291-0/+3
| | | | llvm-svn: 124540
* Make emitting a VTT a two-step process, much like emitting a VTable. You ↵Anders Carlsson2011-01-295-51/+46
| | | | | | first get the address of the VTT, and then pass it to EmitVTTDefinition. llvm-svn: 124539
* Use CGM.CreateOrReplaceCXXRuntimeVariable in CGVTables.cppAnders Carlsson2011-01-292-48/+5
| | | | llvm-svn: 124538
* Add a new function, to be used by CGRTTI, CGVTables and CGVTT (which each ↵Anders Carlsson2011-01-292-0/+47
| | | | | | has their own copy of this code). llvm-svn: 124537
* Replace a literal '8' with getCharWidth().Ken Dyck2011-01-291-2/+3
| | | | llvm-svn: 124536
* Remove IsDefinition from CodeGenModule::setTypeVisibility; it is always true.Anders Carlsson2011-01-294-6/+5
| | | | llvm-svn: 124529
* When trying to get the most derived class, don't assume that we can ignore ↵Anders Carlsson2011-01-291-1/+17
| | | | | | all casts. We can only ignore derived-to-base and no-op casts. Fixes selfhost. llvm-svn: 124528
* When calling a virtual member function on a base class and the most derived ↵Anders Carlsson2011-01-291-1/+24
| | | | | | class is marked 'final', we can devirtualize the call. llvm-svn: 124524
* When doing a derived-to-base class through a virtual class, we don't have to ↵Anders Carlsson2011-01-291-2/+11
| | | | | | get the vbase offset from the vtable if the derived class is marked final. llvm-svn: 124523
* More work to support -fapple-kext regarding Fariborz Jahanian2011-01-283-1/+11
| | | | | | | indirect vf calls and addition of extra entry at bottom of vtbls. llvm-svn: 124507
* Add my new file to the CMake lists, sorry about that.John McCall2011-01-281-0/+1
| | | | llvm-svn: 124503
* Move all the cleanups framework code into a single file.John McCall2011-01-288-1661/+1710
| | | | | | Pure motion. llvm-svn: 124484
OpenPOWER on IntegriCloud