Anders Carlsson
2d228cef50
Improve support for irgen of references.
...
llvm-svn: 72133
2009-05-19 20:40:02 +00:00
Anders Carlsson
29a1be34b7
Only do the bitcast in EmitStoreOfScalar if the type is a boolean.
...
llvm-svn: 72125
2009-05-19 19:36:19 +00:00
Anders Carlsson
8370964257
Pass the destination QualType to EmitStoreOfScalar. No functionality change.
...
llvm-svn: 72118
2009-05-19 18:50:41 +00:00
Mike Stump
18bb9284ff
Reflow some comments.
...
llvm-svn: 71937
2009-05-16 07:57:57 +00:00
Chris Lattner
e541ea3a61
implement l-value codegen of comma expr
...
llvm-svn: 71595
2009-05-12 21:28:12 +00:00
Chris Lattner
e0be0dfced
push GlobalDecl through enough of the CodeGenModule interfaces
...
to allow us to support generation of deferred ctors/dtors.
It looks like codegen isn't emitting a call to the dtor in
member-functions.cpp:test2, but when it does, its body should
get emitted.
llvm-svn: 71594
2009-05-12 21:21:08 +00:00
Fariborz Jahanian
32ff7aeefa
Provide basic support for generation of objc2's
...
objc_assign_global API when assigning to global
objective-c object pointer.
llvm-svn: 70939
2009-05-04 23:27:20 +00:00
Anders Carlsson
1619a5041c
Make codegen for constructors work again.
...
llvm-svn: 70785
2009-05-03 17:47:16 +00:00
Chris Lattner
a4185c543e
fix PR4067: [Linux kernel] cannot aggregate codegen stmtexpr as lvalue
...
llvm-svn: 70067
2009-04-25 19:35:26 +00:00
Daniel Dunbar
ef2ffbc390
Fix pointer addressing and array subscripting of Objective-C interface
...
types.
- I broke this in the switch to representing interfaces with opaque
types.
- <rdar://problem/6822660> clang crashes on subscript of interface in
32-bit mode
llvm-svn: 70009
2009-04-25 05:08:32 +00:00
Sanjiv Gupta
4742515771
Clang part of r69947. Reverting back 69574 as it is no longer needed.
...
llvm-svn: 69949
2009-04-24 02:40:57 +00:00
Chris Lattner
28ec0cf86c
the logic for computing __func__ and friends is really broken:
...
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.
llvm-svn: 69872
2009-04-23 05:30:27 +00:00
Daniel Dunbar
722f424178
Make ObjCInterfaceDecl's const in some more places.
...
llvm-svn: 69775
2009-04-22 05:08:15 +00:00
Chris Lattner
a9aeea9f27
use of predefined identifiers like __func__ at global scope warn in sema,
...
but crashed codegen. Fix this to report the name of the llvm function.
This fixes rdar://6808051
llvm-svn: 69658
2009-04-21 04:41:23 +00:00
Daniel Dunbar
9ebf9516af
Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
...
when we need them -- which is exactly what some code was already
doing!
- No intended functionality change.
llvm-svn: 69648
2009-04-21 01:19:28 +00:00
Daniel Dunbar
be9dae80b3
Remove LateBoundIVars() runtime interface, it is unused.
...
llvm-svn: 69641
2009-04-21 00:49:20 +00:00
Daniel Dunbar
41595d43d5
Use getAsPointerType instead of using getCanonicalType directly.
...
- <rdar://problem/6803995>
llvm-svn: 69435
2009-04-18 08:54:40 +00:00
Chris Lattner
c4688d21f7
tidy some code.
...
llvm-svn: 69360
2009-04-17 17:44:48 +00:00
Anders Carlsson
b7f8f594f3
Implement basic code generation of constructor calls. We can now compile:
...
struct S {
S(int, int);
};
void f() {
S s(10, 10);
}
llvm-svn: 69330
2009-04-17 00:06:03 +00:00
Mike Stump
d73e4419f5
Fixup whitespacing.
...
llvm-svn: 69055
2009-04-14 18:24:37 +00:00
Mike Stump
4c0dc0e48a
Use hasAttr instead of getAttr for conditionals.
...
llvm-svn: 69021
2009-04-14 02:45:29 +00:00
Daniel Dunbar
0ca1660129
Audit __private_extern__ handling.
...
- Exposed quite a few Sema issues and a CodeGen crash.
- See FIXMEs in test case, and in SemaDecl.cpp (PR3983).
I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.
llvm-svn: 69020
2009-04-14 02:25:56 +00:00
Mike Stump
ca5ae66122
Fixup CodeGen for __weak __block variables. Radar 6756266
...
llvm-svn: 69010
2009-04-14 00:57:29 +00:00
Daniel Dunbar
4184ac847f
Update to use hasAttr() instead of getAttr().
...
- No functionality change.
llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Anders Carlsson
479e6fc7a7
Use the new EmitCallArgs function. No indented functionality change.
...
llvm-svn: 68652
2009-04-08 23:13:16 +00:00
Sanjiv Gupta
562d68e8db
Pointer width on targets like PIC16 is 16-bit, while the valid index size to GEP is only 32 or 64. So promote index to 32 in such cases.
...
llvm-svn: 68590
2009-04-08 04:16:39 +00:00
Anders Carlsson
d8db853243
Remove some dead code.
...
llvm-svn: 68532
2009-04-07 18:53:02 +00:00
Daniel Dunbar
15894b791b
Various fixes to symbols used for Obj-C x86_64 metadata.
...
- Changed method names to match gcc (categories names still aren't
mangled in).
- Expose correct name for class and metadata symbols (although
-fvisibility=hidden isn't yet correct).
- Remove several things from llvm.used that didn't need to be there
(I suspect this can still be trimmed).
- Don't use asm-prefix extension for _objc_empty_{cache,vtable} (not
needed).
- Hide EH type class info with -fvisibility=hidden
- Change setGlobal[Option]Visibility to not change the visibility of
functions with internal linkage.
llvm-svn: 68510
2009-04-07 05:48:37 +00:00
Anders Carlsson
e5fd6f2227
Add support for calling C++ member functions.
...
llvm-svn: 68412
2009-04-03 22:50:24 +00:00
Daniel Dunbar
bf1fe8c36c
Support member reference on ?: of struct type.
...
llvm-svn: 67603
2009-03-24 02:38:23 +00:00
Chris Lattner
47640221da
fix CreateTempAlloca to not set a name on the alloca for temporaries
...
in release-assert builds. For automatic variables, explicitly set
a name with setName that does not make a temporary std::string.
This speeds up -emit-llvm-only -disable-free on PR3810 by 4.6%
llvm-svn: 67459
2009-03-22 00:24:14 +00:00
Chris Lattner
0c5e3132aa
simplify and comment some code better. Make BindRuntimeGlobals
...
more optimistic that it will work (optimizing for the common case).
llvm-svn: 67438
2009-03-21 07:48:31 +00:00
Chris Lattner
ab17fb2c98
fix the more complex cases by actually codegen'ing the right expr :)
...
llvm-svn: 67219
2009-03-18 18:30:44 +00:00
Chris Lattner
28bcf1a429
add codegen support for casting an element to a union.
...
There are some more complex cases (_Complex and structs)
that I'm still working on.
llvm-svn: 67218
2009-03-18 18:28:57 +00:00
Chris Lattner
63d06ab65a
teach codegen to handle noop casts as lvalues.
...
llvm-svn: 67164
2009-03-18 04:02:57 +00:00
Eli Friedman
e0a5b8b11f
Minor cleanup for choose expressions: add a helper that returns the
...
chosen sub-expression, rather than just evaluating the condition.
llvm-svn: 66018
2009-03-04 05:52:32 +00:00
Mike Stump
97d01d50d9
Improved ABI compliance for __block variables. No testcases yet as we
...
still give an unsupported error for them due to the fact this is a
work in progress.
llvm-svn: 66007
2009-03-04 03:23:46 +00:00
Mike Stump
0e425b8200
Push checking down, also, give the user a hit as to which part of the
...
block literal is causing the problem, instead of the vague reference
to the entire block literal.
llvm-svn: 65798
2009-03-02 03:04:42 +00:00
Mike Stump
1db7d04b71
First cut CodeGen support for __block variables.
...
llvm-svn: 65688
2009-02-28 09:07:16 +00:00
Chris Lattner
d7e7b8e411
first wave of fixes for @encode sema support. This is part of PR3648.
...
The big difference here is that (like string literal) @encode has
array type, not pointer type.
llvm-svn: 65391
2009-02-24 22:18:39 +00:00
Fariborz Jahanian
392124c78e
We should not generate __weak write barrier on indirect reference
...
of a pointer to object; This patch does this odd behavior according to
gcc.
llvm-svn: 65334
2009-02-23 18:59:50 +00:00
Fariborz Jahanian
0773533b27
More objc gc work. Match gcc's treatment of ivar access
...
true a local pointer to objective-c object in generating
write barriers.
llvm-svn: 65290
2009-02-22 18:40:18 +00:00
Fariborz Jahanian
a9fecf3f9e
local array of objects are non-gc'able.
...
llvm-svn: 65251
2009-02-21 23:37:19 +00:00
Fariborz Jahanian
10bec1099c
Handle case of none gc'able objects regardless of their
...
type.
llvm-svn: 65205
2009-02-21 00:30:43 +00:00
Daniel Dunbar
27032de34b
Shorten; no functionality change.
...
llvm-svn: 65145
2009-02-20 19:34:33 +00:00
Daniel Dunbar
cdbb5e336d
Set call attribute for direct calls (i.e. noreturn).
...
- Remove an unused variant of EmitCallExpr overload.
llvm-svn: 65130
2009-02-20 18:06:48 +00:00
Fariborz Jahanian
c86fb5ecb4
More objc gc's ir-gen fixes.
...
llvm-svn: 65097
2009-02-20 01:14:43 +00:00
Fariborz Jahanian
0f466c746f
More objc's gc ir-gen stuff.
...
llvm-svn: 65077
2009-02-19 23:36:06 +00:00
Fariborz Jahanian
3114e94e10
Generate the conservative objc gc's API for now.
...
llvm-svn: 65051
2009-02-19 18:29:24 +00:00
Fariborz Jahanian
83e3eea5fc
Some code simplification. ir gen for gc'able array
...
of objects in objc.
llvm-svn: 64992
2009-02-19 00:48:05 +00:00