Anders Carlsson
ccbabc9645
Fix another byref bug. This should hopefully get QuickLookPlugins building successfully.
...
llvm-svn: 81681
2009-09-13 17:55:13 +00:00
Mike Stump
6768683933
Add FIXME for alignments that won't be honored.
...
llvm-svn: 81620
2009-09-12 18:58:28 +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
Anders Carlsson
0168f4b202
For __block variables, cache the LLVM types as well as which LLVM field where the variable is stored.
...
llvm-svn: 81599
2009-09-12 02:14:24 +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
10f2c10b83
Make the forwarding member of block byref structs be a pointer to the block byref struct itself.
...
llvm-svn: 81423
2009-09-10 01:32:12 +00:00
Daniel Dunbar
277aa36d68
Suppress build warning.
...
llvm-svn: 81384
2009-09-09 22:32:15 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Anders Carlsson
71d1d92d37
Make BuildByRefType take a ValueDecl instead of a QualType and an alignment.
...
llvm-svn: 81315
2009-09-09 02:51:03 +00:00
Anders Carlsson
49033712e4
Remove an ErrorUnsupported call.
...
llvm-svn: 79261
2009-08-17 18:24:57 +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
f40886acca
Refactor some code and implement support for global destructors for static variables.
...
llvm-svn: 78507
2009-08-08 21:45:14 +00:00
Owen Anderson
758428f4e3
Update for LLVM API change.
...
llvm-svn: 78259
2009-08-05 23:18:46 +00:00
Fariborz Jahanian
d44bdb2926
assert(nyi) on attempt to destruct an array of objects.
...
llvm-svn: 77993
2009-08-03 20:51:29 +00:00
Fariborz Jahanian
18c062361d
ir-gen for destructor calls.
...
llvm-svn: 77991
2009-08-03 20:20:07 +00:00
Anders Carlsson
f18318cf4e
use CodeGenModule::EmitNullConstant in a couple of places.
...
llvm-svn: 77915
2009-08-02 21:18:22 +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
Owen Anderson
ade90fd1ba
Update for LLVM API change.
...
llvm-svn: 77492
2009-07-29 18:54:39 +00:00
Daniel Dunbar
600dfac30a
Switch to using llvm::Value::getName()
...
llvm-svn: 77147
2009-07-26 08:32:30 +00:00
Owen Anderson
b7a2fe6f81
Update for LLVM API change.
...
llvm-svn: 77012
2009-07-24 23:12:58 +00:00
Daniel Dunbar
669521c97c
Fix thinko.
...
llvm-svn: 76362
2009-07-19 07:03:11 +00:00
Daniel Dunbar
b6adc43f6e
Avoid generation of dead code in a few more situations.
...
- Emit variable declarations as "simple", we want to avoid forcing the creation
of a dummy basic block, but still need to make the variable available for
later use.
- With that, we can now skip IRgen for other unreachable statements (which
don't define a label).
- Anders, I added two fixmes on calls to EmitVLASize, can you check them?
llvm-svn: 76361
2009-07-19 06:58:07 +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
Owen Anderson
c10c8d3e2b
Update for LLVM API change.
...
llvm-svn: 75028
2009-07-08 19:05:04 +00:00
Owen Anderson
9f211fb4fa
Update for LLVM API change.
...
llvm-svn: 74986
2009-07-08 01:29:18 +00:00
Argyrios Kyrtzidis
b4b64ca752
Remove the ASTContext parameter from the attribute-related methods of Decl.
...
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.
This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.
llvm-svn: 74501
2009-06-30 02:34:44 +00:00
Devang Patel
2872df839d
typo
...
llvm-svn: 74305
2009-06-26 18:33:42 +00:00
Douglas Gregor
78bd61f661
Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
...
llvm-svn: 73702
2009-06-18 16:11:24 +00:00
Mike Stump
cbc2bcaf17
As an optimization, we maintain a cache of generated
...
___Block_byref_id_object_dispose and ___Block_byref_id_object_copy
functions so that we can simply reuse instead of creating a new one.
Additionally, add an assert to ensure no one yet tries to align a
__block variable beyond the alignment of a pointer as the codegen is
incomplete.
llvm-svn: 72974
2009-06-05 23:26:36 +00:00
Eli Friedman
55422ad068
Add IRGen support for local variables of reference type.
...
llvm-svn: 72462
2009-05-27 05:39:06 +00:00
Sanjiv Gupta
47e296149e
Targets like PIC16 generate Static decls for automatic variables, emit the appropriate debug descriptor as well in that case.
...
llvm-svn: 72261
2009-05-22 13:54:25 +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
Anders Carlsson
9b02760923
Since we miscompile many cases when declaring a variable with a reference type, make them unsupported for now.
...
llvm-svn: 72034
2009-05-18 19:55:29 +00:00
Mike Stump
2c002929b2
Fixup debug information for the location information for __block
...
variables. For this to work, the backend needs to handle more complex
forms for locations.
A typical utterance would be:
%forwarding = getelementptr %0* %use_by_ref, i32 0, i32 1 ; <i8**> [#uses=1]
%0 = load i8** %forwarding ; <i8*> [#uses=1]
%1 = bitcast i8* %0 to %0* ; <%0*> [#uses=1]
%x = getelementptr %0* %1, i32 0, i32 4 ; <i32*> [#uses=1]
%2 = bitcast i32* %x to { }* ; <{ }*> [#uses=1]
call void @llvm.dbg.declare({ }* %2, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable to { }*))
Presently when selection finds something it doesn't understand, it
just avoids generating any information, which is safe, just
incomplete. Radar 6867696
llvm-svn: 71824
2009-05-15 00:29:54 +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
Anders Carlsson
6f5c15688d
When calling the cleanup function specified by __attribute__((cleanup)), make sure to bitcast the argument so it has the same type as the first argument of the cleanup function. Fixes <rdar://problem/6827047>.
...
llvm-svn: 70098
2009-04-26 00:34:20 +00:00
Eli Friedman
bc633beda4
PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and
...
subsequently crashed).
llvm-svn: 69567
2009-04-20 03:54:15 +00:00
Eli Friedman
4f856744e5
PR3853: Add CodeGen support for __thread.
...
llvm-svn: 69545
2009-04-19 21:05:03 +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
Daniel Dunbar
4184ac847f
Update to use hasAttr() instead of getAttr().
...
- No functionality change.
llvm-svn: 68987
2009-04-13 21:08:27 +00:00
Chris Lattner
6bc4aaa2eb
Make messages consistent.
...
llvm-svn: 68756
2009-04-10 00:37:08 +00:00
Chris Lattner
5286e774ee
reject codegen of __thread variables as unimplemented, rdar://6775265
...
llvm-svn: 68755
2009-04-10 00:35:59 +00:00
Anders Carlsson
80f97ab08f
Add a destination type argument to EmitConstantExpr. This will be used for when the destination has a reference type. (No functionality change yet)
...
llvm-svn: 68593
2009-04-08 04:48:15 +00:00
Sanjiv Gupta
639f2d92f8
Don't use static globals for params as it confuses the optimzer that their values are never being used in the function.
...
llvm-svn: 68328
2009-04-02 17:51:27 +00:00
Anders Carlsson
f7e01ffa4a
When compiling C++ code, always mangle the names of static block var decls.
...
llvm-svn: 68280
2009-04-02 03:29:47 +00:00
Fariborz Jahanian
ed308a94da
Code gen does not yet supports __asm__ on a variable
...
declaration. Reject it.
llvm-svn: 68058
2009-03-30 20:32:06 +00:00