Commit Graph

120 Commits

Author SHA1 Message Date
Anders Carlsson c46bf276e1 Teach AggExprEmitter about pointers to member functions.
llvm-svn: 83266
2009-10-03 15:43:24 +00:00
Anders Carlsson 32bfb1ce8f Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.
llvm-svn: 83263
2009-10-03 14:56:57 +00:00
Anders Carlsson 9150a2a8c0 Handle CK_BaseToDerivedMemberPointer for member function pointers. Fixes PR5091.
llvm-svn: 83041
2009-09-29 03:13:20 +00:00
Anders Carlsson b05a3e551b Improve support for member function pointers.
llvm-svn: 83039
2009-09-29 02:09:01 +00:00
Anders Carlsson 1fb7ae9e3c Use a switch statement in VisitCastExpr.
llvm-svn: 83038
2009-09-29 01:23:39 +00:00
John McCall 8ccfcb51ee Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy.  Demote 'volatile' to extended-qualifier status.  Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right;  many more remain.

llvm-svn: 82705
2009-09-24 19:53:00 +00:00
Anders Carlsson e9766d559b If a cast expression needs either a conversion function or a constructor to be called, generate implicit child expressions that call them.
llvm-svn: 81383
2009-09-09 21:33:21 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Fariborz Jahanian 879d726608 Re-implemented generation of objc_memmove_collectable
API for copying GC'able aggregates (Next runtime only).

llvm-svn: 80607
2009-08-31 19:33:16 +00:00
Fariborz Jahanian 3df8767869 Patch for code gen. for c-style cast which ends in
using class's conversion functions [12.3.2-p2]

llvm-svn: 80433
2009-08-29 19:15:16 +00:00
Fariborz Jahanian c71f094c08 ir-gen for type convesion of class objects. WIP.
llvm-svn: 80178
2009-08-26 23:31:30 +00:00
Fariborz Jahanian 9a84665921 Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.

llvm-svn: 79537
2009-08-20 17:02:02 +00:00
Fariborz Jahanian 88cc2340de Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).

llvm-svn: 79365
2009-08-18 20:50:23 +00:00
Anders Carlsson 5b106a7545 Add an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from being destroyed when they're bound to a reference variable.
llvm-svn: 79179
2009-08-16 07:36:22 +00:00
Owen Anderson 41a750271b Update for LLVM API change.
llvm-svn: 78946
2009-08-13 21:57:51 +00:00
Anders Carlsson ec143777ba Add CK_ToUnion and use it for aggregate expression codegen.
llvm-svn: 78429
2009-08-07 23:22:37 +00:00
Owen Anderson 0b75f23b94 Update for LLVM API change.
llvm-svn: 77722
2009-07-31 20:28:54 +00:00
Mike Stump 658fe02d17 Canonicalize else spacing.
llvm-svn: 77629
2009-07-30 22:28:39 +00:00
Owen Anderson 9793f0e4d7 Update for LLVM API change.
llvm-svn: 77514
2009-07-29 22:16:19 +00:00
Ted Kremenek c23c7e6a51 Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.

llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Owen Anderson b7a2fe6f81 Update for LLVM API change.
llvm-svn: 77012
2009-07-24 23:12:58 +00:00
Mon P Wang acedf7768f Preserve address space information through member accesses, e.g.,
__attribute__((address_space(1))) struct {int arr[ 3 ]; }  *p1;
   ... = p1->arr[2];  // load from address space 1

llvm-svn: 76717
2009-07-22 03:08:17 +00:00
Ted Kremenek 8a286fbdb9 Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.

llvm-svn: 76193
2009-07-17 17:50:17 +00:00
Ted Kremenek b825c0ddc5 Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.
llvm-svn: 76139
2009-07-17 01:20:38 +00:00
Owen Anderson 170229f68d Update for LLVM API change, and contextify a bunch of related stuff.
llvm-svn: 75705
2009-07-14 23:10:40 +00:00
Owen Anderson ae86c19e68 Update for LLVM API change.
llvm-svn: 75446
2009-07-13 04:10:07 +00:00
Anders Carlsson 5b2095ce16 Implement code generation of ChooseExpr for aggregate types.
llvm-svn: 75021
2009-07-08 18:33:14 +00:00
Fariborz Jahanian 5f21d2f69a Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.

