summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove another unused function.Anders Carlsson2010-05-021-3/+0
| | | | llvm-svn: 102871
* Remove an unused function.Anders Carlsson2010-05-021-6/+0
| | | | llvm-svn: 102870
* As per Chris' request, return the Instruction from EmitCall and add the ↵David Chisnall2010-05-021-2/+1
| | | | | | metadata in the caller. llvm-svn: 102862
* Complete reimplementation of the synthesis for implicitly-defined copyDouglas Gregor2010-05-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assignment operators. Previously, Sema provided type-checking and template instantiation for copy assignment operators, then CodeGen would synthesize the actual body of the copy constructor. Unfortunately, the two were not in sync, and CodeGen might pick a copy-assignment operator that is different from what Sema chose, leading to strange failures, e.g., link-time failures when CodeGen called a copy-assignment operator that was not instantiation, run-time failures when copy-assignment operators were overloaded for const/non-const references and the wrong one was picked, and run-time failures when by-value copy-assignment operators did not have their arguments properly copy-initialized. This implementation synthesizes the implicitly-defined copy assignment operator bodies in Sema, so that the resulting ASTs encode exactly what CodeGen needs to do; there is no longer any special code in CodeGen to synthesize copy-assignment operators. The synthesis of the body is relatively simple, and we generate one of three different kinds of copy statements for each base or member: - For a class subobject, call the appropriate copy-assignment operator, after overload resolution has determined what that is. - For an array of scalar types or an array of class types that have trivial copy assignment operators, construct a call to __builtin_memcpy. - For an array of class types with non-trivial copy assignment operators, synthesize a (possibly nested!) for loop whose inner statement calls the copy constructor. - For a scalar type, use built-in assignment. This patch fixes at least a few tests cases in Boost.Spirit that were failing because CodeGen picked the wrong copy-assignment operator (leading to link-time failures), and I suspect a number of undiagnosed problems will also go away with this change. Some of the diagnostics we had previously have gotten worse with this change, since we're going through generic code for our type-checking. I will improve this in a subsequent patch. llvm-svn: 102853
* Simplify EmitClassAggrMemberwiseCopy.Anders Carlsson2010-05-011-3/+2
| | | | llvm-svn: 102848
* Clean up EmitClassMemberwiseCopy further.Anders Carlsson2010-05-011-2/+1
| | | | llvm-svn: 102846
* Get rid of a parameter from EmitClassMemberwiseCopy.Anders Carlsson2010-05-011-2/+1
| | | | llvm-svn: 102845
* Tweaked EmitCall() to permit the caller to provide some metadata to attach ↵David Chisnall2010-05-011-1/+4
| | | | | | | | to the call site. Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
* Remove an unnecessary parameter from EmitClassCopyAssignment.Anders Carlsson2010-04-301-2/+1
| | | | llvm-svn: 102747
* Remove an unnecessary argument to EmitClassCopyAssignment.Anders Carlsson2010-04-291-2/+1
| | | | llvm-svn: 102674
* IRGen for initialization/destruction ofFariborz Jahanian2010-04-281-0/+2
| | | | | | | ivar class objects (NeXt runtime). (radar 7900343). llvm-svn: 102533
* Revert enough of my patches to fix self-host again :(Anders Carlsson2010-04-251-4/+7
| | | | llvm-svn: 102289
* RenameGetAddressOfBaseOfCompleteClass to ↵Anders Carlsson2010-04-241-7/+8
| | | | | | GetAddressOfDirectBaseInCompleteClass to reflect that it only handles direct bases. llvm-svn: 102284
* More cleanup.Anders Carlsson2010-04-241-4/+3
| | | | llvm-svn: 102282
* Simplify EmitClassMemberwiseCopy now that it's only used for fields.Anders Carlsson2010-04-241-3/+1
| | | | llvm-svn: 102281
* Rename GetAddressOfBaseClass to OldGetAddressOfBaseClass.Anders Carlsson2010-04-241-5/+5
| | | | llvm-svn: 102275
* Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102273
* Add a new GetAddressOfBaseClass overload that takes a base path and. Use it ↵Anders Carlsson2010-04-241-1/+5
| | | | | | for derived-to-base casts. llvm-svn: 102270
* Handle compound assignment expressions (i += j) as lvalues, which isDouglas Gregor2010-04-231-0/+1
| | | | | | | permitted in C++ but not in C. Fixes PR6900. Clang can now handle all of Boost.Lambda's regression tests. llvm-svn: 102170
* Call PerformCopyInitialization to properly initialize the exception temporaryJohn McCall2010-04-221-0/+3
| | | | | | | | | in a throw expression. Use EmitAnyExprToMem to emit the throw expression, which magically elides the final copy-constructor call (which raises a new strict-compliance bug, but baby steps). Give __cxa_throw a destructor pointer if the exception type has a non-trivial destructor. llvm-svn: 102039
* I failed to notice that my last patch wasn't doing as much as it couldJohn McCall2010-04-211-1/+2
| | | | | | | because EmitBranch actually clears the insert point. This version actually accomplishes what I initially wanted. llvm-svn: 101998
* Miscellaneous codegen cleanups. Mostly, don't create new basic blocksJohn McCall2010-04-211-7/+11
| | | | | | | just to save the current insertion state! This change significantly simplifies the IR CFG in exceptions code. llvm-svn: 101996
* Back out r101911 and see if it makes the bots happy.Anders Carlsson2010-04-201-2/+0
| | | | llvm-svn: 101921
* Fix a bug which triggered the assertion I added yesterday. Basically, when ↵Anders Carlsson2010-04-201-0/+2
| | | | | | we initialize the vtable pointer for a virtual base, and there was another path from the most derived class to another base with the same class type, we would use the wrong base. llvm-svn: 101911
* Pass the nearest virtual base decl to InitializeVTablePointers. No ↵Anders Carlsson2010-04-201-4/+4
| | | | | | functionality change right now. llvm-svn: 101872
* Variation of objc_copyStruct API generation whenFariborz Jahanian2010-04-131-0/+1
| | | | | | | property (atomic/nonatomic) is of aggregate type with gc'able member objects) (NeXT runtime). llvm-svn: 101156
* Add support for objc_copyStruct to enforceFariborz Jahanian2010-04-131-0/+1
| | | | | | | atomicity of aggregate properties in setter/getter methods. wip. llvm-svn: 101107
* Minor include pruning.Benjamin Kramer2010-03-311-1/+0
| | | | llvm-svn: 100007
* Factor emitting a call to a copy constructor out into a separate function.Anders Carlsson2010-03-301-3/+4
| | | | llvm-svn: 99866
* Introduce a CXXTemporariesCleanupScope RAII object and use it to cleanup the ↵Anders Carlsson2010-03-301-0/+21
| | | | | | temporaries code. llvm-svn: 99865
* Reapply r99775 with a fix for a silly bug - we were setting the vtable ↵Anders Carlsson2010-03-281-4/+6
| | | | | | pointer for all bases, even those without a vtable pointer :) llvm-svn: 99777
* Looks like I broke self-host again :(.Anders Carlsson2010-03-281-6/+4
| | | | llvm-svn: 99776
* More improvements to setting the vtable pointer. We now no longer set the ↵Anders Carlsson2010-03-281-4/+6
| | | | | | vtable pointer for non-virtual primary bases. We also do a pre-order traversal of the class hierarchy; this is necessary in order to get the right vbase offset offsets in base ctors/dtors. llvm-svn: 99775
* Factor vtable pointer setting code out into a separate function.Anders Carlsson2010-03-281-1/+13
| | | | llvm-svn: 99773
* Simplify InitializeVtablePtrs in preparation of making it work with ↵Anders Carlsson2010-03-261-5/+2
| | | | | | construction vtables. llvm-svn: 99609
* More vtable work; preparations for moving over to the new vtable layout code ↵Anders Carlsson2010-03-241-1/+1
| | | | | | (finally). llvm-svn: 99381
* Remove old thunks code.Anders Carlsson2010-03-241-14/+0
| | | | llvm-svn: 99374
* Add CodeGenFunction::GenerateThunk and implement it.Anders Carlsson2010-03-241-1/+3
| | | | llvm-svn: 99365
* Rename CGVtableInfo to CodeGenVTables in preparation of adding another ↵Anders Carlsson2010-03-231-1/+1
| | | | | | VTableInfo class. llvm-svn: 99250
* C++: Add support for -fno-use-cxa-atexit.Daniel Dunbar2010-03-201-0/+14
| | | | | | | | - So much typing, so little gain... Also, rename the __cxx_global_initialization function just to match llvm-gcc. llvm-svn: 99039
* IRgen: Inline GenerateCXXGlobal[VarDecl]InitFunc into sole caller.Daniel Dunbar2010-03-201-8/+0
| | | | llvm-svn: 99038
* add framework for ARM builtins, Patch by Edmund Grimley Evans!Chris Lattner2010-03-031-0/+1
| | | | llvm-svn: 97656
* Add proper target hooks for __builtin_extract_return_address andJohn McCall2010-03-031-1/+5
| | | | | | | __builtin_frob_return_address. The implementations for both are still trivial in the default case. llvm-svn: 97638
* Unconditionally support block introspection data in a new field at the endBlaine Garst2010-02-231-1/+2
| | | | | | | | | | | | | | | of the block descriptor field. This field is the ObjC style @encode signature of the implementation function, and was to this point conditionally provided in the block literal data structure. That provisional support is removed. Additionally, eliminate unused enumerations for the block literal flags field. The first shipping ABI unconditionally set (1<<29) but this bit is unused by the runtime, so the second ABI will unconditionally have (1<<30) set so that the runtime can in fact distinguish whether the additional data is present or not. llvm-svn: 96989
* Perform two more constructor/destructor code-size optimizations:John McCall2010-02-231-0/+3
| | | | | | | | | | | | | | | | 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
* More refactoring around constructor/destructor code generation.John McCall2010-02-191-16/+13
| | | | | | | | | | | | Fix some bugs with function-try-blocks and simplify normal try-block code generation. This implementation excludes a deleting destructor's call to operator delete() from the function-try-block, which I believe is correct but which I can't find straightforward support for at a moment's glance. llvm-svn: 96670
* Extract out function-body code generation into its own method. No functionalityJohn McCall2010-02-181-9/+5
| | | | | | change. llvm-svn: 96564
* IRgen optimization: cache the value of 'this' and 'vtt' instead ofJohn McCall2010-02-161-2/+10
| | | | | | | | 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
* IRgen: Add CreateIRTemp, which creates a temporary alloca but with type ↵Daniel Dunbar2010-02-161-0/+7
| | | | | | converted "not-for-memory". Dunno a better name. llvm-svn: 96374
* When emitting complete destructors for classes with virtual bases, computeJohn McCall2010-02-161-2/+10
| | | | | | | | | | | | the offset to the virtual bases statically inside of relying on the virtual base offsets in the object's vtable(s). This is both more efficient and sound against the destructor's manipulation of the vtables. Also extract a few helper routines. Oh and we seem to pass all tests with an optimized clang now. llvm-svn: 96327
OpenPOWER on IntegriCloud