summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Tweaked EmitCall() to permit the caller to provide some metadata to attach ↵David Chisnall2010-05-013-11/+28
| | | | | | | | to the call site. Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining. llvm-svn: 102833
* When synthesizing Objective C records, give the synthetic fields publicJohn McCall2010-04-301-1/+1
| | | | | | | | access. Fixes an assertion. Fixes rdar://problem/7927811. Too lazy to reduce a test case. llvm-svn: 102776
* Remove an unnecessary parameter from EmitClassCopyAssignment.Anders Carlsson2010-04-302-13/+7
| | | | llvm-svn: 102747
* Fixed incorrect type of alloca (GNU runtime).David Chisnall2010-04-301-2/+5
| | | | llvm-svn: 102711
* Account for the VTT argument when making an implicit copy constructor forJohn McCall2010-04-301-1/+13
| | | | | | | | | a class with virtual bases. Just a patch until Sema starts (correctly) doing most of this analysis. Fixes PR 6622. llvm-svn: 102692
* Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTIJohn McCall2010-04-303-11/+23
| | | | | | when used by the exceptions routines. Fixes PR 6974. llvm-svn: 102684
* Teach EHCleanupBlock to deal appropriately with the possibility that thereJohn McCall2010-04-301-1/+5
| | | | | | might not have been an insertion block set at start. Fixes PR6975. llvm-svn: 102677
* Get the base class addresses before calling EmitClassCopyAssignment.Anders Carlsson2010-04-301-5/+8
| | | | llvm-svn: 102676
* Remove an unnecessary argument to EmitClassCopyAssignment.Anders Carlsson2010-04-292-11/+8
| | | | llvm-svn: 102674
* Use clang::VarDecl name instead of llvm::GlobalVariable name.Devang Patel2010-04-291-1/+1
| | | | | | llvm::GLobalVariable name may not match user visibile name for function static variables. llvm-svn: 102644
* IRgen/NeXT: Put the synthesized _objc_super, _message_ref_t decls in a valid ↵Daniel Dunbar2010-04-291-2/+4
| | | | | | DeclContext, to satisfy the invariants that should hold on a RecordDecl. llvm-svn: 102624
* Support for construct/destruct of ivar arrayFariborz Jahanian2010-04-281-7/+18
| | | | | | | of c++ objects (NeXt runtime). radar 7900343. llvm-svn: 102546
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-281-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
* IRGen for initialization/destruction ofFariborz Jahanian2010-04-285-0/+92
| | | | | | | ivar class objects (NeXt runtime). (radar 7900343). llvm-svn: 102533
* Changed signature of GenerateMessageSend() function to pass the ↵David Chisnall2010-04-284-17/+31
| | | | | | | | ObjCInterfaceDecl for class messages and removed the boolean IsClassMessage argument, which wasn't used anywhere. Emitted some metadata on message sends to allow a later pass to do some speculative inlining of class methods (GNU runtime). Speculative inlining of instance methods requires type feedback to be useful (work in progress), but for class methods it works quite nicely. llvm-svn: 102514
* Remove unused function.Benjamin Kramer2010-04-281-4/+0
| | | | llvm-svn: 102499
* Emit the correct symbol name for the class (GNU runtime).David Chisnall2010-04-281-5/+7
| | | | llvm-svn: 102497
* Improve name mangling for dependent template names (e.g., typenameDouglas Gregor2010-04-281-15/+77
| | | | | | | | T::template apply<U>), handling a few cases where we previously failed and performing substitutions on such dependent names. Fixes a crash in Boost.PropertyTree. llvm-svn: 102490
* Properly pass the address of a lazily-generated function declaration withJohn McCall2010-04-281-5/+16
| | | | | | incomplete type. Fixes PR6911. llvm-svn: 102473
* Fixed message send to void (broken by my last commit - GNU runtime).David Chisnall2010-04-271-1/+2
| | | | llvm-svn: 102459
* Ensure return from a message to nil is always 0 (GNU runtime).David Chisnall2010-04-271-1/+67
| | | | | | | | | This works around stack corruption / crashes resulting from PR6944, and also works around people who expect 'what works on my machine' to work everywhere (GCC crashes in a number of cases on SPARC that should now work correctly with clang). llvm-svn: 102430
* Fix comments.Daniel Dunbar2010-04-271-3/+3
| | | | llvm-svn: 102429
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-272-1/+7
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* Enable debug info for local variables at -O1+. Devang Patel2010-04-261-12/+1
| | | | llvm-svn: 102398
* emit dtors with the right calling convention in -fno-use-cxa-atexitChris Lattner2010-04-261-3/+8
| | | | | | mode. llvm-svn: 102377
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-262-7/+7
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* IRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:Daniel Dunbar2010-04-251-14/+15
| | | | | | | | | - Fix some places that had the alignment hard coded. - Use ABI type alignment, not preferred type alignment -- neither of this is exactly right, as we really want the C type alignment as required by the runtime, but the ABI alignment is a more correct choice. This should be equivalent for x86_64, but fixes the alignment for ARM. llvm-svn: 102314
* IRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This ↵Daniel Dunbar2010-04-251-32/+9
| | | | | | fixes Clang to correctly emit the "CorrectedSynthesize" bit when using the non-fragile ABI. llvm-svn: 102312
* Land another cleanup patch.Anders Carlsson2010-04-251-14/+8
| | | | llvm-svn: 102293
* Revert enough of my patches to fix self-host again :(Anders Carlsson2010-04-252-41/+83
| | | | llvm-svn: 102289
* Cleanup SynthesizeCXXCopyConstructor.Anders Carlsson2010-04-241-16/+9
| | | | llvm-svn: 102286
* Clean up SynthesizeCXXCopyAssignment a little.Anders Carlsson2010-04-241-15/+11
| | | | llvm-svn: 102285
* RenameGetAddressOfBaseOfCompleteClass to ↵Anders Carlsson2010-04-242-27/+28
| | | | | | GetAddressOfDirectBaseInCompleteClass to reflect that it only handles direct bases. llvm-svn: 102284
* More cleanup.Anders Carlsson2010-04-242-27/+18
| | | | llvm-svn: 102282
* Simplify EmitClassMemberwiseCopy now that it's only used for fields.Anders Carlsson2010-04-242-28/+14
| | | | llvm-svn: 102281
* DefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create ↵Anders Carlsson2010-04-241-12/+0
| | | | | | implicit base initializers. (Member initializers are still handled by CodeGenFunction::SynthesizeCXXCopyConstructor for now). llvm-svn: 102279
* Rename GetAddressOfBaseClass to OldGetAddressOfBaseClass.Anders Carlsson2010-04-242-53/+15
| | | | llvm-svn: 102275
* Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to ↵Anders Carlsson2010-04-245-34/+5
| | | | | | use the new version. llvm-svn: 102274
* Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.Anders Carlsson2010-04-245-23/+31
| | | | llvm-svn: 102273
* Convert more call sites over to the new GetAddressOfBaseClass.Anders Carlsson2010-04-242-11/+7
| | | | llvm-svn: 102272
* Add a new GetAddressOfBaseClass overload that takes a base path and. Use it ↵Anders Carlsson2010-04-243-10/+112
| | | | | | for derived-to-base casts. llvm-svn: 102270
* Fix pasto, add a comment.Benjamin Kramer2010-04-242-1/+2
| | | | llvm-svn: 102263
* Factor code. No functionality change.Benjamin Kramer2010-04-242-137/+38
| | | | llvm-svn: 102262
* NeXT: Clean up dispatch method policy selection.Daniel Dunbar2010-04-241-5/+12
| | | | | | | | | | - Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}. - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp. - No intended functionality change. llvm-svn: 102255
* CastExpr should not hold a pointer to the base path. More cleanup.Anders Carlsson2010-04-241-1/+1
| | | | llvm-svn: 102249
* Fix a place in inline asm lowering which was creating a TruncInst with aDan Gohman2010-04-241-3/+8
| | | | | | | pointer operand. This fixes an abort on MultiSource/Applications/ClamAV/libclamav_mbox.c. llvm-svn: 102238
* Revert accidental check-in.Devang Patel2010-04-241-13/+5
| | | | llvm-svn: 102226
* Revert r102215. This causes clang crash while compiling a test case from gdb ↵Devang Patel2010-04-241-5/+13
| | | | | | testsuite. llvm-svn: 102224
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-232-41/+43
| | | | | | | | | | statements. Instead of the @try having a single @catch, where all of the @catch's were chained (using an O(n^2) algorithm nonetheless), @try just holds an array of its @catch blocks. The resulting AST is slightly more compact (not important) and better represents the actual language semantics (good). llvm-svn: 102221
* More -fno-constant-cfstrings API work.Fariborz Jahanian2010-04-231-4/+9
| | | | llvm-svn: 102219
OpenPOWER on IntegriCloud