summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Always emit associated thunks when emitting the function itself. Remove ↵Anders Carlsson2010-03-231-1/+7
| | | | | | getVtableAddressPoint, it's not used. llvm-svn: 99252
* Rename CGVtableInfo to CodeGenVTables in preparation of adding another ↵Anders Carlsson2010-03-231-7/+7
| | | | | | VTableInfo class. llvm-svn: 99250
* Change CodeGenModule to rely on the Module's symbol table instead ofJohn McCall2010-03-191-32/+23
| | | | | | | | | | | | | shadowing it in the GlobalDeclMap. Eliminates the string-uniquing requirement for mangled names, which should help C++ codegen times a little. Forces us to do string lookups instead of pointer lookups, which might hurt codegen times a little across the board. We'll see how it plays out. Removing the string-uniquing requirement implicitly fixes any bugs like PR6635 which arose from the fact that we had multiple uniquing tables for different kinds of identifiers. llvm-svn: 99012
* Use static method in GlobalValueRafael Espindola2010-03-061-11/+1
| | | | llvm-svn: 97872
* Don't produce an alias for a destructor if the target is weak.Rafael Espindola2010-03-051-0/+16
| | | | | | This fixes bootstrap on ELF systems :-) llvm-svn: 97773
* Don't emit derived-to-base destructor aliases if we don't have a definitionJohn McCall2010-03-031-1/+7
| | | | | | | | for the base destructor, because aliases to declarations aren't legal. Fixes PR 6471. llvm-svn: 97637
* Fix an iterator-invalidation bug that was causing selfhost errorsJohn McCall2010-02-241-10/+6
| | | | | | | on non-darwin platforms. Fixes PR6411. Test case doesn't reduce, unfortunately. llvm-svn: 97055
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-15/+106
| | | | | | | | | | | | | | | | 1) emit base destructors as aliases to their unique base class destructors under some careful conditions. This is enabled for the same targets that can support complete-to-base aliases, i.e. not darwin. 2) Emit non-variadic complete constructors for classes with no virtual bases as calls to the base constructor. This is enabled on all targets and in theory can trigger in situations that the alias optimization can't (mostly involving virtual bases, mostly not yet supported). These are bundled together because I didn't think it worthwhile to split them, not because they really need to be. llvm-svn: 96842
* Re-introduce the ctor/dtor alias optimization, this time hidden behind aJohn McCall2010-02-191-7/+104
| | | | | | command-line option which defaults off. llvm-svn: 96649
* Revert the ctor/dtor alias optimization for now; the buildbots can detectJohn McCall2010-02-181-103/+10
| | | | | | some failure here that I can't. llvm-svn: 96612
* Emit complete constructors and destructors as aliases to base constructorsJohn McCall2010-02-171-10/+103
| | | | | | | | and destructors when the two entities are semantically identical, i.e. when the class has no virtual base classes. We only do this for linkage types for which aliases are supported, i.e. internal and external, i.e. not linkonce. llvm-svn: 96451
* IRgen optimization: cache the value of 'this' and 'vtt' instead ofJohn McCall2010-02-161-12/+0
| | | | | | | | repeatedly reloading from an alloca. We still need to create the alloca for debug info purposes (although we currently create it in all cases because of some abstraction boundaries that're hard to break down). llvm-svn: 96403
* Standardize the parsing of function type attributes in a way thatJohn McCall2010-02-051-3/+5
| | | | | | | | | | | | follows (as conservatively as possible) gcc's current behavior: attributes written on return types that don't apply there are applied to the function instead, etc. Only parse CC attributes as type attributes, not as decl attributes; don't accepet noreturn as a decl attribute on ValueDecls, either (it still needs to apply to other decls, like blocks). Consistently consume CC/noreturn information throughout codegen; enforce this by removing their default values in CodeGenTypes::getFunctionInfo(). llvm-svn: 95436
* Move a few more functions away from CGCXX and to CGClass and CGExprCXX.Anders Carlsson2010-01-011-671/+0
| | | | llvm-svn: 92399
* Add a sanity assertion so that we don't silently generate bad code; I'll fileEli Friedman2009-12-271-0/+2
| | | | | | a bug with a testcase hitting this assertion in a moment. llvm-svn: 92175
* Fix obvious mistake.Eli Friedman2009-12-271-1/+1
| | | | llvm-svn: 92172
* Make copy constructor elimination work in more cases; the case in questionEli Friedman2009-12-241-0/+3
| | | | | | here affects clang-on-clang. llvm-svn: 92151
* Move a bunch of class related functions to CGClass.cpp, no functionality change.Anders Carlsson2009-12-241-774/+0
| | | | llvm-svn: 92148
* Pass the return value slot to all call exprs.Anders Carlsson2009-12-241-10/+14
| | | | llvm-svn: 92145
* Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us ↵Anders Carlsson2009-12-241-1/+1
| | | | | | halfway towards fixing PR5824. llvm-svn: 92142
* Pass ReturnValueSlot to EmitCall. No functionality change yet.Anders Carlsson2009-12-241-10/+11
| | | | llvm-svn: 92138
* Add a ReturnValueSlot class. Change the argument order in EmitCall to match ↵Anders Carlsson2009-12-241-3/+2
| | | | | | the other overload better. llvm-svn: 92136
* Eliminate the ASTContext argument to CXXConstructorDecl::isCopyConstructor, ↵Douglas Gregor2009-12-221-2/+2
| | | | | | since the context is available in the Decl llvm-svn: 91862
* Work in progress for setting the vtable pointers for all bases correctly inEli Friedman2009-12-181-11/+55
| | | | | | | the constructor. This doesn't handle cases requiring the VTT at the moment, and generates unnecessary stores, but I think it's essentially correct. llvm-svn: 91731
* Fix for PR5830: fix the computation of the offset to a virtual base.Eli Friedman2009-12-181-3/+36
| | | | llvm-svn: 91724
* CK_UserDefinedConversion is a valid kind when doing copy ctor elision.Anders Carlsson2009-12-181-1/+2
| | | | llvm-svn: 91695
* Address some of Anders commentsDouglas Gregor2009-12-181-4/+8
| | | | llvm-svn: 91670
* Switch the initialization required by return statements over to theDouglas Gregor2009-12-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new InitializationSequence. This fixes some bugs (e.g., PR5808), changed some diagnostics, and caused more churn than expected. What's new: - InitializationSequence now has a "C conversion sequence" category and step kind, which falls back to - Changed the diagnostics for returns to always have the result type of the function first and the type of the expression second. CheckSingleAssignmentConstraints to peform checking in C. - Improved ASTs for initialization of return values. The ASTs now capture all of the temporaries we need to create, but intentionally do not bind the tempoary that is actually returned, so that it won't get destroyed twice. - Make sure to perform an (elidable!) copy of the class object that is returned from a class. - Fix copy elision in CodeGen to properly see through the subexpressions that occur with elidable copies. - Give "new" its own entity kind; as with return values and thrown objects, we don't bind the expression so we don't call a destructor for it. Note that, with this patch, I've broken returning move-only types in C++0x. We'll fix it later, when we tackle NRVO. llvm-svn: 91669
* When value-initializing a class with no user-defined constructors butDouglas Gregor2009-12-161-1/+2
| | | | | | | with a non-trivial default constructor, zero-initialize the storage and then call the default constructor. Fixes PR5800. llvm-svn: 91548
* Don't force the emission of destructor definitions.Eli Friedman2009-12-151-3/+3
| | | | llvm-svn: 91394
* More array cookie improvements.Anders Carlsson2009-12-131-8/+10
| | | | llvm-svn: 91247
* Random string-related cleanups.Benjamin Kramer2009-12-111-3/+2
| | | | llvm-svn: 91119
* Get rid of static variable.Eli Friedman2009-12-101-2/+1
| | | | llvm-svn: 91041
* Move more decl related functions to CGDeclCXX.cppAnders Carlsson2009-12-101-117/+0
| | | | llvm-svn: 91012
* Add CGDeclCXX.cpp and move EmitCXXGlobalVarDeclInit there.Anders Carlsson2009-12-101-45/+0
| | | | llvm-svn: 91006
* Fix spacing.Mike Stump2009-12-101-1/+1
| | | | llvm-svn: 91000
* Build fix.Eli Friedman2009-12-081-1/+1
| | | | llvm-svn: 90841
* Fix for PR5707: make sure implicit copy constructors initialize the vtableEli Friedman2009-12-081-0/+6
| | | | | | pointer. llvm-svn: 90840
* Fix some direct checks of expressions which might be surrounded by parentheses.Eli Friedman2009-12-081-3/+4
| | | | llvm-svn: 90825
* Make copy assignment operator synthesis not explode for classes with complexEli Friedman2009-12-081-2/+10
| | | | | | | | | | | | or non-record aggregate members. It might be worth spending some time to optimize this code (and the parallel code for copy constructors) to memcpy in larger chunks, rather than copying one member at a time. Not sure exactly how beneficial that would be, but it seems like could help for large classes with, for example, a vtable pointer forcing the generation of a copy constructor. llvm-svn: 90823
* A bunch more thunk fixes from misc testing.Eli Friedman2009-12-071-20/+26
| | | | | | (Yes, I do intend to commit some tests for this.) llvm-svn: 90818
* Work-in-progess rewrite of thunks: move thunk generation outside of vtableEli Friedman2009-12-061-0/+96
| | | | | | | generation, and make sure we generate thunks when the function is defined rather than when the vtable is defined. llvm-svn: 90722
* CodeGenModule::GenerateVtable now returns a pointer directly to the vtable ↵Anders Carlsson2009-12-051-9/+14
| | | | | | and not to the address point. llvm-svn: 90676
* Simplify some code.Anders Carlsson2009-12-051-11/+11
| | | | llvm-svn: 90670
* When generating a virtual destructor, don't try to make a virtual call to ↵Anders Carlsson2009-12-041-10/+18
| | | | | | | | the base class destructor because then we'll just re-enter the same destructor! This was done to fix PR5619, so I went ahead and passed a dummy VTT pointer for now. llvm-svn: 90578
* Fix thunk generation for thunks with a parameter with reference type.Eli Friedman2009-12-031-1/+2
| | | | llvm-svn: 90412
* Minor cleanup.Eli Friedman2009-12-031-9/+4
| | | | llvm-svn: 90411
* Add support for thunking dtors. Oh why does this make my head hurt?Mike Stump2009-12-031-10/+22
| | | | llvm-svn: 90409
* Added an assert.Fariborz Jahanian2009-12-011-1/+4
| | | | llvm-svn: 90285
* More support for virtual destructor calls.Fariborz Jahanian2009-11-301-15/+26
| | | | | | Fixes pr5619 llvm-svn: 90158
OpenPOWER on IntegriCloud