llvm-svn: 74984
2009-07-08 01:18:33 +00:00
Argyrios Kyrtzidis cfbfe78e9e De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

llvm-svn: 74506
2009-06-30 02:36:12 +00:00
Anders Carlsson 43c52cdc29 Use PushConditionalTempDestruction/PopConditionalTempDestruction for the ternary operator.
llvm-svn: 72842
2009-06-04 03:00:32 +00:00
Eli Friedman dd27484888 PR4316: Fix IRGen for cast-to-union extension.
llvm-svn: 72803
2009-06-03 20:45:06 +00:00
Anders Carlsson 8eb93e72f7 Emit destructors correctly for temporaries.
llvm-svn: 72655
2009-05-31 00:34:10 +00:00
Anders Carlsson fd2af0cf86 Add lvalue irgen support for CXXBindTemporaryExpr.
llvm-svn: 72649
2009-05-30 23:30:54 +00:00
Anders Carlsson 3be22e27b6 More temporary support.
llvm-svn: 72648
2009-05-30 23:23:33 +00:00
Anders Carlsson 4b2434da54 Remove VarDecl from CXXConstructExpr.
llvm-svn: 72633
2009-05-30 20:56:46 +00:00
Mike Stump df0fe27b66 Fixup the rest of the trivial cases of the codegen of volatile. If
any body can spot codegen bugs with volatile, or knows of any in the
bug database, let me know.

llvm-svn: 72572
2009-05-29 15:46:01 +00:00
Eli Friedman 2a69547f38 PR4281: Fix bogus CodeGen assertion. The issue is that
getUnqualifiedType() doesn't strip off all qualifiers for non-canonical 
types.

llvm-svn: 72552
2009-05-28 23:04:00 +00:00
Fariborz Jahanian 7c1baf46d6 No write-barrier for initializations.
llvm-svn: 72492
2009-05-27 19:54:11 +00:00
Anders Carlsson ddcbfe7b53 IRgen support for calls to functions that return references to aggregate exressions.
llvm-svn: 72479
2009-05-27 16:45:02 +00:00
Mike Stump 3e97f3b35d Fix typo. I also fixed the hard to read case differences, so that no
one else is tempted to copy the style, incorrectly.

llvm-svn: 72448
2009-05-27 01:42:21 +00:00
Mike Stump ec3cbfe8c6 Fixup codegen for volatile structs in the trivial cases (a a=a and a=a=a).
llvm-svn: 72439
2009-05-26 22:03:21 +00:00
Mike Stump 25306cacc6 Esnure that if we have a volatile structure as the destination, that
we actually have a destination.

llvm-svn: 72429
2009-05-26 18:57:45 +00:00
Mike Stump b9f2518626 Propagate volatile for implicit property refernces.
llvm-svn: 72353
2009-05-23 23:52:31 +00:00
Mike Stump 9afc476d4a Propagate volatile around for property references.
llvm-svn: 72352
2009-05-23 23:48:13 +00:00
Mike Stump 5e9e61b8d2 Track volatile aggregate copies better. I'm hoping someone else will decide
how to get the backend to know that the operation is volatile.

llvm-svn: 72348
2009-05-23 22:29:41 +00:00
Mike Stump 332ec2ce81 Fix thinko, and implement aggregate volatile reads.
llvm-svn: 72347
2009-05-23 22:01:27 +00:00
Mike Stump 23abd46b79 More volatile fixes. Can't testcase these yet as ultimately volatile
is still ignored.

llvm-svn: 72344
2009-05-23 21:40:07 +00:00
Mike Stump ca9fc09c61 Collapse a few FIXMEs together and refactor to make fixing the code easier.
llvm-svn: 72342
2009-05-23 20:28:01 +00:00
Mike Stump 8673657275 One step to fixing up codegen for a=b, where a is a volatile struct.
llvm-svn: 72315
2009-05-23 04:13:59 +00:00
Mike Stump a35af82429 Fix typo.
llvm-svn: 72308
2009-05-23 02:02:29 +00:00