summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Reorganize the value-dominance metaprogram and introduce a specializationJohn McCall2011-01-282-121/+119
| | | | | | for CodeGen's RValue type. llvm-svn: 124483
* Convert the exception-freeing cleanup over to the conditional cleanups code,John McCall2011-01-284-119/+88
| | | | | | | | | fixing a crash which probably nobody was ever going to see. In doing so, fix a horrendous number of problems with the conditional-cleanups code. Also, make conditional cleanups re-use the cleanup's activation variable, which avoids some unfortunate repetitiveness. llvm-svn: 124481
* When producing IR for a lvalue-to-rvalue cast *as an lvalue*, onlyDouglas Gregor2011-01-271-2/+3
| | | | | | | | | non-class prvalues actually require the realization of a temporary. For everything else, we already have an lvalue (or class prvalue) in the subexpression. Note: we're missing some move elision in this case. I'll tackle that next. llvm-svn: 124453
* Do a proper recursive lookup when deciding whether a class's usualJohn McCall2011-01-274-63/+59
| | | | | | | | | deallocation function has a two-argument form. Store the result of this check in new[] and delete[] nodes. Fixes rdar://problem/8913519 llvm-svn: 124373
* Notes on dynamic array cookies in MSVC.John McCall2011-01-271-0/+23
| | | | | | My thanks to chapuni for his help in investigating this. llvm-svn: 124351
* Fixes an IRgen bug where __block variable isFariborz Jahanian2011-01-263-10/+35
| | | | | | | referenced in the block-literal initializer of that variable. // rdar://8893785 llvm-svn: 124332
* Un-nest the meat of this function.John McCall2011-01-261-54/+53
| | | | llvm-svn: 124310
* Fix some obvious bugs in the conditional-cleanup code and then make theJohn McCall2011-01-263-56/+15
| | | | | | dtor cleanup use it. llvm-svn: 124309
* Better framework for conditional cleanups; untested as yet.John McCall2011-01-268-79/+296
| | | | | | | | I'm separately committing this because it incidentally changes some block orderings and minor IR issues, like using a phi instead of an unnecessary alloca. llvm-svn: 124277
* Add -add-plugin flag, which runs plugins in addition to codegen.Nico Weber2011-01-251-9/+8
| | | | llvm-svn: 124227
* Revert r124146 for now. It appears to be failing on a few platforms.Eric Christopher2011-01-241-48/+23
| | | | llvm-svn: 124153
* pre/post increase/decrease for AltiVec vectorsAnton Yartsev2011-01-241-23/+48
| | | | llvm-svn: 124146
* Use attributes for all the override control specifiers.Anders Carlsson2011-01-241-2/+2
| | | | llvm-svn: 124122
OpenPOWER on IntegriCloud