John McCall
f3eb96fccf
Kill the KVC l-value kind and calculate the base expression when emitting
...
the l-value.
llvm-svn: 120884
2010-12-04 02:32:38 +00:00
John McCall
b7bd14fa08
Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ObjCPropertyRefExpr
...
into the latter.
llvm-svn: 120643
2010-12-02 01:19:52 +00:00
John McCall
f3735e01ce
Restore the lvalue-to-rvalue conversion patch with a minimal fix.
...
llvm-svn: 120555
2010-12-01 04:43:34 +00:00
John McCall
4f22c9de48
L-value to r-value conversion is not ready for prime-time.
...
llvm-svn: 120433
2010-11-30 17:58:55 +00:00
John McCall
824fd1dcff
Introduce an r-value to l-value cast kind. I'm not promising anything
...
about the reliability of this yet.
llvm-svn: 120422
2010-11-30 10:13:06 +00:00
Benjamin Kramer
90b5b68535
Hide a bunch of symbols.
...
llvm-svn: 120153
2010-11-25 18:29:30 +00:00
John McCall
086a464e24
Switch a lot of call-sites over to using the new value-kind calculations.
...
llvm-svn: 120084
2010-11-24 05:12:34 +00:00
Fariborz Jahanian
44a41d1c25
Minor cleanup. No change otherwise.
...
llvm-svn: 119814
2010-11-19 18:17:09 +00:00
Fariborz Jahanian
148d113e55
Fix a bug where write-barriers for assignment through reference
...
types was not being generated for objc pointers.
// rdar://8681766.
llvm-svn: 119751
2010-11-18 22:39:16 +00:00
John McCall
4f29b49de1
Support compound complex operations as l-values in C++. Add a test
...
case based on CodeGen/volatile-1.c which tests the current C++
semantics, and note the many, many places we fall short of them.
llvm-svn: 119402
2010-11-16 23:07:28 +00:00
John McCall
07bb19667a
Simplify some complex emission and implement correct semantics for
...
assignment to volatiles in C. This in effect reverts some of mjs's
work in and around r72572. Basically, the C++ standard is quite
clear, except that it lies about volatile behavior approximating
C's, whereas the C standard is almost actively misleading.
llvm-svn: 119344
2010-11-16 10:08:07 +00:00
John McCall
d50a27111c
Kill CK_Unknown and flesh out the documentation for the existing CastKinds.
...
llvm-svn: 119331
2010-11-16 05:46:29 +00:00
John McCall
8cb679e4e1
Assorted work leading towards the elimination of CK_Unknown.
...
llvm-svn: 119138
2010-11-15 09:13:47 +00:00
John McCall
d764625448
Add a few more complex-related cast kinds that arise due to arbitrary
...
implicit conversions; the last batch was specific to promotions.
I think this is the full set we need. I do think dividing the cast
kinds into floating and integral is probably a good idea.
Annotate a *lot* more C casts with useful cast kinds.
llvm-svn: 119036
2010-11-14 08:17:51 +00:00
John McCall
c5e62b47af
Introduce five new cast kinds for various conversions into and
...
between complex types.
llvm-svn: 118994
2010-11-13 09:02:35 +00:00
John McCall
e84af4e486
Introduce a null-to-pointer implicit cast kind.
...
llvm-svn: 118966
2010-11-13 01:35:44 +00:00
Argyrios Kyrtzidis
8909686b22
Fix miscompilation regarding VLAs; subscription of VLA pointers was incorrect.
...
Fixes rdar://8644873 & http://llvm.org/PR8567 .
llvm-svn: 118468
2010-11-09 01:30:48 +00:00
John McCall
3a7f6926d1
Restore r117403 (fixing IR gen for bool atomics), this time being less
...
aggressive about the form we expect bools to be in. I don't really have
time to fix all the sources right now.
llvm-svn: 117486
2010-10-27 20:58:56 +00:00
Rafael Espindola
9d798a07e4
Revert r117403 as it caused PR8480.
...
llvm-svn: 117456
2010-10-27 17:13:49 +00:00
John McCall
6bde954f47
Extract procedures to do scalar-to-memory and memory-to-scalar conversions
...
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics. rdar://problem/8461234
llvm-svn: 117403
2010-10-26 22:09:15 +00:00
Dan Gohman
d831356635
Trim an unnecessary #include.
...
llvm-svn: 117321
2010-10-25 21:59:29 +00:00
John McCall
1c9c3fd50a
Death to blocks, or at least the word "block" in one particular obnoxiously
...
ambiguous context.
llvm-svn: 116567
2010-10-15 04:57:14 +00:00
Dan Gohman
947c9af774
Experimental TBAA support.
...
This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.
llvm-svn: 116536
2010-10-14 23:06:10 +00:00
Fariborz Jahanian
681c0754d9
Eliminate usage of ObjCSuperExpr used for
...
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788
llvm-svn: 116483
2010-10-14 16:04:05 +00:00
Douglas Gregor
0bf3140424
Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked a
...
bit by me).
llvm-svn: 116122
2010-10-08 23:50:27 +00:00
Fariborz Jahanian
cb75021034
IRgen for gnu extension's conditional lvalue expression
...
with missing LHS. radar 8453812. Executable test is checked
into llvm test suite.
llvm-svn: 114457
2010-09-21 18:32:21 +00:00
Fariborz Jahanian
4fbf4af0f6
Fixes IRgen bug in objc++ reference binding of a
...
getter expression.
Fixes // rdar://8437240
llvm-svn: 114299
2010-09-18 20:47:25 +00:00
John McCall
8ea46b6654
Fix a bug with binding l-values to elided temporaries, and leave a couple
...
helpful asserts behind.
llvm-svn: 114250
2010-09-18 00:58:34 +00:00
John McCall
7a626f63f7
one piece of code is responsible for the lifetime of every aggregate
...
slot. The easiest way to do that was to bundle up the information
we care about for aggregate slots into a new structure which demands
that its creators at least consider the question.
I could probably be convinced that the ObjC 'needs GC' bit should
be rolled into this structure.
Implement generalized copy elision. The main obstacle here is that
IR-generation must be much more careful about making sure that exactly
llvm-svn: 113962
2010-09-15 10:14:12 +00:00
Fariborz Jahanian
366a94822b
Local static block variable referecned in its
...
block-literal initializer expression causes IRgen to crash.
This patch fixes by saving it in StaticLocalDecl map
already used for such purposes. (radar 8390455).
llvm-svn: 113307
2010-09-07 23:26:17 +00:00
Chris Lattner
f53c096813
clean up some formatting.
...
llvm-svn: 113129
2010-09-06 00:11:41 +00:00
Fariborz Jahanian
087206dbcd
Truncate block variable of bool type to i1 when its
...
value is used. This matches with non-block variable
use of bool type. (Fixes radar 8390062).
llvm-svn: 113027
2010-09-03 23:07:53 +00:00
Fariborz Jahanian
9d798d13f3
Cope with llvm's reference to bool type of 'i1' vs. clang's
...
type of 'i8' for the same for __block variables of
type bool. refixes radar 8382559.
llvm-svn: 113015
2010-09-03 21:36:02 +00:00
Fariborz Jahanian
61a312413c
Fix IRGen when property-dot syntax used to access
...
a c++ class object 'ivar'. Fixes radar 8366604.
llvm-svn: 112729
2010-09-01 19:36:41 +00:00
John McCall
c134eb5ada
Amusingly, I missed this point of abstraction in all my earlier
...
member-pointer refactoring: dereferencing a member data pointer.
llvm-svn: 112640
2010-08-31 21:07:20 +00:00
John McCall
5d865c3292
Teach IR generation to return 'this' from constructors and destructors
...
under the ARM ABI.
llvm-svn: 112588
2010-08-31 07:33:07 +00:00
John McCall
e302792b61
GCC didn't care for my attempt at API compatibility, so brute-force everything
...
to the new constants.
llvm-svn: 112047
2010-08-25 11:45:40 +00:00
Chris Lattner
65526f0190
fix rdar://8340348, a miscompile of boost that was exposed by r109848.
...
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'. The call code
turns around and allocates space for the ignored argument with
GetUndefRValue. The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but
undefined contents.
llvm-svn: 111794
2010-08-23 05:26:13 +00:00
John McCall
7a9aac2d9f
Abstract out everything having to do with member pointers into the ABI
...
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.
Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.
llvm-svn: 111789
2010-08-23 01:21:21 +00:00
John McCall
a1dee5300b
Experiment with using first-class aggregates to represent member function
...
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.
llvm-svn: 111776
2010-08-22 10:59:02 +00:00
John McCall
131d97d809
Extract member function pointer comparison and null comparison into
...
the ABI code. Implement correct semantics for these on ARM.
I believe this completes the implementation of member function pointers
on ARM.
I think I'm going to switch member function pointers over to be
non-aggregates while I have all this in mind.
llvm-svn: 111774
2010-08-22 08:30:07 +00:00
Daniel Dunbar
5c816378f8
IRgen: Set the alignment correctly when creating LValue for a decls.
...
- Fixes PR5598.
- Review appreciated.
llvm-svn: 111726
2010-08-21 04:20:22 +00:00
Daniel Dunbar
4bb04cee6a
IRgen: Move remaining LValue::Set... methods to LValue::set... (non-static) methods.
...
llvm-svn: 111722
2010-08-21 03:51:29 +00:00
Daniel Dunbar
f166a523f1
IRgen: Move remaining MakeAddr() calls to MakeAddrLValue().
...
llvm-svn: 111721
2010-08-21 03:44:13 +00:00
Daniel Dunbar
e8b6cda15a
IRgen: The CVR qualifiers in a subobject adjustment should just come from the
...
field (I think).
- Doug, please check.
llvm-svn: 111720
2010-08-21 03:37:02 +00:00
Daniel Dunbar
e50dda95ee
IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency with isNonGC().
...
llvm-svn: 111718
2010-08-21 03:22:38 +00:00
Daniel Dunbar
2e442a00b3
IRgen: Switch more MakeAddr() users to MakeAddrLValue; this time for calls which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.
...
llvm-svn: 111717
2010-08-21 03:15:20 +00:00
Daniel Dunbar
f6fb7e2b53
IRgen: Switch a bunch of trivial MakeAddr calls to use MakeAddrLValue.
...
llvm-svn: 111716
2010-08-21 03:08:16 +00:00
Daniel Dunbar
b1d94a98dd
IRgen: Eliminate EmitPredefinedFunctionName(), it doesn't need to be factored out.
...
llvm-svn: 111715
2010-08-21 03:01:12 +00:00
Daniel Dunbar
e3b8dd433c
IRgen/CGValue: Add alignment to LValue, and use that alignment when generating lvalue load/stores.
...
llvm-svn: 111710
2010-08-21 02:39:23 +00:00