Fariborz Jahanian
43a40f9399
Objective-C++ Code gen. Handle code gen. for property
...
reference dot-syntax notation in a varierty of cases.
Fixes radar 7964490.
llvm-svn: 103440
2010-05-10 22:57:35 +00:00
Anders Carlsson
f8a71f08d1
Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.
...
llvm-svn: 102882
2010-05-02 23:29:11 +00:00
Anders Carlsson
8a64c1c94c
Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.
...
llvm-svn: 102273
2010-04-24 21:23:59 +00:00
Anders Carlsson
c6eaea70af
Convert more call sites over to the new GetAddressOfBaseClass.
...
llvm-svn: 102272
2010-04-24 21:12:55 +00:00
Douglas Gregor
914af2182b
Handle compound assignment expressions (i += j) as lvalues, which is
...
permitted in C++ but not in C. Fixes PR6900. Clang can now handle all
of Boost.Lambda's regression tests.
llvm-svn: 102170
2010-04-23 04:16:32 +00:00
John McCall
2e6567ae60
Call PerformCopyInitialization to properly initialize the exception temporary
...
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
2010-04-22 01:10:34 +00:00
John McCall
2188696d98
Miscellaneous codegen cleanups. Mostly, don't create new basic blocks
...
just to save the current insertion state! This change significantly
simplifies the IR CFG in exceptions code.
llvm-svn: 101996
2010-04-21 10:05:39 +00:00
Fariborz Jahanian
4d55b2d049
Some renaming of methods, fixes typo
...
(related to PR6769).
llvm-svn: 101794
2010-04-19 18:15:02 +00:00
Fariborz Jahanian
3fef72f0ba
Local static variables must be available module-wise
...
as they are accessible in static methods in a class
local to the same function. Fixes PR6769.
llvm-svn: 101756
2010-04-18 21:01:23 +00:00
Anders Carlsson
8345a70c67
Fix an assert when assigning a boolean value to a bitfield of type _Bool.
...
llvm-svn: 101678
2010-04-17 21:52:22 +00:00
Daniel Dunbar
67aba79b74
IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
...
- Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job.
- No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit.
The new fixes from r101222 are:
1. The shift to the target position needs to occur after the value is extended to the correct size. This broke Clang bootstrap, among other things no doubt.
2. Swap the order of arguments to OR, to get a tad more constant folding.
llvm-svn: 101339
2010-04-15 03:47:33 +00:00
Daniel Dunbar
91ea6ac3e9
Speculatively revert "IRgen: Move EmitStoreThroughBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.", I think it might be breaking bootstrap.
...
llvm-svn: 101235
2010-04-14 05:48:35 +00:00
Daniel Dunbar
230e1541b3
IRgen: Move EmitStoreThroughBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
...
- Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job.
- No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit.
llvm-svn: 101222
2010-04-14 04:08:03 +00:00
Daniel Dunbar
3447a02d5f
IRgen: Move EmitLoadOfBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
...
- This lets the method focus slightly more on emitting clean IR to honor the policy which has been selected. On 403.gcc's combine.c, x86_64, -O0, this reduces the number of lines in the .ll file (~= # of instructions) by 2.5%.
- No intended functionality change -- at -O3 this should produce equivalent if not identical output. On 403.gcc's combine.c, x86_64, -O3, this isn't quite true and some of the changes are regressions, but I'm not going to worry about that until we move to a new access policy.
- There is still some room for improvement in the generated IR, in particular we can usually fold the sign-extension of the bit-field into one of the component access. See the FIXME.
llvm-svn: 101192
2010-04-13 23:34:15 +00:00
Chris Lattner
bc3be65d2e
fix PR6805: llvm.objectsize changed to take an i1 instead of an i32.
...
llvm-svn: 100938
2010-04-10 18:34:14 +00:00
Daniel Dunbar
c75c8bd757
IRgen: Move the bit-field access type into CGBitFieldInfo, and change bit-field LValues to just store the base address of object containing the bit-field.
...
llvm-svn: 100745
2010-04-08 02:59:45 +00:00
Daniel Dunbar
196ea449ed
IRgen: Move BitFieldIsSigned bit into CGBitFieldInfo.
...
llvm-svn: 100513
2010-04-06 01:07:44 +00:00
Daniel Dunbar
60d81e8611
Simplify.
...
llvm-svn: 100511
2010-04-06 01:07:39 +00:00
Daniel Dunbar
dc406b8e92
IRgen: Move BitField LValues to just hold a reference to the CGBitFieldInfo.
...
- Unfortunately, this requires some horrible code in CGObjCMac which always
allocats a CGBitFieldInfo because we don't currently build a proper layout
for Objective-C classes. It needs to be cleaned up, but I don't want the
bit-field cleanups to be blocked on that.
llvm-svn: 100474
2010-04-05 21:36:35 +00:00
Daniel Dunbar
cd3d5e76ce
IRgen: Lift BitFieldInfo to CGBitFieldInfo at namespace level.
...
llvm-svn: 100433
2010-04-05 16:20:44 +00:00
Daniel Dunbar
034299ef25
IRGen: Move the auxiliary data structures tracking AST -> LLVM mappings out of CodeGenTypes, to per-record CGRecordLayout structures.
...
- I did a cursory check that this was perf neutral, FWIW.
llvm-svn: 99978
2010-03-31 01:09:11 +00:00
John McCall
d9c7c6568e
Introduce a new kind of derived-to-base cast which bypasses the need for
...
null checks, and make sure we elide null checks when accessing base class
members.
llvm-svn: 99963
2010-03-30 23:58:03 +00:00
Daniel Dunbar
f4ffa0dabf
Minor formatting/FIXME cleanups.
...
llvm-svn: 99944
2010-03-30 22:26:07 +00:00
Rafael Espindola
2e42fec3a0
Fix PR6473.
...
Clang's support for weakref is now better than llvm-gcc's :-)
We don't introduce a new symbol and we correctly mark undefined references weak only if there is no
definition or regular undefined references in the same file.
llvm-svn: 97733
2010-03-04 18:17:24 +00:00
Daniel Dunbar
d004918ccb
IRgen: Add CreateIRTemp, which creates a temporary alloca but with type converted "not-for-memory". Dunno a better name.
...
llvm-svn: 96374
2010-02-16 19:44:13 +00:00
Daniel Dunbar
27bacafb71
IRgen: Switch EmitCompoundLiteralLValue to use CreateMemTemp.
...
llvm-svn: 96373
2010-02-16 19:43:39 +00:00
John McCall
7538eec67b
When emitting an aggregate into a temporary, make sure we set the alignment
...
on the alloca.
The fact that codegen makes this class of bug so wonderfully easy to make is
embarrassing.
llvm-svn: 96204
2010-02-15 01:23:36 +00:00
Anders Carlsson
5bd8d19291
More vtable layout dumper improvements. Handle destructors, dump the complete function type of the member functions (using PredefinedExpr::ComputeName.
...
llvm-svn: 95887
2010-02-11 18:20:28 +00:00
Daniel Dunbar
a7566f163a
IRgen: Add CreateMemTemp, for creating an temporary memory object for a particular type, and flood fill. - CreateMemTemp sets the alignment on the alloca correctly, which fixes a great many places in IRgen where we were doing the wrong thing.
...
- This fixes many many more places than the test case, but my feeling is we need to audit alignment systematically so I'm not inclined to try hard to test the individual fixes in this patch. If this bothers you, patches welcome!
PR6240.
llvm-svn: 95648
2010-02-09 02:48:28 +00:00
Daniel Dunbar
3d33fab7fc
Reapply r95393, without the change to CGExpr. I was wrong in assuming that the
...
element type always matched the converted LLVM type for ExprType.
llvm-svn: 95596
2010-02-08 22:53:07 +00:00
John McCall
ab26cfa58d
Standardize the parsing of function type attributes in a way that
...
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().
llvm-svn: 95436
2010-02-05 21:31:56 +00:00
Douglas Gregor
a643780483
Revert r95393, which broke Clang's self-host.
...
llvm-svn: 95430
2010-02-05 21:10:36 +00:00
Daniel Dunbar
9c4e4651d5
IRgen: A few more ConvertType cleanups.
...
llvm-svn: 95423
2010-02-05 20:02:42 +00:00
Daniel Dunbar
d0bc7b9d13
IRgen: Factor out EmitAggExprToLValue.
...
llvm-svn: 95416
2010-02-05 19:38:31 +00:00
Daniel Dunbar
8848175547
IRgen: Fix some CreateTempAlloca calls to use ConvertTypeForMem when that is
...
conceptually correct. Review appreciated (Chris, Eli, Anders).
llvm-svn: 95401
2010-02-05 18:56:49 +00:00
Charles Davis
5a5473f0f8
Now that we store calling conventions in the types, use them instead of
...
getting the calling convention from the target function, which may or may not
exist. Fixes PR5280.
llvm-svn: 95399
2010-02-05 18:13:10 +00:00
Daniel Dunbar
363589bded
IRgen: Use hasAggregateLLVMType instead of isSingleValueType() for cases that
...
need to deal with aggregates specially; this is consistent with the rest of IRgen.
Also, simplify EmitParmDecl and don't worry about using Decl::getNameAsString.
llvm-svn: 95393
2010-02-05 17:51:33 +00:00
Anders Carlsson
824e0613de
When binding an lvalue to a reference, we always need to pop temporaries.
...
With this fix, and the other fixes committed today a make check-all with a clang-built LLVM now gives:
Expected Passes : 6933
Expected Failures : 46
Unsupported Tests : 40
Unexpected Failures: 27
which means that we pass 99.96% of all tests :) The resulting 27 tests are all LLVMC tests and seem to be because of differences in the clang and gcc drivers.
llvm-svn: 95313
2010-02-04 17:32:58 +00:00
Anders Carlsson
9b942c65a5
Fix a bug where we would not mark temporaries as conditional when emitting a conditional operator as an lvalue.
...
llvm-svn: 95311
2010-02-04 17:26:01 +00:00
Anders Carlsson
3b227bd629
Revert the new reference binding code; I came up with a way simpler solution for the reference binding bug that is preventing self-hosting.
...
llvm-svn: 95223
2010-02-03 16:38:03 +00:00
Anders Carlsson
259688ce29
Move pointer to data member emission to CodeGenModule and use it in CGExprConstant. Fixes PR5674.
...
llvm-svn: 95063
2010-02-02 03:37:46 +00:00
Anders Carlsson
ab0ddb57b1
Start creating CXXBindReferenceExpr nodes when binding complex types to references.
...
llvm-svn: 94964
2010-01-31 18:34:51 +00:00
Anders Carlsson
db78f0ad04
Add a new EmitLValueForFieldInitialization that will be used for initializing fields (and reference type fields in particular).
...
llvm-svn: 94799
2010-01-29 05:24:29 +00:00
Anders Carlsson
5d8645b150
Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).
...
llvm-svn: 94798
2010-01-29 05:05:36 +00:00
Anders Carlsson
ba6c437d52
Add an CXXBindReferenceExpr (not used just yet).
...
llvm-svn: 94791
2010-01-29 02:39:32 +00:00
Ken Dyck
e5402e4749
Use CharUnits for alignment in EmitNullInitializationLValue().
...
llvm-svn: 94563
2010-01-26 18:35:11 +00:00
Ken Dyck
40775003e6
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
...
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Chris Lattner
bb8976e36e
implement codegen support for preinc as an lvalue, PR5514.
...
llvm-svn: 93076
2010-01-09 21:44:40 +00:00
Chris Lattner
116ce8f172
refactor pre/postinc logic into CGF and require the caller to pass in the
...
lvalue to poke, no functionality change.
llvm-svn: 93075
2010-01-09 21:40:03 +00:00
Daniel Dunbar
5b9019515a
Fix -Asserts warning.
...
llvm-svn: 92491
2010-01-04 18:02:28 +00:00
Eli Friedman
b8841af8bd
Minor optimization; emit proper unsupported messages for a couple of cases.
...
llvm-svn: 92153
2009-12-25 06:17:05 +00:00
Eli Friedman
2e06e8bbcc
Some small improvements to dead code elimination; helps a bit on
...
LLVM-Code-Symbols test.
llvm-svn: 92152
2009-12-25 05:29:40 +00:00
Anders Carlsson
bfb3671b25
Pass the return value slot to all call exprs.
...
llvm-svn: 92145
2009-12-24 21:13:40 +00:00
Anders Carlsson
1749083e2e
Fill in the return value slot in CGExprAgg::VisitCallExpr. This takes us halfway towards fixing PR5824.
...
llvm-svn: 92142
2009-12-24 20:40:36 +00:00
Anders Carlsson
61a401caec
Pass ReturnValueSlot to EmitCall. No functionality change yet.
...
llvm-svn: 92138
2009-12-24 19:25:24 +00:00
Anders Carlsson
0435ed5875
Add a ReturnValueSlot class. Change the argument order in EmitCall to match the other overload better.
...
llvm-svn: 92136
2009-12-24 19:08:58 +00:00
Chris Lattner
f0a9ba37d4
simplify my previous patch.
...
llvm-svn: 92057
2009-12-23 21:33:41 +00:00
Chris Lattner
4e1a323b85
fix opencl extvector element extraction on rvalues. We previously
...
error_unsupported on test10 and crashed on test11.
llvm-svn: 92056
2009-12-23 21:31:11 +00:00
Eli Friedman
357e8c94d6
Fix for PR5524: make reference binding in default argument work correctly.
...
llvm-svn: 91733
2009-12-19 00:20:10 +00:00
Mike Stump
3f6f9febad
Implement additional undefined checks for additional loads and stores. WIP.
...
llvm-svn: 91498
2009-12-16 02:57:00 +00:00
Fariborz Jahanian
2b9fc83db5
Fixes a code gen bug related to accessing a now
...
non-existing 'isa' field of a non-existing struct type
all related to legacy type definition for 'id' which we have
dropped in clang in favor of a built-in type.
(fixes radar 7470820).
llvm-svn: 91455
2009-12-15 21:34:52 +00:00
Anders Carlsson
6e997b2993
ShouldDestroyTemporaries? I don't think so.
...
llvm-svn: 91450
2009-12-15 20:51:39 +00:00
Mike Stump
cf16d2cc42
Fix spacing.
...
llvm-svn: 91386
2009-12-15 01:22:35 +00:00
Mike Stump
9a4e0128a8
Ensure we preserve line information for each trap for
...
-fcatch-undefined-behavior if we aren't optimizing. WIP.
llvm-svn: 91382
2009-12-15 00:59:40 +00:00
Mike Stump
e8c3b3eca4
Switch codegen for -fcatch-undefined-bahavior over to __builtin_trap
...
instead of abort to improve codesize and codegen.
llvm-svn: 91374
2009-12-15 00:35:12 +00:00
Mike Stump
590d18f103
We have to allow one to form an address for one past the end. WIP.
...
llvm-svn: 91347
2009-12-14 22:14:31 +00:00
Mike Stump
f8858af909
Simplifiy.
...
llvm-svn: 91324
2009-12-14 20:52:00 +00:00
Mike Stump
d954638f02
Implement runtime checks for undefined behavior. WIP.
...
This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:
T a[I];
a[i] abort when i < 0 or i >= I.
Future stuff includes shifts by >= bitwidth amounts.
llvm-svn: 91198
2009-12-12 01:27:46 +00:00
Eli Friedman
68396b16f6
Move the code for converting a member pointer to a bool so that it is usable
...
for logical not.
llvm-svn: 91112
2009-12-11 09:26:29 +00:00
Anders Carlsson
0c6a7d8f42
When extending the lifetime of a temporary, make sure to emit a branch to the cleanup exit block. This fixes a broken module error in LLVMCConfigurationEmitter.cpp.
...
llvm-svn: 91086
2009-12-11 01:00:09 +00:00
Fariborz Jahanian
531c16f9fb
Code gen for ObjCIsaExpr AST used as lvalue.
...
(fixes radar 7457534).
llvm-svn: 90995
2009-12-09 23:35:29 +00:00
Mike Stump
aff69af918
Add cleanups for exceptional edges. WIP.
...
llvm-svn: 90940
2009-12-09 03:35:49 +00:00
Eli Friedman
8aaff69e86
Fix some direct checks of expressions which might be surrounded by parentheses.
...
llvm-svn: 90825
2009-12-08 02:09:46 +00:00
Eli Friedman
5445f6e5b6
Make the comma operator consistently call EnsureInsertPoint.
...
llvm-svn: 90799
2009-12-07 20:18:11 +00:00
Chris Lattner
72ecc68e11
use new helpers to simplify code.
...
llvm-svn: 90709
2009-12-06 17:22:42 +00:00
Eli Friedman
b2b120f664
Make EmitStoreOfScalar generate a more sane representation of boolean stores.
...
"Fixes" PR5645.
llvm-svn: 90272
2009-12-01 22:31:51 +00:00
Daniel Dunbar
c76493a65d
Don't pass false (default) for isVolatile parameter to CreateLoad.
...
llvm-svn: 90098
2009-11-29 21:23:36 +00:00
Eli Friedman
d15eb34d4b
Implement IRGen for MemberExpr referring to static member function.
...
llvm-svn: 89938
2009-11-26 06:08:14 +00:00
Douglas Gregor
7bab5ff8e7
Eliminate CXXConditionDeclExpr with extreme prejudice.
...
All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).
Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting
Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.
llvm-svn: 89817
2009-11-25 00:27:52 +00:00
Douglas Gregor
48a409eb39
Rename CleanupScope -> DelayedCleanupBlock. No functionality change.
...
llvm-svn: 89769
2009-11-24 16:21:10 +00:00
Anders Carlsson
8c793172c2
Handle base-to-derived casts. Will land test case shortly.
...
llvm-svn: 89678
2009-11-23 17:57:54 +00:00
Eli Friedman
928a567af1
Clean up EmitPointerToDataMemberBinaryExpr a bit.
...
llvm-svn: 89197
2009-11-18 05:01:17 +00:00
Anders Carlsson
cfd3012756
More const is always good.
...
llvm-svn: 89033
2009-11-17 03:57:07 +00:00
Mike Stump
65511704f7
Implement most of dynamic_cast. WIP.
...
llvm-svn: 88901
2009-11-16 06:50:58 +00:00
Eli Friedman
8c98dffd1f
Some minor cleanup for EmitCastLValue.
...
llvm-svn: 88894
2009-11-16 05:48:01 +00:00
Mike Stump
c9b231c8d1
Implement typeid for class types.
...
llvm-svn: 88843
2009-11-15 08:09:41 +00:00
Anders Carlsson
50cb321fdc
Handle CK_BitCast in EmitCastLValue.
...
llvm-svn: 88810
2009-11-14 21:21:42 +00:00
Anders Carlsson
52ce3bbf57
Handle CXXDefaultArgExprs in EmitLValue. Fixes PR5484.
...
llvm-svn: 88735
2009-11-14 01:51:50 +00:00
Eli Friedman
a72bf0fae8
Explicitly note that pre-inc/dec lvalues are not supported yet, so that it
...
doesn't crash. (Such expressions are valid in C++, but not in C.)
llvm-svn: 86513
2009-11-09 04:20:47 +00:00
Daniel Dunbar
7e215ea165
Add clarifying parens.
...
llvm-svn: 86457
2009-11-08 09:46:46 +00:00
Anders Carlsson
5bbdc9f857
Handle member expressions where the member declaration is actually a static variable. Fixes PR5392.
...
llvm-svn: 86414
2009-11-07 23:16:50 +00:00
Anders Carlsson
ea4c30b39a
More LValue related code cleanup.
...
llvm-svn: 86413
2009-11-07 23:06:58 +00:00
Anders Carlsson
2ff6395ddc
More cleanup, the code is much easier to follow now.
...
llvm-svn: 86412
2009-11-07 22:53:10 +00:00
Anders Carlsson
6eee97276b
Reduce nesting, no functionality change.
...
llvm-svn: 86411
2009-11-07 22:46:42 +00:00
Anders Carlsson
03f83e58f7
We only need to call SetObjCNonGC for local variables. No functionality change.
...
llvm-svn: 86410
2009-11-07 22:43:34 +00:00
Anders Carlsson
509850ebec
Change EmitPointerToDataMemberLValue to take a FieldDecl. No intended functionality change.
...
llvm-svn: 86407
2009-11-07 22:00:15 +00:00
Chris Lattner
ab5e0af8bc
random tidying
...
llvm-svn: 85408
2009-10-28 17:39:19 +00:00
Chris Lattner
5e71d43155
adjust for a pending LLVM change.
...
llvm-svn: 85373
2009-10-28 05:12:07 +00:00
Fariborz Jahanian
038374f887
Add Code gen support for '->*' operator which fell
...
through the crack.
llvm-svn: 85160
2009-10-26 21:58:25 +00:00
Douglas Gregor
4bd90e53c2
Eliminate QualifiedDeclRefExpr, which captured the notion of a
...
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,
namespace N { int i; }
int j = N::i;
Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.
Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.
llvm-svn: 84962
2009-10-23 18:54:35 +00:00
John McCall
6fd4c23324
Emit calls using the canonical prototype of the called function.
...
llvm-svn: 84947
2009-10-23 08:22:42 +00:00
Fariborz Jahanian
ffba662dd2
Complete code gen for '.*' binary expression for
...
both scalar and aggregates.
llvm-svn: 84910
2009-10-22 22:57:31 +00:00
Fariborz Jahanian
b25817ac1f
Expand on code gen. for pointer to data members so it works
...
for base classe members as well. Test case enhanced for this.
llvm-svn: 84780
2009-10-21 21:01:47 +00:00
Fariborz Jahanian
4ebdff5e1c
Code gen for pointer-to-datamember - WIP.
...
llvm-svn: 84771
2009-10-21 18:38:00 +00:00
Fariborz Jahanian
e4d94cee05
Code-gen for CXXZeroInitValueExpr AST passed
...
as argument to a function call. Removes a FIXME.
llvm-svn: 84694
2009-10-20 23:29:04 +00:00
Anders Carlsson
0999aafda5
Handle emitting the assignment operator when the lhs is a reference. Fixes PR5227.
...
llvm-svn: 84518
2009-10-19 18:28:22 +00:00
Daniel Dunbar
b5aacc282c
Twinify CodeGenFunction::CreateTempAlloca
...
llvm-svn: 84456
2009-10-19 01:21:05 +00:00
Anders Carlsson
69c2c4becc
When binding a reference to a temporary, it's important that other temporaries created as on the RHS are destroyed before emitting the dtor for the temporary.
...
llvm-svn: 84451
2009-10-18 23:09:21 +00:00
Anders Carlsson
66413c29d3
Handle
...
struct A { };
struct B : A { };
void f() {
const A& a = B();
}
correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).
llvm-svn: 84162
2009-10-15 00:51:46 +00:00
Benjamin Kramer
abd5b90e4c
Simplify pointer creation with the new Type::getInt*Ptr methods.
...
llvm-svn: 83964
2009-10-13 10:07:13 +00:00
Devang Patel
dac79decf3
There is no need to attach debug location info with alloca instruction.
...
llvm-svn: 83913
2009-10-12 22:29:02 +00:00
Devang Patel
5d90d62701
Add support to attach debug info to an instruction.
...
This is not yet enabled.
llvm-svn: 83399
2009-10-06 18:36:08 +00:00
Fariborz Jahanian
e01e434aef
<rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
...
llvm-svn: 83150
2009-09-30 17:10:29 +00:00
Fariborz Jahanian
1f9ed58277
Fixed another code gen bug in objc's new write-barrier API.
...
llvm-svn: 82735
2009-09-25 00:00:20 +00:00
Fariborz Jahanian
7a95d72b10
Patch fixes a code gen. bug in generation of objc_assign_ivar
...
(objc GC's API).
llvm-svn: 82724
2009-09-24 22:25:38 +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
John McCall
9dd450bb78
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
...
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.
The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.
llvm-svn: 82501
2009-09-21 23:43:11 +00:00
Fariborz Jahanian
71848a3ff1
Removed -fobjc-newgc-api option. clang now conforms to
...
gcc-style write-barrier api only.
llvm-svn: 82493
2009-09-21 23:03:37 +00:00
Fariborz Jahanian
38c3ae9bc4
Miscellanous fixes in generatation of objc gc's write-barriers.
...
llvm-svn: 82472
2009-09-21 18:54:29 +00:00
Fariborz Jahanian
2e32ddc7ba
Fixed a bug in generation of the new write-barriers when
...
array syntax is used to derefernce and assign to ivar pointee.
llvm-svn: 82183
2009-09-18 00:04:00 +00:00
Fariborz Jahanian
de1d324dce
patch for generating objc'2 objc_assign_ivar. WIP.
...
llvm-svn: 82090
2009-09-16 23:11:23 +00:00
Fariborz Jahanian
a7fa6beb2e
Starting patch to generate more specific API for objc's
...
GC. Currently, new API will be generated under
clang-cc's -fobjc-newgc-api flag which will eventually
become the default. WIP.
llvm-svn: 82082
2009-09-16 21:37:16 +00:00
Fariborz Jahanian
4141deb68e
Removed a superfluous check before setting
...
a flag (objc GC).
llvm-svn: 82052
2009-09-16 16:49:08 +00:00
Anders Carlsson
1450adbbf9
Code generation of Conditional operators that are lvalues (but that aren't bitfields).
...
llvm-svn: 81867
2009-09-15 16:35:24 +00:00
Anders Carlsson
96bad9a5cd
Implement CodeGenFunction::EmitCXXExprWithTemporariesLValue.
...
llvm-svn: 81738
2009-09-14 01:10:45 +00:00
Daniel Dunbar
0482cfd790
Don't use the PredefinedExpr string as the global variable name, these don't
...
make very nice symbols, just use the function name.
llvm-svn: 81653
2009-09-12 23:06:21 +00:00
Anders Carlsson
d95f9608ab
Handle CK_DerivedToBase when emitting lvalue casts.
...
llvm-svn: 81614
2009-09-12 16:16:49 +00:00
Anders Carlsson
f8e94f2008
Add support for __block variables with alignment greater than __alignof(void *).
...
llvm-svn: 81602
2009-09-12 02:44:18 +00:00
Douglas Gregor
15fc956ca0
Remove unnecessary ASTContext parameter from FunctionDecl::isBuiltinID
...
llvm-svn: 81590
2009-09-12 00:22:50 +00:00
Daniel Dunbar
bbaeca4fef
Set the calling convention based on the CGFunctionInfo.
...
llvm-svn: 81582
2009-09-11 22:25:00 +00:00
Anders Carlsson
ecf9bf0158
GlobalDecl doesn't have an explicit constructor anymore.
...
llvm-svn: 81481
2009-09-10 23:43:36 +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
Mike Stump
4a3999fe90
Reflow comments and some minor whitespace fixups.
...
llvm-svn: 81337
2009-09-09 13:00:44 +00:00
Anders Carlsson
2fb0824197
Vastly improve PredefinedExpr output, both in Sema and CodeGen. Patch by Sam Weinig!
...
llvm-svn: 81237
2009-09-08 18:24:21 +00:00
Douglas Gregor
ad8a336b40
Implement AST, semantics, and CodeGen for C++ pseudo-destructor
...
expressions, e.g.,
p->~T()
when p is a pointer to a scalar type.
We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.
llvm-svn: 81009
2009-09-04 17:36:40 +00:00
Anders Carlsson
c82555fb85
Handle member expressions that return references correctly.
...
llvm-svn: 80723
2009-09-01 21:18:52 +00:00
Fariborz Jahanian
1a50477385
Fixed a property getter ir-gen crash.
...
llvm-svn: 80681
2009-09-01 17:02:21 +00:00
Douglas Gregor
f405d7e6f1
Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocate
...
space within the MemberExpr for the nested-name-specifier and its
source range. We'll do the same thing with explicitly-specified
template arguments, assuming I don't flip-flop again.
llvm-svn: 80642
2009-08-31 23:41:50 +00:00
Douglas Gregor
96ee789d33
Rename CXXQualifiedMemberExpr -> CXXAdornedMemberExpr, since we will
...
also be adding explicit template arguments as an additional
"adornment". No functionality change.
llvm-svn: 80628
2009-08-31 21:41:48 +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
8b899e4247
ir-gen related patch for type conversion
...
with class type conversion methods. WIP.
llvm-svn: 80365
2009-08-28 15:11:24 +00:00
Eli Friedman
ff083ef429
Clean up CodeGenFunction::EmitCastLValue to use the cast kind. Error
...
out for user-defined conversions instead of crashing.
llvm-svn: 80282
2009-08-27 21:19:33 +00:00
Douglas Gregor
c190523d7a
When a member reference expression includes a qualifier on the member
...
name, e.g.,
x->Base::f()
retain the qualifier (and its source range information) in a new
subclass of MemberExpr called CXXQualifiedMemberExpr. Provide
construction, transformation, profiling, printing, etc., for this new
expression type.
When a virtual function is called via a qualified name, don't emit a
virtual call. Instead, call that function directly. Mike, could you
add a CodeGen test for this, too?
llvm-svn: 80167
2009-08-26 22:36:53 +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
3b848940d7
Only do this for initializers of course.
...
llvm-svn: 79197
2009-08-16 17:54:29 +00:00
Anders Carlsson
b80760bd78
Destroy bound temporaries.
...
llvm-svn: 79196
2009-08-16 17:50:25 +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
Chris Lattner
19efdd67dd
use GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
...
VLASize isn't populated for the type yet.
llvm-svn: 79057
2009-08-14 23:43:22 +00:00