Chris Lattner
75acb0c356
fix a fixme: non-proto struct returning function definitions should be compiled
...
to something like:
define void @bar(%struct.foo* noalias sret %agg.result) nounwind {
instead of:
define void @bar(%struct.foo* noalias sret %agg.result, ...) nounwind {
llvm-svn: 67475
2009-03-22 19:35:37 +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
Chris Lattner
4ff71de880
set function/global names with setName instead of passing the name into the
...
ctor function. This avoids creating a temporary std::string for the name,
speeding up the testcase in PR3810 by 3.8%
llvm-svn: 67457
2009-03-22 00:12:30 +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
Fariborz Jahanian
629aed9327
Issue error if variables are defined inside an objc class,
...
category or protocol.
llvm-svn: 67450
2009-03-21 18:06:45 +00:00
Chris Lattner
45470943a9
now that all the decl reference and creation stuff is going through two
...
very simple places, reimplement the deferred decl emission logic to not be O(N^2),
fixing PR3810.
llvm-svn: 67447
2009-03-21 09:44:56 +00:00
Chris Lattner
a85d68e5d8
fix a crash that could occur when a variable declaration became a
...
function definition.
llvm-svn: 67446
2009-03-21 09:25:43 +00:00
Chris Lattner
149927c9f8
simplify and cleanup global variable creation stuff to all go through one
...
code path.
llvm-svn: 67445
2009-03-21 09:16:30 +00:00
Chris Lattner
832323ea41
simplify management of llvm::Function creation to all go through
...
GetAddrOfFunction. This is simpler and more efficient.
llvm-svn: 67444
2009-03-21 08:53:37 +00:00
Chris Lattner
5eaee5692c
code cleanups, rename EmitForwardFunctionDefinition ->
...
CreateFunctionPrototypeIR, though my next patch will eliminate
it entirely.
llvm-svn: 67443
2009-03-21 08:38:50 +00:00
Chris Lattner
6574906818
fix several problems with asm renaming, by pulling it into the mangling code:
...
1. it wasn't applying to definitions, only declarations, e.g. int x __asm("foo")
2. multiple definitions were conflicting, they weren't getting merged.
3. the code was duplicated in several places.
llvm-svn: 67442
2009-03-21 08:24:40 +00:00
Chris Lattner
64c55933ed
add some fixmes
...
llvm-svn: 67441
2009-03-21 08:13:05 +00:00
Chris Lattner
a9cb6261bf
reduce redundant calls of getMangledName.
...
llvm-svn: 67440
2009-03-21 08:06:59 +00:00
Chris Lattner
3bfce1887f
simplify some more code.
...
llvm-svn: 67439
2009-03-21 08:03:33 +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
3637652ab3
random code cleanups.
...
llvm-svn: 67437
2009-03-21 07:12:05 +00:00
Chris Lattner
6098e62d56
remove obviously dead code: you can't bitcast a pointer to "Ty" (a function type).
...
llvm-svn: 67436
2009-03-21 06:58:21 +00:00
Chris Lattner
9e8120e067
avoid making constant folding logic eliminate obviously dead bitcasts, speeding up PR3810
...
by ~2%.
llvm-svn: 67434
2009-03-21 06:53:34 +00:00
Chris Lattner
725a26b818
Add a fast path to CodeGenModule::getMangledName for almost all C functions,
...
speeding up the testcase in PR3810 by 60%.
llvm-svn: 67431
2009-03-21 06:31:09 +00:00
Chris Lattner
cfbe9e746f
simplify CXXNameMangler::mangle, making it exit earlier for C functions.
...
This speeds up a testcase in 3810 by ~16%.
llvm-svn: 67429
2009-03-21 06:19:20 +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
Fariborz Jahanian
07038f9785
Fix a crash during meta-data generation of objc2's nonfragile abi.
...
llvm-svn: 67402
2009-03-20 20:48:19 +00:00
Fariborz Jahanian
391d4fc7f7
More super dot-syntax property implementation
...
when there is actually a property declaration
used in the dot-syntax.
llvm-svn: 67391
2009-03-20 19:18:21 +00:00
Devang Patel
9f804934df
Fix ivar's size encoding.
...
llvm-svn: 67389
2009-03-20 18:24:39 +00:00
Fariborz Jahanian
150abf2a00
Implement ir gen. for setter/getter applied to 'super'
...
in a property dot-syntax notation.
llvm-svn: 67382
2009-03-20 17:22:23 +00:00
Daniel Dunbar
4e004ed124
IRgen support for alias of global variable.
...
- PR3818.
llvm-svn: 67297
2009-03-19 08:27:24 +00:00
Devang Patel
ec4bad5093
Encode ivar access control info.
...
llvm-svn: 67267
2009-03-19 00:23:53 +00:00
Douglas Gregor
5253768ada
Introduce a representation for types that we referred to via a
...
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 00:18:19 +00:00
Fariborz Jahanian
3654e65adf
objc: Implemented variables declared in class interface
...
whose sema decl is at the translation unit.
llvm-svn: 67249
2009-03-18 22:33:24 +00:00
Daniel Dunbar
c230443178
PR3835: Interaction with ABI structure passing can inhibit
...
readnone/readonly attributes.
llvm-svn: 67224
2009-03-18 19:51:01 +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
Mike Stump
bc7d67ce08
Add codegen support for aggregate BlockDeclRefExprs.
...
llvm-svn: 67207
2009-03-18 15:54:29 +00:00
Chris Lattner
c2a0b97950
fix PR3809, codegen for inc/dec of function pointers.
...
llvm-svn: 67165
2009-03-18 04:25:13 +00:00
Chris Lattner
63d06ab65a
teach codegen to handle noop casts as lvalues.
...
llvm-svn: 67164
2009-03-18 04:02:57 +00:00
Anders Carlsson
e73e3ecc04
Initialize the cleanup.dst variable if necessary. Fixes PR3789.
...
llvm-svn: 67075
2009-03-17 05:53:35 +00:00
Devang Patel
bd93351c42
Fix struct field's debug info.
...
llvm-svn: 67062
2009-03-16 23:47:53 +00:00
Sebastian Redl
0f8b23f71f
Almost complete implementation of rvalue references. One bug, and a few unclear areas. Maybe Doug can shed some light on some of the fixmes.
...
llvm-svn: 67059
2009-03-16 23:22:08 +00:00
Douglas Gregor
23d75bb326
Build system changes to use TableGen to generate the various
...
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:
- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.
I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.
llvm-svn: 67058
2009-03-16 23:06:59 +00:00
Daniel Dunbar
27a08fab6b
Add note on theoretical IRgen improvement.
...
llvm-svn: 67024
2009-03-15 06:39:56 +00:00
Daniel Dunbar
64895a0703
Remove a FIXME.
...
llvm-svn: 67022
2009-03-15 06:05:20 +00:00
Mike Stump
5469f29aa9
Do up codegen for function static data and externs in functions in block
...
literals.
llvm-svn: 66984
2009-03-13 23:34:28 +00:00
Fariborz Jahanian
b03d5a6b36
Fix a bug in building function pointer type
...
corresponding to block pointer.
llvm-svn: 66940
2009-03-13 20:36:41 +00:00
Mike Stump
f807ccc58e
Remove FIXME, issue has been resolved.
...
llvm-svn: 66931
2009-03-13 19:38:54 +00:00
Chris Lattner
cda4d7e196
introduce a new -fheinous-gnu-extensions flag that enables really
...
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a
warning when enabled).
As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.
llvm-svn: 66910
2009-03-13 17:38:01 +00:00
Steve Naroff
c4b30e596c
Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.
...
Also changed BlockDecl API to be more consistent (wrt FunctionDecl).
llvm-svn: 66904
2009-03-13 16:56:44 +00:00
Fariborz Jahanian
1b074a3eb7
Fixed an ir-gen bug related to strong-cast generation of
...
source being a non-pointer.
llvm-svn: 66854
2009-03-13 00:42:52 +00:00
Fariborz Jahanian
1bf7288529
More objc2's ivar layout bitmap.
...
bitmap generation for basic ivars seem to
work now. This is work in progress.
llvm-svn: 66836
2009-03-12 22:50:49 +00:00
Daniel Dunbar
a61bb4d198
Fix uninitialized use in GetAddrOfGlobalBlock, reenable assert.
...
- Mike, please verify.
llvm-svn: 66762
2009-03-12 03:07:24 +00:00
Daniel Dunbar
8ce48d8c10
x86_32 ABI: Don't try and expand structures with bitfields.
...
- This is an ABI incompatiblity, but this is not likely to be a huge
deal in practice. For now we at least generate self consistent code
instead of crashing.
- <rdar://problem/6657601> x86-32 ABI: Bitfields in small structures
are not passed correctly
llvm-svn: 66713
2009-03-11 22:05:26 +00:00
Fariborz Jahanian
99bee42be2
Code refactoring. No change in functionality.
...
llvm-svn: 66710
2009-03-11 21:42:00 +00:00
Fariborz Jahanian
cbaf73cd26
More of objc2's ivar layout bitmap (Next: specific).
...
Work in progress.
llvm-svn: 66707
2009-03-11 20:59:05 +00:00
Duncan Sands
1918413137
Adjust for linkage name change.
...
llvm-svn: 66691
2009-03-11 20:15:27 +00:00
Duncan Sands
bdf086f7c0
Correct for change of this name in LLVM.
...
llvm-svn: 66652
2009-03-11 08:40:02 +00:00
Fariborz Jahanian
3b0f886c3f
More Next objc2's gc ivar layout bitmap work.
...
Work in progress.
llvm-svn: 66615
2009-03-11 00:07:04 +00:00
Chris Lattner
d8c7ba278e
add plumbing to report diagnostics back through sema for malformed asmstrings.
...
llvm-svn: 66598
2009-03-10 23:41:04 +00:00
Chris Lattner
35b5836147
move the asm string analysis code out of codegen into common
...
code where Sema can get to it. No functionality change.
llvm-svn: 66596
2009-03-10 23:21:44 +00:00
Devang Patel
c0f58ea60b
Emit super class debug info.
...
llvm-svn: 66580
2009-03-10 21:30:26 +00:00
Fariborz Jahanian
156506e749
ir-gen support for class getter/setter call
...
using property dot-syntax.
llvm-svn: 66556
2009-03-10 18:03:11 +00:00
Daniel Dunbar
4095d89532
Remove some now-unneeded calls to llvm::errs().flush().
...
llvm-svn: 66555
2009-03-10 18:00:19 +00:00
Anders Carlsson
0275115f66
Address Doug's comments wrt the mangler and fix Eli's test case
...
llvm-svn: 66549
2009-03-10 17:07:44 +00:00
Fariborz Jahanian
524bb20b4b
More objc2's gc meta-data work related to ivar layout bitmap.
...
Work in progress.
llvm-svn: 66546
2009-03-10 16:22:08 +00:00
Chris Lattner
f85a938985
Fix PR3682 by just disabling a broken assertion. This check should be
...
done in sema, and is reflected by the existing PR3258. In the meantime,
fix PR3682 by disabling a bogus assertion (which doesn't account for +
operands).
llvm-svn: 66533
2009-03-10 06:42:37 +00:00
Chris Lattner
6dd0f9263d
reduce duplication of parsing code between %0 and %x0 and
...
add support for modifiers on named references, like %c[foo].
llvm-svn: 66532
2009-03-10 06:38:02 +00:00
Chris Lattner
d7d5fdf090
move matching of named operands into AsmStmt class. At the same
...
time handle + operands in operand counting, fixing asm.c:t7 to
expand into $2 instead of $1.
llvm-svn: 66531
2009-03-10 06:33:24 +00:00
Chris Lattner
80337892f4
reduce nesting, use memchr instead of explicit loop, eliminate a
...
temporary std::string to fix a fixme.
llvm-svn: 66530
2009-03-10 06:11:34 +00:00
Chris Lattner
2d43eaefa2
Expand %= into ${:uid} so that the code generator emits a unique ID for the
...
asm. This allows us to properly handle the case when an optimizer duplicates
the asm, such as here:
void bar() {
int i;
for (i = 0; i < 3; ++i)
asm("foo %=" : : "r"(0));
}
we now produce:
_bar:
xorl %eax, %eax
## InlineAsm Start
foo 0
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 2
## InlineAsm End
ret
instead of:
_bar:
xorl %eax, %eax
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
## InlineAsm Start
foo 1
## InlineAsm End
ret
This also fixes a fixme by eliminating a static.
llvm-svn: 66528
2009-03-10 05:39:21 +00:00
Chris Lattner
72bbf17340
add some helper methods to AsmStmt and add some comments.
...
llvm-svn: 66521
2009-03-10 04:59:06 +00:00
Chris Lattner
57e673772e
slightly simplify some code, pull the 'is simple asm' case up in
...
ConvertAsmString and shrink it a bit. No functionality change.
llvm-svn: 66520
2009-03-10 04:38:46 +00:00
Daniel Dunbar
99d2835099
Backout r66408, we don't want handling of globals to rely on the
...
module symbol table. The root problem inspiring this was fixed in
r66316 (and again in r66506).
llvm-svn: 66512
2009-03-09 23:53:08 +00:00
Daniel Dunbar
ae3338429f
NeXT: Set alignment on a number of ObjC metadata variables (matching llvm-gcc).
...
llvm-svn: 66481
2009-03-09 22:18:41 +00:00
Daniel Dunbar
c2d4b62046
NeXT: Move some routines over to CreateMetadataVar.
...
- No intended functionality change.
llvm-svn: 66473
2009-03-09 21:49:58 +00:00
Daniel Dunbar
463cc8ade5
Tweak CreateMetadataVar, take the exact alignment instead of relying
...
on LLVM TargetData.
llvm-svn: 66455
2009-03-09 20:50:13 +00:00
Fariborz Jahanian
de2f33373b
More fix for bitfield ivar meta-data and code gen accessing it.
...
Now, we can actually execute dejagnu test with bitfield ivars
in non-fragile abi mode.
llvm-svn: 66448
2009-03-09 20:44:22 +00:00
Daniel Dunbar
91b000f771
Fix typo in pref commit.
...
llvm-svn: 66433
2009-03-09 20:16:39 +00:00
Daniel Dunbar
30c653655d
NeXT: Add CreateMetadataVar utility method to encapsulate creation of
...
Obj-C metadata variables (which generally should be handled the same,
although they aren't currently).
- No functionality change.
llvm-svn: 66432
2009-03-09 20:09:19 +00:00
Mike Stump
e3193ff452
Be sure to never create two functions with the same name, instead arrange to
...
reuse the prior one.
llvm-svn: 66408
2009-03-09 06:40:26 +00:00
Fariborz Jahanian
6772621acf
Code refactoring. No functional change.
...
llvm-svn: 66391
2009-03-08 20:18:37 +00:00
Anders Carlsson
4ed74dd6b7
Make mangling work with anonymous tag types. Doug, please review
...
llvm-svn: 66353
2009-03-07 23:57:03 +00:00
Anders Carlsson
16d5d291ec
Mangle Objective-C interfaces correctly (where correctly refers to what gcc does)
...
llvm-svn: 66349
2009-03-07 22:03:21 +00:00
Eli Friedman
4663a3368d
Make constant emission for @encode use the common string emission code.
...
This is a bit cleaner, and also "fixes" bad code that compares the
addresses of the string constants.
llvm-svn: 66346
2009-03-07 20:17:55 +00:00
Fariborz Jahanian
03676f557c
correct bitfield ivar offset in ivar meta-data.
...
(objc abi specific).
llvm-svn: 66345
2009-03-07 19:43:20 +00:00
Sanjiv Gupta
06cc45ec85
Mangle param names with .arg. only.
...
llvm-svn: 66343
2009-03-07 18:09:52 +00:00
Mike Stump
a6ca334389
Fixup our uses of various linkages to match how llvm now works. I think they are all
...
correct, but an extra set of ObjC eyes would be good.
llvm-svn: 66342
2009-03-07 16:33:28 +00:00
Mike Stump
de373a033f
If someone could figure out this is necessary, that would be good.
...
llvm-svn: 66341
2009-03-07 16:32:25 +00:00
Mike Stump
d9728222a4
Fix typo, need parens.
...
llvm-svn: 66337
2009-03-07 14:53:10 +00:00
Sebastian Redl
7dce7723ba
Some struct/class mismatch fixes, to silence MSVC warnings.
...
llvm-svn: 66335
2009-03-07 12:16:37 +00:00
Mike Stump
1ab20cae19
Remove last FIXME for block literal codegen that I know about and turn
...
on all the new code by default. There is still plenty of testing to
do and issues I'm sure need resolving. Let me know if you find
anything.
llvm-svn: 66323
2009-03-07 06:16: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
Eli Friedman
a374b68b5a
Back out the patch in r66302, and re-fix it properly. We assume for
...
performance that the type of the returned llvm::Value for an expression
matches the converted type of the clang::Expr; mismatches will cause all
sorts of errors and silent miscompilations.
llvm-svn: 66321
2009-03-07 03:57:15 +00:00
Mike Stump
6f7d9f8774
codegen support for dispose helpers for block literals.
...
llvm-svn: 66320
2009-03-07 02:53:18 +00:00
Mike Stump
aeb0ffd56c
Codegen support for copy helpers for block literals.
...
llvm-svn: 66319
2009-03-07 02:35:30 +00:00
Fariborz Jahanian
f5d0613ce9
Fixed a bug where generation of read-barriers caused
...
crash in ir-gen.
llvm-svn: 66302
2009-03-06 23:05:56 +00:00
Daniel Dunbar
7aecee998c
(LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and add
...
CodeGenModule::CreateRuntimeVariable.
- No real functionality change; although we now assert on silly
things like:
--
int objc_exception_throw;
void f0() { @throw(@"A"); }
--
instead of accepting it.
llvm-svn: 66292
2009-03-06 22:13:30 +00:00
Mike Stump
d6ef62f0bf
Pass the type of the block literal around to make required temporal ordering of code clearer.
...
llvm-svn: 66284
2009-03-06 18:42:23 +00:00
Daniel Dunbar
94911a91d5
x86_64 ABI: Handle long double in union when upper eightbyte results
...
in a lone X87 class.
- PR3735.
llvm-svn: 66277
2009-03-06 17:50:25 +00:00
Daniel Dunbar
8e79b8491f
IRgen support for weak_import.
...
- <rdar://problem/6652110> clang should support weak_import
llvm-svn: 66270
2009-03-06 16:20:49 +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
9676015e86
Cleanup EH a bit given changes to ObjCCatchStmt.
...
- No functionality change.
llvm-svn: 66218
2009-03-06 00:01:21 +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
Fariborz Jahanian
c559f3f175
More function stop for objc2's ivar layout bit map.
...
llvm-svn: 66209
2009-03-05 22:39:55 +00:00
Fariborz Jahanian
01dff426c8
Adds a template for a function for objc2's gc's ivar layout
...
bitmap.
llvm-svn: 66175
2009-03-05 19:17:31 +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
Chris Lattner
ff9fbcaa8a
if we die in IR generation of a compound statement, include
...
it in the stack trace, giving us stuff like:
Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
3. t.c:1:9: LLVM IR generation of compound statement ('{}')
4. t.c:2:3: LLVM IR generation of compound statement ('{}')
Abort
llvm-svn: 66154
2009-03-05 08:04:57 +00:00
Eli Friedman
cecc21d2f6
Make IRGen compatible with declaring a function with incomplete
...
return/argument types. (The generated IR isn't ideal, but we can't
really do better in general.)
llvm-svn: 66132
2009-03-05 04:18:07 +00:00
Eli Friedman
22fcc24b30
Initial implementation of CodeGen for incomplete function types; fixes
...
PR3688. (The FIXME is a rather big performance issue, but it only
affects code using this feature, which is relatively rare.)
llvm-svn: 66128
2009-03-05 03:16:41 +00:00
Mike Stump
cd1280b405
Avoid dispose calls when only doing gc.
...
llvm-svn: 66126
2009-03-05 02:34:38 +00:00
Devang Patel
eed256da90
Set isMain bit for MainFile.
...
llvm-svn: 66120
2009-03-05 01:55:07 +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
Mike Stump
2d33d6300c
Fixup __block codegen in nested block literals.
...
llvm-svn: 66091
2009-03-04 22:48:06 +00:00
Mike Stump
8473a12bfe
Move more blocks CodeGenFunction code up and out.
...
llvm-svn: 66049
2009-03-04 19:03:44 +00:00
Mike Stump
06acea8a69
Move some of the CodeGenFunction blocks code up and out. No
...
functionality change.
llvm-svn: 66048
2009-03-04 18:57:26 +00:00
Mike Stump
6c39666a77
Move more of the blocks code up and out.
...
llvm-svn: 66046
2009-03-04 18:47:42 +00:00
Devang Patel
4b6e4bb25d
Refactor code.
...
llvm-svn: 66043
2009-03-04 18:21:39 +00:00
Mike Stump
95435674f9
Move more of blocks codegen out of CodeGenModule and into the
...
BlockModule. No functionality change. This should help people that
don't want to know anything about blocks not be confused by the
overloaded use of the term block or nor want to see all the blocks
goop.
llvm-svn: 66042
2009-03-04 18:17:45 +00:00
Daniel Dunbar
5b9e9682f1
Support "asm" renaming of external symbols.
...
- PR3698.
llvm-svn: 66038
2009-03-04 17:31:19 +00:00
Mike Stump
376e3c0347
Start the migration of more of the blocks code out of sight for most
...
people. De-duplicates BLOCK_NEEDS_FREE and friends.
llvm-svn: 66035
2009-03-04 15:35:22 +00:00
Mike Stump
edb252aeba
Start the migration of more of the blocks code out of sight for most
...
people. De-duplicates BLOCK_NEEDS_FREE and friends.
llvm-svn: 66034
2009-03-04 15:32:52 +00:00
Mike Stump
0874160bd5
Add __block codegen testcase. We introduce a temporary flag to enable
...
codegen, until such time as codegen is complete enough to turn on with
-fblocks.
llvm-svn: 66031
2009-03-04 13:17:22 +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
Chris Lattner
4192bce91b
add a special case for codegen that improves the case where we have
...
multiple sequential cases to a) not create tons of fall-through basic blocks
and b) not recurse deeply. This fixes codegen on 100K deep cases, and improves
codegen on moderate cases from this:
switch i32 %tmp, label %sw.epilog [
i32 1000, label %sw.bb
i32 1001, label %sw.bb1
i32 1002, label %sw.bb2
i32 1003, label %sw.bb3
i32 1004, label %sw.bb4
...
sw.bb: ; preds = %entry
br label %sw.bb1
sw.bb1: ; preds = %entry, %sw.bb
br label %sw.bb2
sw.bb2: ; preds = %entry, %sw.bb1
br label %sw.bb3
sw.bb3: ; preds = %entry, %sw.bb2
br label %sw.bb4
to:
switch i32 %tmp, label %sw.epilog [
i32 1000, label %sw.bb
i32 1001, label %sw.bb
i32 1002, label %sw.bb
i32 1003, label %sw.bb
i32 1004, label %sw.bb
sw.bb: ;; many preds
llvm-svn: 66015
2009-03-04 04:46:18 +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
Eli Friedman
42d2a3add6
Attempt to fix PR3709: when converting from an integer to a pointer,
...
first extend the integer to the correct width.
llvm-svn: 66009
2009-03-04 04:02:35 +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
Steve Naroff
371b8fb4c3
Fix <rdar://problem/6640991> Exception handling executes wrong clause (Daniel, please verify).
...
Also necessary to fix:
<rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements
<rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements
llvm-svn: 65964
2009-03-03 19:52:17 +00:00
Fariborz Jahanian
eab5ecd8e0
Fixed an ir-gen bug in syntheszing a getter function
...
with property type which does not match its ivar and
in -fobjc-gc-only mode!
llvm-svn: 65955
2009-03-03 18:49:40 +00:00
Anders Carlsson
24b1447b19
Return 0 if the ConstExprEmitter can't handle an expression.
...
llvm-svn: 65951
2009-03-03 16:43:34 +00:00
Eli Friedman
78350edafb
Fix for PR3687: use the memory representation for booleans when a
...
sub-type describes a memory location, like the pointee type of a pointer
or the element type of an array.
llvm-svn: 65925
2009-03-03 04:48:01 +00:00
Anders Carlsson
b3b675c35e
inline asm calls should be nounwind. Chris, please review.
...
llvm-svn: 65866
2009-03-02 19:58:15 +00:00
Devang Patel
13dbe873bd
Enable Objective-C interface debug info.
...
llvm-svn: 65850
2009-03-02 17:58:28 +00:00
Daniel Dunbar
dd9427133a
Avoid crash when child iterator gives null result.
...
llvm-svn: 65812
2009-03-02 07:00:57 +00:00
Daniel Dunbar
76b7acc49f
First cut at zero-cost EH support.
...
- Still manually generates the EH code; the parts related to cleanup
need to be integrated into the cleanup stack (for proper
interaction with VLAs, etc.).
- Some differences vs gcc in corner cases; I believe our behavior is
correct but need to verify/file bugs vs gcc.
llvm-svn: 65809
2009-03-02 06:08:11 +00:00
Daniel Dunbar
7a38ce4f88
Make sure to invoke (not call) to objc_exception_throw if necessary.
...
llvm-svn: 65808
2009-03-02 05:20:36 +00:00
Daniel Dunbar
a646834214
Fix completely broken thinko in GetClassGlobal.
...
llvm-svn: 65807
2009-03-02 05:18:14 +00:00
Daniel Dunbar
0f3403cb5a
Don't set nounwind on functions when in using the new Obj-C ABI.
...
llvm-svn: 65806
2009-03-02 04:58:03 +00:00
Daniel Dunbar
b960b7b7c7
Cleanup handling of function attributes in calls.
...
- No intended functionality change.
llvm-svn: 65805
2009-03-02 04:32:35 +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
Anders Carlsson
5878c797b3
Add BLOCK_HAS_DESCRIPTOR to global blocks.
...
llvm-svn: 65788
2009-03-01 21:09:29 +00:00
Mike Stump
3a139f3793
Be sure to mark blocks with no imports as being global.
...
llvm-svn: 65784
2009-03-01 20:07:53 +00:00
Chris Lattner
a01c21f616
simplify some code.
...
llvm-svn: 65782
2009-03-01 18:47:06 +00:00
Daniel Dunbar
88367f2768
Obj-C non fragile ABI: Use GetClassGlobal in one more instance I missed.
...
llvm-svn: 65762
2009-03-01 04:51:18 +00:00
Daniel Dunbar
b1559a4499
Obj-C non fragile ABI: Add GetInterfaceEHType for getting the Obj-C
...
exception typeinfo metadata, and a few other EH related types/functions.
- No functionality change.
llvm-svn: 65761
2009-03-01 04:46:24 +00:00
Daniel Dunbar
c6928bbe29
NeXT: Unify code for creating a class global.
...
- No functionality change.
llvm-svn: 65760
2009-03-01 04:40:10 +00:00
Daniel Dunbar
947bca2cc9
ObjCAtCatchStmt's ParamStmt is always a DeclStmt.
...
llvm-svn: 65759
2009-03-01 04:28:32 +00:00