aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGClass.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-2/+2
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-07-18de-constify llvm::Type, patch by David Blaikie!Chris Lattner1-13/+13
llvm-svn: 135370
2011-07-13Arrays are permitted to be zero-length in some situations.John McCall1-1/+27
llvm-svn: 135036
2011-07-13Convert the standard default-construction loops to use phis andJohn McCall1-72/+73
partial destruction. llvm-svn: 135033
2011-07-13Aggressive dead code elimination.John McCall1-72/+0
llvm-svn: 135029
2011-07-12Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall1-7/+7
of flags. No functionality change. llvm-svn: 134997
2011-07-12Switch field destruction over to use the new destroyer-based APIJohn McCall1-68/+28
and kill a lot of redundant code. llvm-svn: 134988
2011-07-09A number of array-related IR-gen cleanups.John McCall1-0/+11
- Emit default-initialization of arrays that were partially initialized with initializer lists with a loop, rather than emitting the default initializer N times; - support destroying VLAs of non-trivial type, although this is not yet exposed to users; and - support the partial destruction of arrays initialized with initializer lists when an initializer throws an exception. llvm-svn: 134784
2011-06-25LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall1-1/+1
by removing the redundant type parameter. llvm-svn: 133860
2011-06-16Restore correct use of GC barriers.John McCall1-6/+3
llvm-svn: 133144
2011-06-15Automatic Reference Counting.John McCall1-37/+56
Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
2011-06-11Implement support for C++11 in-class initialization of non-static data members.Richard Smith1-0/+1
llvm-svn: 132878
2011-05-16Fix another regression from the "skip vtable pointer initialization"Anders Carlsson1-1/+1
optimization. Make sure to require a vtable when trying to get the address of a VTT, otherwise we would never end up emitting the VTT. llvm-svn: 131400
2011-05-15Re-enable the fix for PR9181 now that all the edge cases are handled.Anders Carlsson1-18/+70
llvm-svn: 131385
2011-05-15Disable the optimization until the bug noticed by Sean Hunt has been fixed.Anders Carlsson1-0/+4
llvm-svn: 131372
2011-05-14When emitting the destructor for a class with a vtable, if we can determineAnders Carlsson1-1/+34
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
2011-05-08Move code to emit the callee of an CXXOperatorCallExpr out into a separate ↵Anders Carlsson1-0/+133
function in CGClass.cpp llvm-svn: 131075
2011-05-03Ensure that destructors are properly inovked when an exception leavesAlexis Hunt1-1/+27
the body of a delegating constructor call. This means that the delegating constructor implementation should be complete and correct, though there are some rough edges (diagnostic quality with the cycle detection and using a deleted destructor). llvm-svn: 130803
2011-05-03Fix delegating constructors stylistic issues.Alexis Hunt1-4/+5
Material bugfixes to come this afternoon. llvm-svn: 130782
2011-05-02Simplify code a bit by using CallArgList::add. No intended functionality ↵Eli Friedman1-6/+4
change. llvm-svn: 130699
2011-05-01Fully implement delegating constructors!Alexis Hunt1-1/+23
As far as I know, this implementation is complete but might be missing a few optimizations. Exceptions and virtual bases are handled correctly. Because I'm an optimist, the web page has appropriately been updated. If I'm wrong, feel free to downgrade its support categories. llvm-svn: 130642
2011-04-28When block-capturing a variable with a non-trivial destructor,John McCall1-0/+1
make sure to mark the destructor. This normally isn't required, because the destructor should have been marked as part of the declaration of the local, but it's necessary when the variable is a parameter because it's the call sites that are responsible for those destructors. llvm-svn: 130372
2011-04-11Replace a couple of Builder.CreateICmpEQ with Builder.CreateIsNull. No ↵Anders Carlsson1-6/+2
functionality change. llvm-svn: 129261
2011-04-07[Reapply r128776, modified so that it does not break debug info.]Ken Dyck1-2/+3
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to CharUnits. No change in functionality intended. llvm-svn: 129072
2011-04-04Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.Devang Patel1-3/+2
llvm-svn: 128842
2011-04-02Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() toKen Dyck1-2/+3
CharUnits. No change in functionality intended. llvm-svn: 128776
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad1-4/+2
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128538
2011-03-24Convert the BaseOffset member of BaseSubobject to CharUnits from bits. NoKen Dyck1-11/+8
change in functionality intended. llvm-svn: 128190
2011-03-23Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) toKen Dyck1-12/+13
CharUnits. No change in functionality intended. llvm-svn: 128129
2011-03-23Convert NonVirtual parameter of ApplyNonVirtualAndVirtualOffset() toKen Dyck1-8/+11
CharUnits. No change in functionality intended. llvm-svn: 128126
2011-03-22Convert Offset variable in GetAddressOfDirectBaseInCompleteClass() toKen Dyck1-5/+5
CharUnits. No change in functionality intended. llvm-svn: 128060
2011-03-22Change return value of ComputeNonVirtualBaseClassOffset() to CharUnits. NoKen Dyck1-13/+13
change in functionality intended. llvm-svn: 128050
2011-03-11Use a slightly more semantic interface for emitting call arguments.John McCall1-10/+4
llvm-svn: 127494
2011-03-09Use the "undergoes default argument promotion" bit on parameters toJohn McCall1-5/+4
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
2011-02-28Get rid of the areExceptionsEnabled() getter from LangOptions.Anders Carlsson1-2/+2
llvm-svn: 126598
2011-02-22A constructor call should force class's debug info even if ↵Devang Patel1-0/+11
-flimit-debug-info is enabled. llvm-svn: 126246
2011-02-20Add a LangOptions::areExceptionsEnabled and start using it.Anders Carlsson1-2/+3
llvm-svn: 126062
2011-02-08Reorganize CodeGen{Function,Module} to eliminate the unfortunateJohn McCall1-3/+0
Block{Function,Module} base class. Minor other refactorings. Fixed a few address-space bugs while I was there. llvm-svn: 125085
2011-02-03Clean up of -fapple-kext abi code. No change otherwise.Fariborz Jahanian1-1/+2
llvm-svn: 124807
2011-02-02-fapple-kext, elimination of all direct calls to virtual dtors.Fariborz Jahanian1-0/+4
llvm-svn: 124757
2011-02-01-fapple-kext support for indirect call to virtuals dtors - wip.Fariborz Jahanian1-1/+6
llvm-svn: 124701
2011-01-29Make emitting a VTT a two-step process, much like emitting a VTable. You ↵Anders Carlsson1-1/+1
first get the address of the VTT, and then pass it to EmitVTTDefinition. llvm-svn: 124539
2011-01-29When doing a derived-to-base class through a virtual class, we don't have to ↵Anders Carlsson1-2/+11
get the vbase offset from the vtable if the derived class is marked final. llvm-svn: 124523
2011-01-08Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt1-6/+6
more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
2010-12-04More anonymous struct/union redesign. This one deals with anonymous field ↵Francois Pichet1-6/+6
used in a constructor initializer list: struct X { X() : au_i1(123) {} union { int au_i1; float au_f1; }; }; clang will now deal with au_i1 explicitly as an IndirectFieldDecl. llvm-svn: 120900
2010-11-13Block API patch to do copy ctor of copied-in cxx objects inFariborz Jahanian1-0/+58
copy helper function and dtor of copied cxx objects in dispose helper functions. __block variables TBD next. llvm-svn: 119011
2010-10-31Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a ↵Anders Carlsson1-7/+9
getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset. llvm-svn: 117881
2010-10-26Factor out the code for emitting code to load vtable pointer membersDan Gohman1-4/+7
so that it's done in one place. llvm-svn: 117386
2010-10-15Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall1-1/+1
ambiguous context. llvm-svn: 116567
2010-09-17Currently we're initializing the vtable pointers of a class only afterJohn McCall1-0/+30
the bases are completely initialized. This won't work --- base initializer expressions can rely on the vtables having been set up. Check for uses of 'this' in the initializers and force a vtable initialization if found. This might not be good enough; we might need to extend this to handle the possibility of arbitrary code finding an external reference to this (not yet completely-constructed!) object and accessing through it, in which case we'll probably find ourselves doing a lot more unnecessary stores. llvm-svn: 114153