summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement ARM static local initialization guards, which are more compact thanJohn McCall2010-09-081-1/+7
| | | | | | Itanium guards and use a slightly different compiled-in API. llvm-svn: 113330
* Abstract IR generation of array cookies into the C++ ABI class andJohn McCall2010-09-021-1/+25
| | | | | | | | | | | | | | implement ARM array cookies. Also fix a few unfortunate bugs: - throwing dtors in deletes prevented the allocation from being deleted - adding the cookie to the new[] size was not being considered for overflow (and, more seriously, was screwing up the earlier checks) - deleting an array via a pointer to array of class type was not causing any destructors to be run and was passing the unadjusted pointer to the deallocator - lots of address-space problems, in case anyone wants to support free store in a variant address space :) llvm-svn: 112814
* Amusingly, I missed this point of abstraction in all my earlierJohn McCall2010-08-311-0/+9
| | | | | | member-pointer refactoring: dereferencing a member data pointer. llvm-svn: 112640
* Teach IR generation to return 'this' from constructors and destructorsJohn McCall2010-08-311-0/+26
| | | | | | under the ARM ABI. llvm-svn: 112588
* Abstract out everything having to do with member pointers into the ABIJohn McCall2010-08-231-15/+28
| | | | | | | | | | | class; they should just be completely opaque throughout IR gen now, although I haven't really audited that. Fix a bug apparently inherited from gcc-4.2 where we failed to null-check member data pointers when performing derived-to-base or base-to-derived conversions on them. llvm-svn: 111789
* Go back to asking CodeGenTypes whether a type is zero-initializable.John McCall2010-08-221-6/+3
| | | | | | | | | Make CGT defer to the ABI on all member pointer types. This requires giving CGT a handle to the ABI. It's way easier to make that work if we avoid lazily creating the ABI. Make it so. llvm-svn: 111786
* Experiment with using first-class aggregates to represent member functionJohn McCall2010-08-221-25/+16
| | | | | | | | | | pointers. I find the resulting code to be substantially cleaner, and it makes it very easy to use the same APIs for data member pointers (which I have conscientiously avoided here), and it avoids a plethora of potential inefficiencies due to excessive memory copying, but we'll have to see if it actually works. llvm-svn: 111776
* Extract member function pointer comparison and null comparison intoJohn McCall2010-08-221-0/+18
| | | | | | | | | | | | the ABI code. Implement correct semantics for these on ARM. I believe this completes the implementation of member function pointers on ARM. I think I'm going to switch member function pointers over to be non-aggregates while I have all this in mind. llvm-svn: 111774
* Abstract out member-pointer creation. I'm really unhappy about the currentJohn McCall2010-08-221-38/+11
| | | | | | | | duplication between the constant and non-constant paths in all of this. Implement ARM ABI semantics for member pointer constants and conversion. llvm-svn: 111772
* Abstract more member-pointerness out.John McCall2010-08-221-6/+32
| | | | llvm-svn: 111771
* Abstract out member-pointer conversions.John McCall2010-08-221-6/+19
| | | | | | Pretty much everything having to do with member pointers is ABI-specific. llvm-svn: 111770
* Extract calls to method pointers out as an ABI routine.John McCall2010-08-221-0/+22
| | | | | | No functionality change. llvm-svn: 111752
* Implement support for member pointers under the Microsoft C++ ABI in theCharles Davis2010-08-161-1/+1
| | | | | | | | AST library. This also adds infrastructure for supporting multiple C++ ABIs in the AST. llvm-svn: 111117
* Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead ↵Argyrios Kyrtzidis2010-07-071-1/+1
| | | | | | | | of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH. Makes de-serialization of the function body even more "lazier". llvm-svn: 107768
* Remove unnecessary ASTContext parameter fromDouglas Gregor2010-07-011-1/+1
| | | | | | CXXRecordDecl::getDestructor(); no functionality change. llvm-svn: 107394
* Switch over to the new caching version of getMangledName.Anders Carlsson2010-06-221-7/+4
| | | | llvm-svn: 106549
* Move CodeGenOptions.h *back* into Frontend. This should have been done when theChandler Carruth2010-06-151-1/+1
| | | | | | dependency edge was reversed such that CodeGen depends on Frontend. llvm-svn: 106065
* Get rid of getMangledCXXCtorName and getMangledCXXDtorName.Anders Carlsson2010-06-091-16/+0
| | | | llvm-svn: 105673
* More mangling cleanup.Anders Carlsson2010-06-091-6/+8
| | | | llvm-svn: 105672
* Fix for PR7040: Don't try to compute the LLVM type for a function where itEli Friedman2010-05-301-0/+38
| | | | | | | | | | | isn't possible to compute. This patch is mostly refactoring; the key change is the addition of the code starting with the comment, "Check whether the function has a computable LLVM signature." The solution here is essentially the same as the way the vtable code handles such functions. llvm-svn: 105151
* IRgen: Add a stub class for generating ABI-specific C++ code.Charles Davis2010-05-251-0/+3
| | | | | | | | 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
* Improve name mangling for blocks and support mangling of static localDouglas Gregor2010-05-251-0/+4
| | | | | | | | | 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-251-0/+2
| | | | | | | | | | | | 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
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-6/+6
| | | | llvm-svn: 101666
* Remove the old vtable layout code.Anders Carlsson2010-03-301-32/+0
| | | | llvm-svn: 99869
* Remove old thunks code.Anders Carlsson2010-03-241-280/+0
| | | | llvm-svn: 99374
* Use the canonical destructor, which fixes the self-host build. Thanks to Eli ↵Anders Carlsson2010-03-231-1/+2
| | | | | | for noticing. llvm-svn: 99260
* 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
OpenPOWER on IntegriCloud