summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Emit complete-object constructors for abstract classes in kext mode forJohn McCall2011-05-161-1/+2
| | | | | | reasons that honestly really, really need to be looked into. llvm-svn: 131434
* When emitting the destructor for a class with a vtable, if we can determineAnders Carlsson2011-05-141-12/+1
| | | | | | | | | | that the destructor body is trivial and that all member variables also have either trivial destructors or trivial destructor bodies, we don't need to initialize the vtable pointers since no virtual member functions will be called on the destructor. Fixes PR9181. llvm-svn: 131368
* Don't emit complete constructors for abstract classes. Also, don't emitAnders Carlsson2011-05-081-2/+9
| | | | | | | complete destructors for abstract classes unless the destructor is virtual and thus needs to be in the vtable. llvm-svn: 131068
* Convert the BaseOffset member of BaseSubobject to CharUnits from bits. NoKen Dyck2011-03-241-2/+2
| | | | | | change in functionality intended. llvm-svn: 128190
* Fix three of the four places where I left breadcrumbs to avoid unnecessaryJohn McCall2011-03-091-48/+53
| | | | | | recomputation. llvm-svn: 127322
* Use the "undergoes default argument promotion" bit on parameters toJohn McCall2011-03-091-2/+8
| | | | | | | | | | simplify the logic of initializing function parameters so that we don't need both a variable declaration and a type in FunctionArgList. This also means that we need to propagate the CGFunctionInfo down in a lot of places rather than recalculating it from the FAL. There's more we can do to eliminate redundancy here, and I've left FIXMEs behind to do it. llvm-svn: 127314
* Look through array types when deciding whether a field requires non-trivialJohn McCall2011-02-131-5/+4
| | | | | | destruction in the destructor-aliases logic. Fixes PR 9197. llvm-svn: 125447
* Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall2011-02-081-4/+4
| | | | | | | | Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
* Re-land r124768, with a fix for PR9130.Anders Carlsson2011-02-051-2/+4
| | | | | | We now emit everything except unused implicit virtual member functions when building the vtable. llvm-svn: 124935
* Clean up of -fapple-kext abi code. No change otherwise.Fariborz Jahanian2011-02-031-7/+5
| | | | llvm-svn: 124807
* Revert 124768.Rafael Espindola2011-02-031-4/+2
| | | | | | | 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-031-2/+4
| | | | | | | | | | | 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 support for indirect call to virtuals dtors - wip.Fariborz Jahanian2011-02-011-0/+42
| | | | llvm-svn: 124701
* More work to support -fapple-kext regarding Fariborz Jahanian2011-01-281-1/+3
| | | | | | | indirect vf calls and addition of extra entry at bottom of vtbls. llvm-svn: 124507
* apple kext abi requires all vf calls, including qualifiedFariborz Jahanian2011-01-201-0/+29
| | | | | | vf calls, be made indirect. This patch is towards that goal. llvm-svn: 123922
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-1/+1
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* BuildVirtualCall doesn't need to take a reference to a pointer.Anders Carlsson2010-11-281-1/+1
| | | | llvm-svn: 120252
* Move CGCXXABI functions to CGCXXABI.cppAnders Carlsson2010-11-281-157/+0
| | | | llvm-svn: 120250
* Simplify the logic for emitting guard variables for template staticJohn McCall2010-11-061-3/+3
| | | | | | | | | data members by delaying the emission of the initializer until after linkage and visibility have been set on the global. Also, don't emit a guard unless the variable actually ends up with vague linkage, and don't use thread-safe statics in any case. llvm-svn: 118336
* Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson2010-10-311-1/+1
| | | | | | getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
* Factor out the code for emitting code to load vtable pointer membersDan Gohman2010-10-261-4/+2
| | | | | | so that it's done in one place. llvm-svn: 117386
* Substantially revise how clang computes the visibility of a declaration toJohn McCall2010-10-221-1/+1
| | | | | | | | more closely parallel the computation of linkage. This gets us to a state much closer to what gcc emits, modulo bugs, which will undoubtedly arise in abundance. llvm-svn: 117147
* Fix filename in header comment.Devang Patel2010-10-041-1/+1
| | | | llvm-svn: 115561
* 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
OpenPOWER on IntegriCloud