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
Chris Lattner
e09ad90882
don't set the name of a call instruction to "call" in release-asserts
...
build. This shaves another 3% off.
llvm-svn: 67460
2009-03-22 00:32:22 +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
Mike Stump
efd7caa825
Fixup codegen for nested block literals so that we generate
...
copy_helpers and dispose_helpers as necessary for them.
llvm-svn: 67453
2009-03-21 21:00:35 +00:00
Mike Stump
692c6e3729
Fix codegen for support for super inside block literal expressions.
...
llvm-svn: 67406
2009-03-20 21:53:12 +00:00
Sanjiv Gupta
06cc45ec85
Mangle param names with .arg. only.
...
llvm-svn: 66343
2009-03-07 18:09:52 +00:00
Mike Stump
90d8daf592
Remove some FIXMEs for block literals that should be close to working.
...
llvm-svn: 66322
2009-03-07 06:04:31 +00:00
Mike Stump
f89230d93b
Complete __Block_byref_id_object_copy cogegen for block literals.
...
llvm-svn: 66257
2009-03-06 06:12:24 +00:00
Mike Stump
fbe25dd1e4
Finish off __Block_byref_id_object_dispose codegen for block literals.
...
llvm-svn: 66247
2009-03-06 04:53:30 +00:00
Mike Stump
846bf9a797
Remove extra arg.
...
llvm-svn: 66243
2009-03-06 02:45:21 +00:00
Mike Stump
ee2a5ee5f7
More codegen support for the copy/dispose helpers for block literals.
...
llvm-svn: 66241
2009-03-06 02:29:21 +00:00
Mike Stump
0c74327715
Framework for codegen for copy/dispose helpers.
...
llvm-svn: 66231
2009-03-06 01:33:24 +00:00
Daniel Dunbar
f804897ee9
Don't mangle names of local variables.
...
- For one thing, this adds unneeded overhead; for another, this
routine can be used to emit unnamed decls which we shouldn't try to
mangle.
llvm-svn: 66212
2009-03-05 22:59:19 +00:00
Mike Stump
4446dcf061
prep work for copy/destroy helpers for block literals.
...
llvm-svn: 66159
2009-03-05 08:32:30 +00:00
Mike Stump
cd1280b405
Avoid dispose calls when only doing gc.
...
llvm-svn: 66126
2009-03-05 02:34:38 +00:00
Mike Stump
626aecc4be
Add codegen support for __block variables to call _Block_object_dispose as necessary.
...
llvm-svn: 66117
2009-03-05 01:23:13 +00:00
Eli Friedman
3efa41a478
Continuation of PR3687: fix more places to use the right type for
...
booleans.
llvm-svn: 66012
2009-03-04 04:25:14 +00:00
Eli Friedman
a1493b3b4d
Comment fix: change a question to an answer.
...
llvm-svn: 66010
2009-03-04 04:22:58 +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
1db7d04b71
First cut CodeGen support for __block variables.
...
llvm-svn: 65688
2009-02-28 09:07:16 +00:00
Daniel Dunbar
1cdbc5404b
Allow constant initializers to reference their defining decl.
...
- PR3662.
llvm-svn: 65472
2009-02-25 20:08:33 +00:00
Daniel Dunbar
a374e60e57
Fold GeneraticStaticBlockVarDecl into callers.
...
- No functionality change.
llvm-svn: 65470
2009-02-25 19:45:19 +00:00
Daniel Dunbar
22a87f94a9
Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating the
...
global variable) out of GenerateStaticBlockVarDecl.
- No intended functionality change.
- Prep for some mild cleanups and PR3662.
llvm-svn: 65466
2009-02-25 19:24:29 +00:00
Eli Friedman
34ef305759
Last part of PR3254: use the same alignment computation in Sema and
...
CodeGen. I'm not sure whether this actually makes any visible
difference, but it's better to be consistent anyway.
llvm-svn: 65259
2009-02-22 03:23:43 +00:00
Mike Stump
f5a5c4fa11
Fix spacing.
...
llvm-svn: 65089
2009-02-20 00:19:45 +00:00
Douglas Gregor
5f361c9f1e
Address Chris's comments regarding C++ name mangling.
...
llvm-svn: 64984
2009-02-18 23:53:56 +00:00
Daniel Dunbar
38ad1e6138
Change EmitConstantExpr to allow failure.
...
IRgen no longer relies on isConstantInitializer, instead we just try
to emit the constant. If that fails then in C we emit an error
unsupported (this occurs when Sema accepted something that it doesn't
know how to fold, and IRgen doesn't know how to emit) and in C++ we
emit a guarded initializer.
This ends up handling a few more cases, because IRgen was actually
able to emit some of the constants Sema accepts but can't Evaluate().
For example, PR3398.
llvm-svn: 64780
2009-02-17 18:43:32 +00:00
Daniel Dunbar
f9f039865f
Set constant bit on static block vars as well. Patch by Anders Johnson!q
...
llvm-svn: 64502
2009-02-13 22:58:39 +00:00
Daniel Dunbar
128a138a57
IRgen support for attribute used.
...
- PR3566
llvm-svn: 64492
2009-02-13 22:08:43 +00:00
Anders Carlsson
63784f4e5e
Add CodeGen support for the nodebug attribute.
...
llvm-svn: 64445
2009-02-13 08:11:52 +00:00
Douglas Gregor
5fec5b0495
Add basic support for C++ name mangling according to the Itanium C++
...
ABI to the CodeGen library. Since C++ code-generation is so
incomplete, we can't exercise much of this mangling code. However, a
few smoke tests show that it's doing the same thing as GCC. When C++
codegen matures, we'll extend the ABI tester to verify name-mangling
as well, and complete the implementation here.
At this point, the major client of name mangling is in the uses of the
new "overloadable" attribute in C, which allows overloading. Any
"overloadable" function in C (or in an extern "C" block in C++) will
be mangled the same way that the corresponding C++ function would be
mangled.
llvm-svn: 64413
2009-02-13 00:10:09 +00:00
Daniel Dunbar
53bf741208
Honor attribute section on static block var decls.
...
llvm-svn: 64411
2009-02-12 23:32:54 +00:00
Sanjiv Gupta
e99ad00fd2
Function parameters for PIC16 are like local variables. So use the keyword ".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently.
...
llvm-svn: 64198
2009-02-10 04:17:25 +00:00
Anders Carlsson
15949b3a32
Use the new cleanup infrastructure for VLAs. The next iteration of patches will remove the old Obj-C EH cleanup code.
...
llvm-svn: 64161
2009-02-09 20:41:50 +00:00
Anders Carlsson
cadb9a6a34
Emit a cleanup block for the cleanup attribute
...
llvm-svn: 64052
2009-02-07 23:51:38 +00:00
Mike Stump
1d91dd98ad
Fixup goto codegen in and around VLAs.
...
llvm-svn: 64014
2009-02-07 12:52:26 +00:00
Anders Carlsson
31f8649f83
Follow Eli's advice and store the VLA size with the native size_t type. Fixes PR3491.
...
llvm-svn: 63879
2009-02-05 19:43:10 +00:00
Sanjiv Gupta
c1b58d40e6
Targets that don't have stack use global address space for parameters.
...
Specify external linkage for such globals so that llvm optimizer do
not assume there values initialized as zero.
llvm-svn: 63636
2009-02-03 18:07:49 +00:00
Eli Friedman
7139af42ce
Rename Expr::isConstantExpr to Expr::isConstantInitializer; this more
...
accurately states what the function is trying to do and how it is
different from Expr::isEvaluatable. Also get rid of a parameter that is both
unused and inaccurate.
llvm-svn: 62951
2009-01-25 02:32:41 +00:00