Mike Stump
03868f4ea0
Be sure to initialize Name.
...
llvm-svn: 64769
2009-02-17 17:18:36 +00:00
Mike Stump
c6ea7c1812
Fixup spacing a little.
...
llvm-svn: 64768
2009-02-17 17:00:02 +00:00
Daniel Dunbar
0ee13255ee
x86_64 ABI: Fix assert on return of _Complex long double.
...
llvm-svn: 64756
2009-02-17 07:55:55 +00:00
Daniel Dunbar
7f0e2368bb
x86_64 ABI: Implement classification for bit-fields.
...
llvm-svn: 64727
2009-02-17 02:45:44 +00:00
Daniel Dunbar
f2c6198eef
x86_64 ABI: Handle va_arg arguments with alignment > 8.
...
llvm-svn: 64701
2009-02-16 23:38:56 +00:00
Anders Carlsson
9ab53d120e
Add support for throwing exceptions to the nonfragile ABI
...
llvm-svn: 64692
2009-02-16 22:59:18 +00:00
Fariborz Jahanian
06292955d0
Added implementation of objc2's gc API calls for
...
nonfragile abi.
llvm-svn: 64690
2009-02-16 22:52:32 +00:00
Daniel Dunbar
8eb018ab9c
Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.
...
- Define pow[lf]?, sqrt[lf]? as builtins.
- Add -fmath-errno option which binds to LangOptions.MathErrno
- Add new builtin flag Builtin::Context::isConstWithoutErrno for
functions which can be marked as const if errno isn't respected for
math functions. Sema automatically marks these functions as const
when they are defined, if MathErrno=0.
- IRgen uses const attribute on sqrt and pow library functions to
decide if it can use the llvm intrinsic.
llvm-svn: 64689
2009-02-16 22:43:43 +00:00
Chris Lattner
e084c01124
fix volatile handling with ExtVectorElementExpr, so that we
...
emit two volatile loads for:
typedef __attribute__(( ext_vector_type(4) )) float float4;
float test(volatile float4 *P) {
return P->x+P->y;
}
llvm-svn: 64683
2009-02-16 22:25:49 +00:00
Chris Lattner
b8211f6436
introduce and use a new ExtVectorElementExpr::isArrow method, at Eli's suggestion
...
llvm-svn: 64681
2009-02-16 22:14:05 +00:00
Daniel Dunbar
e28b359881
Fix IRgen of __builtin_memset.
...
- Fix test case to not only have negative tests.
llvm-svn: 64674
2009-02-16 21:52:05 +00:00
Chris Lattner
6c7ce109e0
enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy
...
llvm-svn: 64667
2009-02-16 21:11:58 +00:00
Daniel Dunbar
d73ea816af
assert/ErrorUnsupported in unimplemented stub functions instead of
...
miscompiling.
llvm-svn: 64647
2009-02-16 18:48:45 +00:00
Daniel Dunbar
8de90f0a92
Obj-C non-fragile ABI: Fix types of a few globals; these were not
...
creating valid LLVM structures (although they work fined).
llvm-svn: 64580
2009-02-15 07:36:20 +00:00
Mike Stump
0e7d7b68c8
Use getNameAsCString instead of getNameAsString and reflow the type.
...
Thanks Anders.
llvm-svn: 64571
2009-02-14 22:49:33 +00:00
Mike Stump
2d5a2878d4
Generate the helper function for blocks. Now basic codegen is
...
starting to work for blocks.
llvm-svn: 64570
2009-02-14 22:16:35 +00:00
Fariborz Jahanian
35afdfc36e
Fixed a bad ir-gen bug which caused a dejagnu test to fail.
...
Now we are pretty close to be in sync with objc's classic
abi when it comes to passing dejagnu objc executable tests.
llvm-svn: 64569
2009-02-14 21:25:36 +00:00
Fariborz Jahanian
99bed6fd21
Fixed a problem caused by foreward @class use
...
which consequently caused a Seg fault. during meta-data
generation. It also addresses an issue related to
late binding of newly synthesize ivars (when we support it).
llvm-svn: 64563
2009-02-14 20:13:28 +00:00
Douglas Gregor
e711f7052e
Add hook to add attributes to function declarations that we know
...
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.
Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.
Be a bit more careful about when we consider a function a "builtin" in
C++.
llvm-svn: 64561
2009-02-14 18:57:46 +00:00
Daniel Dunbar
3d88672f64
x86_64 ABI: Need to use canonical types when comparing against
...
ASTContext types.
llvm-svn: 64533
2009-02-14 02:45:45 +00:00
Daniel Dunbar
019ef0bbfe
x86_64 ABI: Pass simple types directly when possible. This is
...
important for both keeping the generated LLVM simple and for ensuring
that integer types are passed/promoted correctly.
llvm-svn: 64529
2009-02-14 02:09:24 +00:00
Douglas Gregor
538c3d8459
Make it possible for builtins to expression FILE* arguments, so that
...
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.
llvm-svn: 64526
2009-02-14 01:52:53 +00:00
Chris Lattner
cd7bc144f6
fix rdar://6586493, a bug in codegen of the GNU
...
missing-?:-true-value extension.
llvm-svn: 64505
2009-02-13 23:35:32 +00:00
Douglas Gregor
b9063fc1b3
Implicitly declare certain C library functions (malloc, strcpy, memmove,
...
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:
1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).
2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.
This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2 , we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:
'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'
but we should really print out a fake code line showing the
declaration, like this:
'strcpy' was implicitly declared here as:
char *strcpy(char *, char const *)
This would also be good for printing built-in candidates with C++
operator overloading.
The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.
llvm-svn: 64504
2009-02-13 23:20:09 +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
5db3ef6fbb
Simplify predicate.
...
llvm-svn: 64500
2009-02-13 22:49:13 +00:00
Daniel Dunbar
128a138a57
IRgen support for attribute used.
...
- PR3566
llvm-svn: 64492
2009-02-13 22:08:43 +00:00
Daniel Dunbar
6b8720e723
Pull MayDeferGeneration out of EmitGlobal.
...
- Fix emission of static functions with constructor attribute while I
was here.
<rdar://problem/6140899> [codegen] "static" and attribute-constructor interact poorly
llvm-svn: 64488
2009-02-13 21:18:01 +00:00
Daniel Dunbar
08b26a0587
Rename EmitStatics (etc) to EmitDeferred; provide basic infrastructure
...
for attribute used support.
- No functionality change.
llvm-svn: 64487
2009-02-13 20:29:50 +00:00
Mike Stump
499ae7ec91
Let the backend unique these.
...
llvm-svn: 64486
2009-02-13 20:17:16 +00:00
Mike Stump
52d9c49d88
Fix spelling.
...
llvm-svn: 64482
2009-02-13 19:38:12 +00:00
Mike Stump
2c867aec40
Move DescriptorUniqueCount into CGM.
...
llvm-svn: 64481
2009-02-13 19:36:03 +00:00
Mike Stump
7ab278db06
Move NSConcreteStackBlock into CGM.
...
llvm-svn: 64479
2009-02-13 19:29:27 +00:00
Douglas Gregor
10a451cb36
Eliminate an unused variable
...
llvm-svn: 64476
2009-02-13 19:13:32 +00:00
Mike Stump
1676c5b2d8
Reflow to 80col.
...
llvm-svn: 64475
2009-02-13 19:12:34 +00:00
Mike Stump
9319db8a11
Move GlobalUniqueCount up into CGM.
...
llvm-svn: 64473
2009-02-13 18:36:05 +00:00
Fariborz Jahanian
d8fc1053ab
Fixed a 64bit code gen bug of a cateogory
...
implementation with no category declaration!
llvm-svn: 64470
2009-02-13 17:52:22 +00:00
Daniel Dunbar
abe6ef932f
x86_64 ABI: Support va_arg passed in mixed registers.
...
- Now at 1274 passes on gcc compat suite vs 1262.
llvm-svn: 64469
2009-02-13 17:46:31 +00:00
Mike Stump
971f9b6619
Condense NSConcreteGlobalBlock handling.
...
llvm-svn: 64461
2009-02-13 17:23:42 +00:00
Mike Stump
52197c7763
Calculate size correctly.
...
llvm-svn: 64459
2009-02-13 17:03:17 +00:00
Mike Stump
c2c38331ca
Size should be unsigned.
...
llvm-svn: 64458
2009-02-13 16:55:51 +00:00
Mike Stump
85284bacab
Condense all the blocks code into CGBlocks.cpp.
...
llvm-svn: 64457
2009-02-13 16:19:19 +00:00
Mike Stump
92bbd6d435
Fixup types, the runtime uses int, not int32.
...
llvm-svn: 64456
2009-02-13 16:01:35 +00:00
Mike Stump
57d7354635
Fix cmake builds.
...
llvm-svn: 64455
2009-02-13 15:42:50 +00:00
Mike Stump
b7074c0013
Fixup spacing a tad.
...
llvm-svn: 64454
2009-02-13 15:32:32 +00:00
Mike Stump
005c9a62b5
Move GenericBlockLiteralType into CGM.
...
llvm-svn: 64452
2009-02-13 15:25:34 +00:00
Mike Stump
650c932d80
Move BlockDescriptorType into CGM.
...
llvm-svn: 64451
2009-02-13 15:16:56 +00:00
Anders Carlsson
63784f4e5e
Add CodeGen support for the nodebug attribute.
...
llvm-svn: 64445
2009-02-13 08:11:52 +00:00
Eli Friedman
1efaaeaa69
Initial implementation of arbitrary fixed-width integer types.
...
Currently only used for 128-bit integers.
Note that we can't use the fixed-width integer types for other integer
modes without other changes because glibc headers redefines (u)int*_t
and friends using the mode attribute. For example, this means that uint64_t
has to be compatible with unsigned __attribute((mode(DI))), and
uint64_t is currently defined to long long. And I have a feeling we'll
run into issues if we try to define uint64_t as something which isn't
either long or long long.
This doesn't get the alignment right in most cases, including
the 128-bit integer case; I'll file a PR shortly. The gist of the issue
is that the targets don't really expose the information necessary to
figure out the alignment outside of the target description, so there's a
non-trivial amount of work involved in getting it working right. That
said, the alignment used is conservative, so the only issue with the
current implementation is ABI compatibility.
This makes it trivial to add some sort of "bitwidth" attribute to make
arbitrary-width integers; I'll do that in a followup.
We could also use this for stuff like the following for compatibility
with gcc, but I have a feeling it would be a better idea for clang to be
consistent between C and C++ modes rather than follow gcc's example for
C mode.
struct {unsigned long long x : 33;} x;
unsigned long long a(void) {return x.x+1;}
llvm-svn: 64434
2009-02-13 02:31:07 +00:00
Douglas Gregor
adb0201418
Add mangling for variadic functions and conversion functions
...
llvm-svn: 64425
2009-02-13 01:28:03 +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
Fariborz Jahanian
c335c40a4b
Fix a bug whereby, an ivar used to synthesize a property belongs
...
to a base class (nonfragile abi ir gen bug).
llvm-svn: 64391
2009-02-12 18:51:23 +00:00
Mike Stump
ab3afd8f2d
Initial codegen for block literals. This is a work in progress. I've
...
tried to put FIXMEs on the most important things to fix up. Lots left
to do including more codegen, more documentation and cleaning code and
style cleanups.
llvm-svn: 64390
2009-02-12 18:29:15 +00:00
Anders Carlsson
6a60fa2428
Add a very basic implemenation of global blocks. This needs to be cleaned up.
...
llvm-svn: 64387
2009-02-12 17:55:02 +00:00
Steve Naroff
b76051534c
Several cleanups:
...
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).
llvm-svn: 64385
2009-02-12 17:52:19 +00:00
Daniel Dunbar
648bf78333
Support __attribute__(section(<name>))
...
llvm-svn: 64380
2009-02-12 17:28:23 +00:00
Daniel Dunbar
753cc07d13
x86_64: Initial varargs support.
...
- Doesn't yet handle case where values are passed in mixed (general
purpose & floating point) registers; otherwise largely
functional. Code still needs some cleaning.
Fixes:
MultiSource/Applications/lua/lua
MultiSource/Applications/siod/siod
MultiSource/Applications/sqlite3/sqlite3
SingleSource/Regression/C/PR640
SingleSource/UnitTests/2003-07-09-SignedArgs
SingleSource/UnitTests/2007-03-02-VaCopy
gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1262
# of unexpected failures 56
# of unresolved testcases 34
# of unsupported tests 2
Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html
llvm-svn: 64370
2009-02-12 09:04:14 +00:00
Anders Carlsson
2437cbfa3b
Add support for generating block call expressions.
...
llvm-svn: 64346
2009-02-12 00:39:25 +00:00
Daniel Dunbar
e9fcadd2a6
Use EmitVAListRef instead of EmitLValue directly to handle array decay
...
case on x86_64.
llvm-svn: 64333
2009-02-11 22:25:55 +00:00
Daniel Dunbar
8d9dc4a6d5
Support IRgen of va_arg of structure as l-value.
...
llvm-svn: 64325
2009-02-11 20:59:32 +00:00
Fariborz Jahanian
74b7722c2c
ir-gen for objc's @selector expression in nonfragile abi mode.
...
llvm-svn: 64323
2009-02-11 20:51:17 +00:00
Douglas Gregor
6ec47f0d59
Silence a warning about an unused variable in -Asserts builds
...
llvm-svn: 64306
2009-02-11 16:17:49 +00:00
Chris Lattner
746b21361f
Fix rdar://6518463, increment of a bool is always true, due to
...
subtle and non-obvious promotion rules. We already handle +=
and +1 correctly.
llvm-svn: 64296
2009-02-11 07:40:06 +00:00
Chris Lattner
60dcdc7062
finish off codegen support for sub of pointer to functions,
...
finishing off rdar://6520707
llvm-svn: 64295
2009-02-11 07:21:43 +00:00
Anders Carlsson
7ccf3e4e28
Handle the case where EmitBlock might be called multiple times for the same block. Fixes PR3536.
...
llvm-svn: 64252
2009-02-10 22:50:24 +00:00
Fariborz Jahanian
d7264430e6
This patch is all it takes to pass all objc2's fast-enumeration
...
tests in the dejagnu test suite in the nonfragile abi mode.
llvm-svn: 64251
2009-02-10 22:46:12 +00:00
Daniel Dunbar
e46506eaea
Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
...
- Missed this file.
llvm-svn: 64238
2009-02-10 21:44:36 +00:00
Daniel Dunbar
2d0746fb97
Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
...
llvm-svn: 64235
2009-02-10 20:44:09 +00:00
Fariborz Jahanian
4e7ae06b00
Generate ir for ivar offset. This will pass
...
type-nsobject-attribute.m in the dejagnu test suite
in the nonfragile abi mode.
llvm-svn: 64233
2009-02-10 20:21:06 +00:00
Fariborz Jahanian
21fc74c15a
Some refactoring of Ivar offset code gen.
...
in preparation for nonfragile ivar offset work.
llvm-svn: 64225
2009-02-10 19:02:04 +00:00
Daniel Dunbar
9403cd6d85
Tweak x86-64 ABI to allow reuse for vararg handling.
...
llvm-svn: 64221
2009-02-10 17:06:09 +00:00
Anders Carlsson
33c1b6528f
Remove the last remnants of the Obj-C EH stack code.
...
llvm-svn: 64205
2009-02-10 06:07:49 +00:00
Anders Carlsson
33747b6c41
Start removing the old Obj-C EH stack now that the cleanup stack is used instead.
...
llvm-svn: 64203
2009-02-10 05:52:02 +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
Daniel Dunbar
0007961241
Support va_arg on _Complex.
...
gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1110
# of unexpected failures 74
# of unresolved testcases 168
# of unsupported tests 2
llvm-svn: 64197
2009-02-10 03:03:30 +00:00
Daniel Dunbar
9bfb4de38b
ABI: Correctly handle load/store of values which have a different LLVM
...
memory representation (e.g., bool).
- This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan
to a miscompile and fixes
SingleSource/UnitTests/2003-05-31-CastToBool.
llvm-svn: 64194
2009-02-10 01:51:39 +00:00
Daniel Dunbar
1d425460d5
Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
...
from LLVM memory type to/from LLVM temporary type.
- No intended functionality change.
llvm-svn: 64191
2009-02-10 00:57:50 +00:00
Daniel Dunbar
d5f1f55e28
Make sure to initialize local variables, even if they were ignored by
...
ABI.
llvm-svn: 64187
2009-02-10 00:06:49 +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
bfee7e921b
Use the new cleanup infrastructure for @try/@finally
...
llvm-svn: 64160
2009-02-09 20:38:58 +00:00
Anders Carlsson
1ac6282c5b
Replace a bunch of EmitBranch calls with EmitBranchThroughCleanup. No functionality change (yet).
...
llvm-svn: 64159
2009-02-09 20:31:03 +00:00
Anders Carlsson
ff0bb6ce62
Save and restore the DidCallStackSave variable
...
llvm-svn: 64157
2009-02-09 20:23:40 +00:00
Anders Carlsson
f4478e94b8
Add DidCallStackSave variable to CodeGenFunction.
...
llvm-svn: 64156
2009-02-09 20:20:56 +00:00
Douglas Gregor
8bf4205c70
Start processing template-ids as types when the template-name refers
...
to a class template. For example, the template-id 'vector<int>' now
has a nice, sugary type in the type system. What we can do now:
- Parse template-ids like 'vector<int>' (where 'vector' names a
class template) and form proper types for them in the type system.
- Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
using (sadly) a bool in the parser to tell it whether '>' should
be treated as an operator or not.
This is a baby-step, with major problems and limitations:
- There are currently two ways that we handle template arguments
(whether they are types or expressions). These will be merged, and,
most likely, TemplateArg will disappear.
- We don't have any notion of the declaration of class template
specializations or of template instantiations, so all template-ids
are fancy names for 'int' :)
llvm-svn: 64153
2009-02-09 18:46:07 +00:00
Mike Stump
fc49682f20
Add some more documentation. Also reflowed comments to 80 col.
...
llvm-svn: 64105
2009-02-08 23:14:22 +00:00
Anders Carlsson
9c964ac272
Reuse case destinations.
...
llvm-svn: 64100
2009-02-08 22:46:50 +00:00
Anders Carlsson
f57b9eef62
Always check if we can remove branch fixups, even if the cleanup stack is empty.
...
llvm-svn: 64099
2009-02-08 22:45:15 +00:00
Anders Carlsson
dcb149cbef
Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making it use the cleanup stack.
...
llvm-svn: 64098
2009-02-08 22:25:30 +00:00
Anders Carlsson
76180ea456
Misc fixes to the cleanup stack code.
...
llvm-svn: 64096
2009-02-08 22:13:37 +00:00
Mike Stump
a6dbd7b25a
When we're at the stack depth we want, there isn't anything to do.
...
llvm-svn: 64095
2009-02-08 22:00:53 +00:00
Mike Stump
284d177c7f
Wire up break and continue processing to the new stack depth adjuster.
...
If people could beat on it and let me know if there are any new
semantics required by newer language standards or DRs or any little
details I goofed on, I'd be happy to fix any issues found.
llvm-svn: 64079
2009-02-08 09:22:19 +00:00
Anders Carlsson
66c384ac2e
More cleanup stack work, PopCleanupBlock now returns a struct with the switch block and end block.
...
llvm-svn: 64072
2009-02-08 07:46:24 +00:00
Anders Carlsson
ae91d9b140
Split some functions up
...
llvm-svn: 64069
2009-02-08 03:55:35 +00:00
Anders Carlsson
a586ad7f85
CleanupScope needs to push the cleanup block in its destructor
...
llvm-svn: 64068
2009-02-08 03:22:36 +00:00
Anders Carlsson
3c21dd5a80
Implement support for branch fixups.
...
llvm-svn: 64064
2009-02-08 01:23:05 +00:00
Anders Carlsson
7d70fd27a4
More cleanup stack work.
...
llvm-svn: 64059
2009-02-08 00:50:42 +00:00
Anders Carlsson
fbfb5e6530
When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.
...
llvm-svn: 64053
2009-02-08 00:16:35 +00:00
Anders Carlsson
cadb9a6a34
Emit a cleanup block for the cleanup attribute
...
llvm-svn: 64052
2009-02-07 23:51:38 +00:00
Anders Carlsson
be0f76a712
Add support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup blocks if necessary
...
llvm-svn: 64051
2009-02-07 23:50:39 +00:00
Anders Carlsson
2cf8c44e43
Add a simple RAII object, to be used for pushing a cleanup entry and make the insertion point be the cleanup block.
...
llvm-svn: 64048
2009-02-07 23:30:41 +00:00
Mike Stump
0509d9635b
Ensure we track all the stack depths for all break and continue points
...
correctly. This should lay the ground work to throw the big switch
and start code gening break and continue in the presense of vlas.
llvm-svn: 64046
2009-02-07 23:02:10 +00:00
Anders Carlsson
15cb75a20c
Add plumbing for the cleanup stack.
...
llvm-svn: 64043
2009-02-07 22:53:43 +00:00
Anders Carlsson
bf8a1be33c
Split the exception object out into its own stack.
...
llvm-svn: 64032
2009-02-07 21:37:21 +00:00
Anders Carlsson
da0e4560a1
Simplify the Objective-C exception handling.
...
llvm-svn: 64031
2009-02-07 21:26:04 +00:00
Mike Stump
56d2a15829
Format for 80-cols.
...
llvm-svn: 64030
2009-02-07 20:14:12 +00:00
Mike Stump
6d8a617474
Ensure that we don't miscodegen if vlas creap into the top of the for.
...
This will allow us to generate break and continue even if vlas are
involved without worry that we'll silently generate bad code.
llvm-svn: 64028
2009-02-07 20:09:00 +00:00
Mike Stump
dc0d6be7b9
Arrange to have the correct StackDepth for while statements.
...
llvm-svn: 64021
2009-02-07 18:08:12 +00:00
Mike Stump
1f8be1b9ac
Fit into 80-col.
...
llvm-svn: 64020
2009-02-07 17:18:33 +00:00
Mike Stump
1d91dd98ad
Fixup goto codegen in and around VLAs.
...
llvm-svn: 64014
2009-02-07 12:52:26 +00:00
Daniel Dunbar
ee9e4c274b
Set load/store alignment when doing ABI coercions.
...
- Currently, this is producing poor code, but we prefer correctness
to performance for now. Eventually we should be able to generally
avoid having to set the alignment when we control the alignment of
the alloca.
- This knocks out 33/1000 failures on my single argument ABI tests,
down to 22/1000 and 18 of these appear to be gcc bugs. Woot.
llvm-svn: 64001
2009-02-07 02:46:03 +00:00
Daniel Dunbar
d404862cf9
When making dummy file entries, the directory name should also be
...
non-empty.
llvm-svn: 63986
2009-02-07 00:40:41 +00:00
Fariborz Jahanian
c76e741622
Fixed an objc2 nonfragile-abi code gen bug.
...
Now we can say 'hello world' objective-c style
in the nonfragile abi.
llvm-svn: 63981
2009-02-06 23:46:26 +00:00
Fariborz Jahanian
6b7cd6e5f4
objc2's nonfragile abi API for messages sent to 'super'.
...
llvm-svn: 63959
2009-02-06 20:09:23 +00:00
Daniel Dunbar
fe2fb0af5a
Use 'compile' instead of 'codegen' when reporting error to user.
...
llvm-svn: 63952
2009-02-06 19:18:03 +00:00
Fariborz Jahanian
33f66e640a
objc2's nonfragile-abi - API selection for when receiver is a class
...
llvm-svn: 63881
2009-02-05 20:41:40 +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
Fariborz Jahanian
4f9d349e07
More objc2's API chanes.
...
llvm-svn: 63878
2009-02-05 19:35:43 +00:00
Fariborz Jahanian
9065541262
#ifdef'out out objc2 API selection which is not done in gcc (unlike
...
the documentation to the contrary).
llvm-svn: 63871
2009-02-05 18:00:27 +00:00
Daniel Dunbar
5d3dbd64e1
Implement Direct ABIInfo semantics.
...
- No intended functionality change, this is essentially enabling
direct passing of complex and aggregate values, which no ABI is
using.
llvm-svn: 63863
2009-02-05 11:13:54 +00:00
Daniel Dunbar
cea3af4e54
Simplify test for whether we need an alloca to hold an indirect return
...
value.
- No functionality change.
llvm-svn: 63859
2009-02-05 09:24:53 +00:00
Daniel Dunbar
747865af0c
Implement ABI Indirect sematics for arguments.
...
- No intended functionality change, all current ABI implementations
were only using indirect for complex/aggregate types, which were
being passed indirectly with the Direct ABIInfo kind.
llvm-svn: 63858
2009-02-05 09:16:39 +00:00
Daniel Dunbar
b8b1c679c4
Merge ABIInfo StructRet/ByVal into Indirect.
...
- No (intended) functionality change, the semantic changes are to come.
llvm-svn: 63850
2009-02-05 08:00:50 +00:00
Daniel Dunbar
c79407fc40
Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.
...
llvm-svn: 63845
2009-02-05 07:09:07 +00:00
Dale Johannesen
621c3512a3
Reapply Daniel's patch to match up with llvm 63765.
...
Untested, Daniel or Nate please review.
llvm-svn: 63814
2009-02-05 01:50:47 +00:00
Daniel Dunbar
70245be397
x86-32: Use Ignore to avoid passing empty structs (instead of Expand).
...
llvm-svn: 63813
2009-02-05 01:50:07 +00:00
Daniel Dunbar
0103574d55
Honor ByVal alignment. Patch by Nate Begeman!
...
llvm-svn: 63811
2009-02-05 01:31:19 +00:00
Fariborz Jahanian
4e87c834d3
This patch generates messaging code for objc2's non-fragile abi.
...
llvm-svn: 63810
2009-02-05 01:13:09 +00:00
Daniel Dunbar
8045343ca2
Initialize alignment field for ByVal ABIInfo correctly.
...
llvm-svn: 63809
2009-02-05 01:01:30 +00:00
Daniel Dunbar
fff09f335d
Unbreak CGFunctionInfo::Profile method and reenable caching of ABI
...
information.
llvm-svn: 63799
2009-02-05 00:00:23 +00:00
Daniel Dunbar
400c040e01
Chase LLVM TOT in circles (i.e., revert r63773 to match revert of
...
r63765).
llvm-svn: 63795
2009-02-04 23:40:00 +00:00
Daniel Dunbar
56e7552c73
Add ABIArgInfo::dump()
...
llvm-svn: 63794
2009-02-04 23:24:38 +00:00
Daniel Dunbar
46353ece18
Use correct signature for calling enumeration mutation function.
...
llvm-svn: 63782
2009-02-04 22:00:33 +00:00
Daniel Dunbar
fb5fdf1f14
Temporarily disable caching of ABI results; this is going horribly
...
wrong in some cases.
llvm-svn: 63780
2009-02-04 21:36:22 +00:00
Daniel Dunbar
1e8052b36d
Add -femit-all-decls codegen option.
...
- Emits all declarations, even unused (static) ones.
- Useful when doing minimization of codegen problems (otherwise
problems localized to a static function aren't minimized well).
llvm-svn: 63776
2009-02-04 21:19:06 +00:00
Daniel Dunbar
a45bdbbb6a
Add asserts that the function signature matches the other arguments provide
...
to CGCall functions.
llvm-svn: 63775
2009-02-04 21:17:21 +00:00
Daniel Dunbar
91b73d441e
(llvm up) Update for intrinsic lookup changes.
...
llvm-svn: 63773
2009-02-04 21:09:15 +00:00
Fariborz Jahanian
e4dc35deb9
Some early code for objc2's nonfragile abi messaging.
...
llvm-svn: 63770
2009-02-04 20:42:28 +00:00
Fariborz Jahanian
b73a23e47e
Patch fixes messaging for GNU runtime.
...
Patch by David Chisnall
llvm-svn: 63769
2009-02-04 20:31:19 +00:00
Daniel Dunbar
6e3b7df125
Handle demotion of coerced arguments (as in void a(x) short x; { ... }).
...
llvm-svn: 63726
2009-02-04 07:22:24 +00:00
Chris Lattner
88ea93e6b4
lower the interface to getLineNumber like we did for
...
getColumnNumber. This fixes a FIXME in
SourceManager::getPresumedLoc because we now just decompose
the sloc once.
llvm-svn: 63701
2009-02-04 01:06:56 +00:00
Daniel Dunbar
310c5b1ab1
Update passing of _Bool values to match what function was declared to take.
...
llvm-svn: 63697
2009-02-04 00:55:44 +00:00
Daniel Dunbar
4d22e4975a
Change construction of common ObjC functions to use CGCall
...
infrastructure to construct function type.
- For consistencty, we should probably always use this to construct
function types, but these are absolutely necessary to ensure that
we can emit calls to these functions.
llvm-svn: 63695
2009-02-04 00:44:42 +00:00
Fariborz Jahanian
3d9296e6f5
Some function stub added for new abi messaging.
...
llvm-svn: 63691
2009-02-04 00:22:57 +00:00
Daniel Dunbar
84388bf397
Use CGCall infrastructure to call enumeration mutation function.
...
llvm-svn: 63685
2009-02-03 23:55:40 +00:00
Fariborz Jahanian
82c72e1ee4
Several new declarations for objc2 nonfragile
...
abi messaging.
llvm-svn: 63684
2009-02-03 23:49:23 +00:00
Daniel Dunbar
1ef7373ee8
Fix return type for calls to objc_setProperty.
...
llvm-svn: 63683
2009-02-03 23:43:59 +00:00
Daniel Dunbar
a33461150d
Use ConvertTypeForMem when creating alloca for scalar argument.
...
llvm-svn: 63681
2009-02-03 23:04:57 +00:00
Daniel Dunbar
ee3da87ce7
Add CodeGenFunction::ConvertTypeForMem forwarding function.
...
llvm-svn: 63678
2009-02-03 23:03:55 +00:00
Fariborz Jahanian
e80f317886
GNUStep fast enumeration.
...
Patch by David Chisnall.
llvm-svn: 63666
2009-02-03 21:52:35 +00:00
Daniel Dunbar
fc7c76159c
x86_64 ABI: Initial implementation of ABI compliant parameter passing.
...
- Now only 27/500 failures on ABITest single argument tests; from
350/500. :)
- As with return types, a large percentage of these are likely to be
gcc bugs, not yet reviewed.
Also, fix bug in handling of Ignore ABI type in argument lists.
llvm-svn: 63654
2009-02-03 20:00:13 +00:00
Daniel Dunbar
2f219b0770
ABI handling: Implement coercion for argument types (in addition to
...
return types).
llvm-svn: 63645
2009-02-03 19:12:28 +00:00
Fariborz Jahanian
712bfa6478
ir-gen for nonfragile ivar bitfield access (objc2 nonfragile abi).
...
llvm-svn: 63644
2009-02-03 19:03:09 +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
Fariborz Jahanian
ebc4c9d2a3
Minor objc2 bug fix.
...
llvm-svn: 63635
2009-02-03 17:34:34 +00:00
Sanjiv Gupta
3cac613eb8
Fixed the typo in comment.
...
llvm-svn: 63634
2009-02-03 17:23:12 +00:00
Daniel Dunbar
32931eb21d
Change ABIInfo to compute information for a full signature at a time
...
(the main point of this restructing).
llvm-svn: 63619
2009-02-03 06:51:18 +00:00
Daniel Dunbar
0136282a9c
Remove ABIArgInfo::Default kind, ABI is now responsible for specifying
...
acceptable kind with more precise semantics.
llvm-svn: 63617
2009-02-03 06:30:17 +00:00
Daniel Dunbar
67dace890f
Add ABIArgInfo::Direct kind, which passes arguments using whatever the
...
native IRgen type is. This is like Default, but without any extra
semantics (like automatic tweaking of structures or void).
llvm-svn: 63615
2009-02-03 06:17:37 +00:00
Daniel Dunbar
5a0acdc982
Add two FIXMEs.
...
llvm-svn: 63613
2009-02-03 06:02:10 +00:00
Daniel Dunbar
b52d077d8b
Always use CGFunctionInfo to access ABI information.
...
llvm-svn: 63612
2009-02-03 05:59:18 +00:00
Daniel Dunbar
313321ea23
Move ABIArgInfo into CGFunctionInfo, computed on creation.
...
- Still have to convert some consumers over.
llvm-svn: 63610
2009-02-03 05:31:23 +00:00
Daniel Dunbar
6d6b0d309a
Move ABIInfo/ABIArgInfo classes into ABIInfo.h
...
llvm-svn: 63586
2009-02-03 01:05:53 +00:00
Fariborz Jahanian
c88a70d885
objc2's ir-gen for nonfragile ivar access.
...
llvm-svn: 63578
2009-02-03 00:09:52 +00:00
Daniel Dunbar
e0be82956b
Memoize CGFunctionInfo construction.
...
llvm-svn: 63576
2009-02-03 00:07:12 +00:00
Daniel Dunbar
3668cb2d3c
Change CGFunctionInfo args iterator to not include the return type.
...
llvm-svn: 63571
2009-02-02 23:43:58 +00:00
Daniel Dunbar
bf8c24ad89
Thread CGFunctionInfo construction through CodeGenTypes.
...
- Inefficient & leaks memory currently, will be cleaned up subsequently.
llvm-svn: 63567
2009-02-02 23:23:47 +00:00
Daniel Dunbar
d931a87f90
More ABI API cleanup.
...
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and
EmitFunction{Epi,Pro}log.
llvm-svn: 63553
2009-02-02 22:03:45 +00:00
Daniel Dunbar
7633cbf005
ABI handling API changes.
...
- Lift CGFunctionInfo creation up to callers of EmitCall.
- Move isVariadic bit out of CGFunctionInfo, take as argument to
GetFunctionType instead.
No functionality change.
llvm-svn: 63550
2009-02-02 21:43:58 +00:00
Fariborz Jahanian
9f84b78ac1
Refactored code gen for ivar access in preparation for
...
objc2 nonfragile ivar access code gen.
llvm-svn: 63541
2009-02-02 20:02:29 +00:00
Daniel Dunbar
f5589ac5a9
Shuffle some functions around, no functionality change.
...
llvm-svn: 63538
2009-02-02 19:06:38 +00:00
Daniel Dunbar
50f520171c
Add FIXME.
...
llvm-svn: 63531
2009-02-02 18:06:39 +00:00
Eli Friedman
1f90fe17f9
Fix for PR3447: use padded sizes for computations on struct/union
...
constants.
llvm-svn: 63491
2009-02-01 08:12:19 +00:00
Daniel Dunbar
5df2b0baaa
Remove unused overload of GetFunctionType.
...
llvm-svn: 63472
2009-01-31 03:05:44 +00:00
Daniel Dunbar
a8b7f6bb13
Initialize CGFunctionInfo isVariadic bit correctly.
...
llvm-svn: 63471
2009-01-31 02:54:56 +00:00
Fariborz Jahanian
c22f236e81
Use target alignment API to set objc2's meta-data
...
alignment.
llvm-svn: 63470
2009-01-31 02:43:27 +00:00
Daniel Dunbar
a37249c663
Err, unbreak my previous "no functionality change commit", will fix properly later.
...
llvm-svn: 63467
2009-01-31 02:20:43 +00:00
Daniel Dunbar
3cd20632ff
Kill off CGCallInfo, always use CGFunctionInfo for encapsulating
...
function/call info.
llvm-svn: 63466
2009-01-31 02:19:00 +00:00
Fariborz Jahanian
0408723269
class meta-data belong to __objc_data section (in objc2
...
nonfragile abi).
llvm-svn: 63461
2009-01-31 01:07:39 +00:00
Fariborz Jahanian
822082517f
Recognize class's visibility attribute and set its linkage
...
to private extern (in objc2 nonfragile abi).
llvm-svn: 63460
2009-01-31 00:59:10 +00:00
Daniel Dunbar
34aa3ca8c4
x86_64 ABI: Retool classification to compute lo & hi classifications
...
in terms of where the type resides in the containing object. This is a
more clear embodiement of the spec & fixes a merging issue with
unions. Down to 3/1000 failures.
llvm-svn: 63455
2009-01-31 00:06:58 +00:00
Fariborz Jahanian
75e0351adb
Missed another mis-alignment of an objc2 meta-data.
...
llvm-svn: 63453
2009-01-30 23:51:52 +00:00
Fariborz Jahanian
e46e284efd
Setting correct alignent for objc2 meta-data.
...
llvm-svn: 63445
2009-01-30 23:15:42 +00:00
Daniel Dunbar
6a046c64d9
x86_64 ABI: Fix more thinkos, straddling computation for complex was
...
computing in bytes not bits. We are now down to 22/1000 failures on
the return types tests, and 18 of those are gcc bugs I believe.
llvm-svn: 63438
2009-01-30 22:40:15 +00:00
Fariborz Jahanian
fa57e8e7ab
add imag_info section and data (for objc2 nonfragile abi).
...
llvm-svn: 63430
2009-01-30 22:07:48 +00:00
Daniel Dunbar
c35dca92f5
x86_64 ABI: Fix thinko in prev commit, 64-bit vectors should have SSE
...
class, not integer.
llvm-svn: 63426
2009-01-30 21:50:20 +00:00
Fariborz Jahanian
279abd31a9
Generate list of implemented classes and categories in their
...
own sections (related to objc2 nonfragile abi).
llvm-svn: 63418
2009-01-30 20:55:31 +00:00
Daniel Dunbar
4d22eaeb44
x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, but
...
matches gcc 4.2 (not llvm-gcc).
llvm-svn: 63413
2009-01-30 19:38:39 +00:00
Fariborz Jahanian
097feda5e0
Code gen. for @protocol expression in the new nonfragile abi.
...
llvm-svn: 63408
2009-01-30 18:58:59 +00:00
Daniel Dunbar
7da8d0b321
Remove testing -use-x86_64-abi option; current implementation is
...
robust enough for general use.
llvm-svn: 63406
2009-01-30 18:47:53 +00:00
Daniel Dunbar
890c6b5520
x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to 33/500 return type failures.
...
llvm-svn: 63404
2009-01-30 18:40:10 +00:00
Anders Carlsson
221483dd4e
Make sure to cast the VLA size of array to the type of size_t. Fixes PR3442.
...
llvm-svn: 63394
2009-01-30 16:41:04 +00:00
Daniel Dunbar
f5222fa0ad
x86_64 ABI: Implement classification for arrays.
...
- This brings us down to an 8% failure rate on the first 500 return
types tests (from 12%).
llvm-svn: 63383
2009-01-30 08:09:32 +00:00
Anders Carlsson
02714ed353
Implement constant generation of ImplicitValueInitExprs.
...
llvm-svn: 63379
2009-01-30 06:13:25 +00:00
Daniel Dunbar
62dc51c395
Use uint64_t not unsigned for type sizes/offsets.
...
llvm-svn: 63352
2009-01-30 00:47:38 +00:00
Fariborz Jahanian
d9c28b808b
Bug fixing involving method-list in protocol meta-data
...
(objc2 nonfragile-abi).
llvm-svn: 63351
2009-01-30 00:46:37 +00:00
Fariborz Jahanian
34fe880648
Random bug fix related to protocl metadata in categories in
...
non-fragile abi.
llvm-svn: 63343
2009-01-29 23:23:06 +00:00
Fariborz Jahanian
61cd4b56c3
Set protocol linkage and visibility correctly and
...
build protocol translation table meta-data (objc2
non-fragile abi).
llvm-svn: 63329
2009-01-29 20:10:59 +00:00
Douglas Gregor
bf7207a11f
Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension
...
llvm-svn: 63327
2009-01-29 19:42:23 +00:00
Fariborz Jahanian
56b3b77c7d
Protocol meta-data for objc2's non-fragile abi.
...
Lot more to do in this area.
llvm-svn: 63326
2009-01-29 19:24:30 +00:00
Douglas Gregor
0202cb406e
Introduce a new expression node, ImplicitValueInitExpr, that
...
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.
The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.
llvm-svn: 63317
2009-01-29 17:44:32 +00:00
Douglas Gregor
5169570e28
Clean up designated initialization of unions, so that CodeGen doesn't
...
have to try to guess which member is being initialized.
llvm-svn: 63315
2009-01-29 16:53:55 +00:00
Daniel Dunbar
5537b8bc6c
x86_64 ABI: Handle fields / complex components which straddle
...
eightbyte boundaries.
- Getting harder to test now that we handle cases gcc & llvm-gcc get
wrong ( { _Complex char; _Complex int; } is a good example). :)
llvm-svn: 63305
2009-01-29 09:42:07 +00:00
Daniel Dunbar
7cd7d47c5c
x86_64 ABI: Tweak merging algorithm so that we always bail early when
...
we see a Memory classification.
llvm-svn: 63295
2009-01-29 08:35:40 +00:00
Daniel Dunbar
012468aa7f
ABI: When emitting calls which return an ignored argument, make sure
...
to still return an RValue of the correct type.
llvm-svn: 63294
2009-01-29 08:24:57 +00:00
Daniel Dunbar
17aa941534
x86_64 ABI: Implement classification for records.
...
- This is my best initial guess at what the "spec" means, although it is not
particularly clear on a number of points. Will refine through testing.
llvm-svn: 63292
2009-01-29 08:13:58 +00:00
Daniel Dunbar
227e1a77ff
x86_64: Support cases which map to returning multiple values in LLVM
...
(e.g., _Complex double -> { double, double } return).
llvm-svn: 63285
2009-01-29 07:36:07 +00:00
Daniel Dunbar
8e6652affc
x86_64 ABI: Classify _Complex ints as integer.
...
llvm-svn: 63283
2009-01-29 07:22:20 +00:00
Daniel Dunbar
dc8b4b0594
Fix typo
...
llvm-svn: 63281
2009-01-29 06:44:03 +00:00
Douglas Gregor
17bd094a6b
Improvements to code-generation and semantic analysis of designated
...
initializers.
- We now initialize unions properly when a member other than the
first is named by a designated initializer.
- We now provide proper semantic analysis and code generation for
GNU array-range designators *except* that side effects will occur
more than once. We warn about this.
llvm-svn: 63253
2009-01-28 23:36:17 +00:00
Fariborz Jahanian
d27a820ae2
Add setter/getter methods to the list of methods
...
of class's meta-data (related to objc2 nonfragile abi).
llvm-svn: 63251
2009-01-28 22:46:49 +00:00
Daniel Dunbar
f50e60b23a
Implement basic _Complex integer constant folding.
...
- Merged into single ComplexEvaluator, these share too much logic to
be worth splitting for float/int (IMHO). Will split on request.
llvm-svn: 63248
2009-01-28 22:24:07 +00:00
Fariborz Jahanian
066347ec7b
property metadata for objc2's nonfragile abi
...
llvm-svn: 63246
2009-01-28 22:18:42 +00:00
Douglas Gregor
347f7eabb9
Code generation support for C99 designated initializers.
...
The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.
Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)
llvm-svn: 63242
2009-01-28 21:54:33 +00:00
Fariborz Jahanian
b042a59230
Some refactoring of common code. No change in functionality.
...
llvm-svn: 63218
2009-01-28 19:12:34 +00:00
Fariborz Jahanian
3d3426f321
Set visibility of ivar offset symbols according to
...
accessibility of the ivar (related to objc2's
non-fragile abi).
llvm-svn: 63166
2009-01-28 01:36:42 +00:00
Fariborz Jahanian
40a4bcd49b
Generation of ivar-offset symbols in objc2's non-fragile abi.
...
Changed section names for meta-data (to match current gcc).
llvm-svn: 63163
2009-01-28 01:05:23 +00:00
Nuno Lopes
bb537dc189
fix PR3427: fix debuginfo for incomplete array types
...
llvm-svn: 63158
2009-01-28 00:35:17 +00:00
Fariborz Jahanian
e19a1f15ae
After talking to our runtime guru, I added a comment.
...
llvm-svn: 63141
2009-01-27 22:27:56 +00:00
Anders Carlsson
570c357ded
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417
...
llvm-svn: 63127
2009-01-27 20:38:24 +00:00
Fariborz Jahanian
7415caa3d4
ivar meta-data generation for nonfragile-abi.
...
Still more work to do in this area.
llvm-svn: 63126
2009-01-27 19:38:51 +00:00
Eli Friedman
3f66b84c86
Support CodeGen for __extension__ operator on aggregates.
...
llvm-svn: 63101
2009-01-27 09:03:41 +00:00
Chris Lattner
8d3f4a4b2f
improvements for GNU objc runtime support, patch by David Chisnall!
...
llvm-svn: 63092
2009-01-27 05:06:01 +00:00
Daniel Dunbar
d678d3d970
x86_64: Classify __m64 and __m128 "correctly".
...
- gcc appears to be classifying <1 x double> as INTEGER which is
odd. Will investigate later.
llvm-svn: 63086
2009-01-27 02:01:34 +00:00
Daniel Dunbar
0f4aa3cbb1
Implement support for coercion to wider types during ABI handling.
...
- Code quality is poor, but simple.
llvm-svn: 63083
2009-01-27 01:36:03 +00:00
Fariborz Jahanian
d0e8e85afc
Added a FIXME.
...
llvm-svn: 63071
2009-01-26 23:49:05 +00:00
Daniel Dunbar
fd346a3644
Pull EmitReturnBlock out of FinishFunction and catch unified return
...
case correctly.
llvm-svn: 63068
2009-01-26 23:27:52 +00:00
Fariborz Jahanian
2612e149ef
Build method-description-list for category meta-data
...
as well (for nonfragile-abi).
llvm-svn: 63062
2009-01-26 22:58:07 +00:00
Fariborz Jahanian
99113fd577
Method decription meta-data and its setting in class_ro_t
...
meta-data.
llvm-svn: 63043
2009-01-26 21:38:32 +00:00
Daniel Dunbar
94a6f25738
Add Ignore ABIArgInfo kind, for handling void & empty structures.
...
llvm-svn: 63039
2009-01-26 21:26:08 +00:00
Daniel Dunbar
336dbba387
Skip emission of final return block if possible (e.g., functions with
...
a unified return).
llvm-svn: 63038
2009-01-26 21:25:20 +00:00
Fariborz Jahanian
0c8d060715
Meta-data for nonfragile-abi's categories
...
llvm-svn: 63020
2009-01-26 18:32:24 +00:00
Daniel Dunbar
02fe821021
Comment fix.
...
llvm-svn: 63016
2009-01-26 18:02:34 +00:00
Sebastian Redl
8b2540439f
Introduce an explicit case for member pointers in CodeGenTypes. However, it simply asserts.
...
llvm-svn: 62960
2009-01-25 13:35:30 +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
Eli Friedman
cf2b7ba4a7
Get rid of some code that should be unnecessary.
...
llvm-svn: 62950
2009-01-25 02:10:46 +00:00
Eli Friedman
c69d454d5a
Make the constant folder aware of
...
__builtin___CFStringMakeConstantString. (We get into trouble in
GenerateStaticBlockVarDecl if the constant folder isn't accurate.)
llvm-svn: 62949
2009-01-25 01:54:01 +00:00
Eli Friedman
529a99bcf4
Fix the address of a label to be properly considered and emitted as a
...
constant.
llvm-svn: 62948
2009-01-25 01:21:06 +00:00
Fariborz Jahanian
a887e63434
Compute instaceStart/instanceSize fields of the class_ro_t meta-data
...
for objc2's non-fragile abi.
llvm-svn: 62945
2009-01-24 23:43:01 +00:00
Eli Friedman
8549e5dcc8
Fix for PR2910: implement CodeGen for non-constant offsetof.
...
Note that there are still other issues in this area; see PR3396.
llvm-svn: 62942
2009-01-24 22:38:55 +00:00
Eli Friedman
2aa38fea35
Refactor sizeof handling to use constant folding logic for constant
...
sizeof expressions.
llvm-svn: 62941
2009-01-24 22:19:05 +00:00
Fariborz Jahanian
4723fb70a9
Patch to build class meta-data for each implementation
...
of class in objc2's nonfragile abi.
llvm-svn: 62935
2009-01-24 21:21:53 +00:00
Chris Lattner
04964bbebe
remove a bunch of alignment handling code out of CGExprScalar, since
...
alignment must always be a constant. Just let the constant folder
do it.
llvm-svn: 62933
2009-01-24 21:09:45 +00:00
Chris Lattner
096d3ecb51
remove dead code.
...
llvm-svn: 62930
2009-01-24 20:24:49 +00:00
Fariborz Jahanian
9e3ad5220d
This patch builds the meta-class object for each
...
implemented class in objc2's nonfrigile abi.
llvm-svn: 62929
2009-01-24 20:21:50 +00:00
Daniel Dunbar
3334a44501
Start filling in x86_64 ABI implementation.
...
- No functionality change, moved behind -use-x86_64-abi option until
it becomes non-experimental.
llvm-svn: 62915
2009-01-24 08:32:22 +00:00
Fariborz Jahanian
71394045e4
Some very early work for new objc's
...
meta-data generation.
llvm-svn: 62894
2009-01-23 23:53:38 +00:00
Daniel Dunbar
42a8cd37b2
Handle pointer arithmetic on function pointers.
...
- <rdar://problem/6518844> Clang-generated bitcode crashes LLVM while compiling function pointer addition expression
llvm-svn: 62857
2009-01-23 18:51:09 +00:00
Fariborz Jahanian
7fa50496f6
Checked in an oops!
...
llvm-svn: 62853
2009-01-23 17:48:29 +00:00
Fariborz Jahanian
5a63e4cd53
Another missing LLVM type for objc2's new abi defined.
...
llvm-svn: 62852
2009-01-23 17:41:22 +00:00
Fariborz Jahanian
0232c0569f
Define LLVM types for nonfragile abi metadata.
...
llvm-svn: 62830
2009-01-23 01:46:23 +00:00
Fariborz Jahanian
b15a3d5969
Use NonFragileABI as name of new Next abi. More comments
...
for the new meta-data.
llvm-svn: 62806
2009-01-22 23:02:58 +00:00
Fariborz Jahanian
eee54df5b6
More refactoring of common API to the common class for
...
the two Next's objc runtimes. More comments.
llvm-svn: 62735
2009-01-22 00:37:21 +00:00
Daniel Dunbar
56493b0d54
Allow creation of "dummy" compile units for debug information.
...
- Although gross, this is needed currently to ensure that we produce
well formed debug information (to match pace with the assertions
being added to DebugInfo in LLVM).
llvm-svn: 62734
2009-01-22 00:09:25 +00:00
Fariborz Jahanian
0b1ccdce88
Moved whole bunch of common APIs to the common class.
...
No change in functionality.
llvm-svn: 62729
2009-01-21 23:34:32 +00:00
Fariborz Jahanian
279eda6275
Refactoring ObjC Next's runtime classes in preparation for
...
the new ObjC's abi.
llvm-svn: 62721
2009-01-21 22:04:16 +00:00
Chris Lattner
80261b30b7
revert the gnu objc patches, they regress codegen-gnu.m
...
llvm-svn: 62708
2009-01-21 19:37:47 +00:00
Chris Lattner
1d09218b98
switch from getTypeAtIndex to getElementType. It is non-virtual
...
and more idiomatic.
llvm-svn: 62705
2009-01-21 19:21:36 +00:00
Chris Lattner
d1760b7837
Fix objc type conversion issues with the GNU runtime, patch by
...
David Chisnall
llvm-svn: 62703
2009-01-21 18:52:19 +00:00
Chris Lattner
66c6562e24
silence a couple unused variable 'result' warnings.
...
llvm-svn: 62674
2009-01-21 07:35:26 +00:00
Fariborz Jahanian
4b4c826999
Commented objective-c's metadata types. Minor clean up.
...
No change in functionality.
llvm-svn: 62646
2009-01-21 00:39:53 +00:00
Eli Friedman
ddea0ade30
Slight cleanup, and fix for va_arg on architectures where va_list is a
...
struct.
llvm-svn: 62585
2009-01-20 17:46:04 +00:00
Eli Friedman
8687a09fd0
Do codegen correctly for va_start/end/copy on architectures where
...
va_list is a struct, like x86-64.
If anyone has a better idea for how to do the check in the if
statements, suggestions are welcome.
llvm-svn: 62582
2009-01-20 17:25:25 +00:00
Eli Friedman
08c5dabf1b
Fix for PR3350: add special-casing for "references" to va_lists in
...
builtins.
Also, a minor tweak to va_copy for consistency.
llvm-svn: 62574
2009-01-20 07:46:22 +00:00
Douglas Gregor
6e6ad602e5
Remove ScopedDecl, collapsing all of its functionality into Decl, so
...
that every declaration lives inside a DeclContext.
Moved several things that don't have names but were ScopedDecls (and,
therefore, NamedDecls) to inherit from Decl rather than NamedDecl,
including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't
store empty DeclarationNames for these things, nor do we try to insert
them into DeclContext's lookup structure.
The serialization tests are temporarily disabled. We'll re-enable them
once we've sorted out the remaining ownership/serialiazation issues
between DeclContexts and TranslationUnion, DeclGroups, etc.
llvm-svn: 62562
2009-01-20 01:17:11 +00:00
Daniel Dunbar
9789e1ebcb
Update for new SourceLocation API.
...
llvm-svn: 62556
2009-01-20 01:06:30 +00:00
Chris Lattner
cbc35ecb04
Rename SourceManager::getCanonicalFileID -> getFileID. There is
...
no longer such thing as a non-canonical FileID.
llvm-svn: 62499
2009-01-19 07:46:45 +00:00
Chris Lattner
f809bbdbb8
remove the SourceManager:: and FullSourceLoc::getFileEntryForLoc methods.
...
llvm-svn: 62496
2009-01-19 07:36:42 +00:00
Nate Begeman
b699c9bf57
Vector codegen improvements
...
llvm-svn: 62458
2009-01-18 06:42:49 +00:00
Anders Carlsson
a92271d067
CG support for inline asm constraints with symbolic names. Fixes PR3345
...
llvm-svn: 62444
2009-01-18 02:06:20 +00:00
Anders Carlsson
a79203be85
Add sema support for symbolic names in inline asm statements.
...
llvm-svn: 62441
2009-01-18 01:56:57 +00:00
Nate Begeman
1e31b168fa
Add support for vectors to APValue. Vector constant evaluator and tests coming.
...
llvm-svn: 62438
2009-01-18 01:01:34 +00:00
Anders Carlsson
19aa04d270
Change TargetInfo::validateInputConstraint to take begin/end name iterators instead of the number of outputs. No functionality change.
...
llvm-svn: 62433
2009-01-17 23:36:15 +00:00
Fariborz Jahanian
705c6d9cdd
Patch to re-implement ivar-list meta-data generation to fix
...
cases of unnamed ivar bitfields.
llvm-svn: 62429
2009-01-17 19:36:33 +00:00
Nuno Lopes
4d78cf0fa7
add support for usage of cast to union thing with static vars
...
llvm-svn: 62387
2009-01-17 00:48:48 +00:00
Fariborz Jahanian
55ca58ed61
Changed the API yet again.
...
llvm-svn: 62335
2009-01-16 19:02:53 +00:00
Fariborz Jahanian
195d36cb57
Used a more suitable api to get to the type of a record
...
in code gen.
llvm-svn: 62326
2009-01-16 17:41:13 +00:00
Chris Lattner
8a42586c54
more SourceLocation lexicon change: instead of referring to the
...
"logical" location, refer to the "instantiation" location.
llvm-svn: 62316
2009-01-16 07:36:28 +00:00
Daniel Dunbar
f557d831a7
Attempt to unbreak Windows build.
...
llvm-svn: 62295
2009-01-16 01:50:29 +00:00
Fariborz Jahanian
c5ece68d16
Implemented code gen for sizeof(objc class interface).
...
llvm-svn: 62289
2009-01-16 00:57:08 +00:00
Nuno Lopes
7ffcf93b24
add codegen support to union casts
...
init of static vars still not working. I'll get back to it tomorrow or so
llvm-svn: 62278
2009-01-15 20:14:33 +00:00
Daniel Dunbar
435bbe0254
Fix some unused variable, control reaches end of non-void function,
...
and uninitialized use options.
llvm-svn: 62270
2009-01-15 18:32:35 +00:00
Daniel Dunbar
707f6436e0
Add dummy X86_64 ABIInfo implementation.
...
llvm-svn: 62268
2009-01-15 18:18:40 +00:00
Daniel Dunbar
dec798bf37
Bug fix, __private_extern__ globals were always introducing a definition.
...
llvm-svn: 62139
2009-01-13 02:25:00 +00:00
Fariborz Jahanian
30e7864661
Patch to implement code gen for aggrgate-valued property used
...
to access a field of its type.
llvm-svn: 62123
2009-01-12 23:27:26 +00:00
Douglas Gregor
b3730b50c7
Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
...
llvm-svn: 62122
2009-01-12 23:27:07 +00:00
Daniel Dunbar
62db95e891
(LLVM up) Match TargetData API change in LLVM TOT.
...
llvm-svn: 62101
2009-01-12 21:08:18 +00:00
Anders Carlsson
00057e4e09
Handle multi-value inputs
...
llvm-svn: 62069
2009-01-12 02:22:13 +00:00
Nuno Lopes
a0abe62904
make ScalarExprEmitter::EmitCompare() emit the expression with the correct type instead of always zext it to an int
...
this fixes codegen of simple exprs in C++ like 'if (x != 0)'
llvm-svn: 62060
2009-01-11 23:22:37 +00:00
Anders Carlsson
431acd1129
More inline asm fixes
...
llvm-svn: 62049
2009-01-11 21:23:27 +00:00
Anders Carlsson
a948c34b0b
Handle readwrite constraints correctly
...
llvm-svn: 62043
2009-01-11 19:46:50 +00:00
Anders Carlsson
03aaf11502
Forgot to commit this
...
llvm-svn: 62042
2009-01-11 19:40:10 +00:00
Anders Carlsson
da5f56939b
Use a common function for emitting asm inputs and remove a FIXME
...
llvm-svn: 62041
2009-01-11 19:32:54 +00:00
Steve Naroff
ba3dc38840
Convert property implementation to DeclContext::addDecl().
...
This completes the ObjCContainerDecl AST cleanup (for now).
llvm-svn: 62037
2009-01-11 12:47:58 +00:00
Steve Naroff
5a7dd78ba2
Fix a misleading comment.
...
llvm-svn: 62031
2009-01-10 22:55:25 +00:00
Fariborz Jahanian
0196a1cd2b
This patch fixes the code gen failures which was a fallout from
...
not merging protocol properties into the classes which
use those protocols. With this patch, all my exceutable
test pass again.
llvm-svn: 62030
2009-01-10 21:06:09 +00:00
Fariborz Jahanian
d9c238dc9f
assert if attempting to code gen. a property setter/getter
...
coming from a protocol.
llvm-svn: 62017
2009-01-10 00:13:01 +00:00
Sebastian Redl
020cddcfee
Prevent a segfault for vaarg expressions on unsupported architectures.
...
llvm-svn: 62008
2009-01-09 21:09:38 +00:00
Daniel Dunbar
8429dbc753
Implement EmitUnsupportedRValue to generate an appropriately typed RValue.
...
llvm-svn: 62004
2009-01-09 20:09:28 +00:00
Douglas Gregor
ffca3a21f1
Provide a new kind of iterator, the specific_decl_iterator, that
...
filters the decls seen by decl_iterator with two criteria: the dynamic
type of the declaration and a run-time predicate described by a member
function. This simplifies EnumDecl, RecordDecl, and ObjCContainerDecl
considerably. It has no measurable performance impact.
llvm-svn: 61994
2009-01-09 17:18:27 +00:00
Daniel Dunbar
93215eca9b
Emit more refined "unsupported" error for block expressions.
...
llvm-svn: 61993
2009-01-09 17:04:29 +00:00
Daniel Dunbar
bb197e439d
Give "unsupported" error on calls through block pointers instead of
...
crashes.
llvm-svn: 61992
2009-01-09 16:50:52 +00:00
Steve Naroff
b3a8798253
Move property API's up to ObjCContainerDecl (removing a lot of duplicate code).
...
Add isa/cast/dyncast support for ObjCContainerDecl.
Renamed classprop_iterator/begin/end to prop_iterator/begin/end (the class prefix was confusing).
More simplifications to Sema::ActOnAtEnd()...
Added/changed some FIXME's as a result of the above work.
llvm-svn: 61988
2009-01-09 15:36:25 +00:00
Daniel Dunbar
cc1b6e8fce
Convert block types in IRgen. This is not the correct type, but
...
matches llvm-gcc (?).
llvm-svn: 61974
2009-01-09 02:48:46 +00:00
Daniel Dunbar
9b21e63251
Block pointer types are not aggregate types.
...
llvm-svn: 61973
2009-01-09 02:44:18 +00:00
Steve Naroff
11b387fee0
Remove redundant method context (now that ObjCMethodDecl isa ScopedDecl).
...
Convert clients to use the standard getDeclContext() API.
Doug, thanks for the review!
llvm-svn: 61935
2009-01-08 19:41:02 +00:00
Steve Naroff
35c62ae632
This is a large/messy diff that unifies the ObjC AST's with DeclContext.
...
- ObjCContainerDecl's (ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl), ObjCCategoryImpl, & ObjCImplementation are all DeclContexts.
- ObjCMethodDecl is now a ScopedDecl (so it can play nicely with DeclContext).
- ObjCContainerDecl now does iteration/lookup using DeclContext infrastructure (no more linear search:-)
- Removed ASTContext argument to DeclContext::lookup(). It wasn't being used and complicated it's use from an ObjC AST perspective.
- Added Sema::ProcessPropertyDecl() and removed Sema::diagnosePropertySetterGetterMismatch().
- Simplified Sema::ActOnAtEnd() considerably. Still more work to do.
- Fixed an incorrect casting assumption in Sema::getCurFunctionOrMethodDecl(), now that ObjCMethodDecl is a ScopedDecl.
- Removed addPropertyMethods from ObjCInterfaceDecl/ObjCCategoryDecl/ObjCProtocolDecl.
This passes all the tests on my machine. Since many of the changes are central to the way ObjC finds it's methods, I expect some fallout (and there are still a handful of FIXME's). Nevertheless, this should be a step in the right direction.
llvm-svn: 61929
2009-01-08 17:28:14 +00:00
Fariborz Jahanian
17290c3638
Objc's compatibility-alias semantics and code
...
gen issue fix.
llvm-svn: 61901
2009-01-08 01:10:55 +00:00
Fariborz Jahanian
475831bd6e
Another nasty code gen. bug with trivial fix. Calling class
...
method on 'super' receiver in a category implementation.
Other simpler cases were working by accident.
llvm-svn: 61880
2009-01-07 20:11:22 +00:00
Fariborz Jahanian
6e7ecc84c8
Couple of code gen. fixes in ObjC's colection-statement. Hard
...
to track down, easy to fix. This is on going.
llvm-svn: 61817
2009-01-06 18:56:31 +00:00
Douglas Gregor
c7acfdfe9a
Add QualifiedDeclRefExpr, which retains additional source-location
...
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
1) The use of a qualified-id instead of an unqualified-id suppresses
argument-dependent lookup
2) If the name refers to a virtual function, the qualified-id
version will call the function determined statically while the
unqualified-id version will call the function determined dynamically
(by looking up the appropriate function in the vtable).
Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.
llvm-svn: 61789
2009-01-06 05:10:23 +00:00
Sebastian Redl
1654ef0187
Silence a GCC warning
...
llvm-svn: 61747
2009-01-05 20:53:53 +00:00
Anders Carlsson
d8cd7b6c34
Generate debug info for VLA types
...
llvm-svn: 61661
2009-01-05 01:23:29 +00:00
Anders Carlsson
762e162284
Fix the bug that would cause Python to crash at startup.
...
When emitting the static variables we need to make sure that the order is preserved.
Fix this by making StaticDecls a std::list which has O(1) random removal.
llvm-svn: 61621
2009-01-04 02:08:04 +00:00
Anton Korobeynikov
d72f47aa05
Add full dllimport / dllexport support: both sema checks and codegen.
...
Patch by Ilya Okonsky
llvm-svn: 61437
2008-12-26 00:52:02 +00:00
Anders Carlsson
0462eb270a
Generate code for __builtin_ia32_pshufw
...
llvm-svn: 61324
2008-12-22 04:54:32 +00:00
Anders Carlsson
39def3adc8
Add codegen support for __null
...
llvm-svn: 61314
2008-12-21 22:39:40 +00:00
Anders Carlsson
3ebc7c4a0d
Implement alignof for vla types.
...
llvm-svn: 61305
2008-12-21 03:48:05 +00:00
Anders Carlsson
e0808df4a5
Add ASTContext::getBaseElementType and use it in CodeGenFunction::EmitArraySubscriptExpr.
...
llvm-svn: 61303
2008-12-21 03:44:36 +00:00
Anders Carlsson
76dbc0423e
Make sure to emit the size expression for sizeof(type)
...
llvm-svn: 61301
2008-12-21 03:33:21 +00:00
Eli Friedman
dea4193e8a
Fix for PR3246: an empty clobber list is the empty string, not a null
...
string.
That said, we should probably try and track down the correct clobber
lists for the targets that don't have them (PPC, ARM, and Sparc),
so that we can generate correct code.
llvm-svn: 61298
2008-12-21 01:15:32 +00:00
Anders Carlsson
3d312f8788
Handle VLA indexing
...
llvm-svn: 61295
2008-12-21 00:11:23 +00:00
Douglas Gregor
2eedc3aa1c
Add support for member references (E1.E2, E1->E2) with C++ semantics,
...
which can refer to static data members, enumerators, and member
functions as well as to non-static data members.
Implement correct lvalue computation for member references in C++.
Compute the result type of non-static data members of reference type properly.
llvm-svn: 61294
2008-12-20 23:49:58 +00:00
Eli Friedman
5ad3c91b27
Extend the unsupported error to include break and continue, and fix a
...
warning by using an unsigned index.
llvm-svn: 61292
2008-12-20 23:18:29 +00:00
Eli Friedman
f4084708cd
Make VLAs usable, and make basic usage work correctly. Also, add a
...
simple test that actually does VLA codegen.
Note that despite the fact that the alloca isn't in the entry block, it
should dominate all uses; this is guaranteed by the restrictions on goto
into VLA scope in C99.
llvm-svn: 61291
2008-12-20 23:11:59 +00:00
Anders Carlsson
5d985f5f16
Handle typedefs to VLAs (Emit the size expr when we encounter the typedef
...
llvm-svn: 61290
2008-12-20 21:51:53 +00:00
Anders Carlsson
fbef9c208f
Check the entire StackSaveValues stack for VLAs when dealing with goto and return statements. Noticed by Eli Friedman.
...
llvm-svn: 61289
2008-12-20 21:33:38 +00:00
Anders Carlsson
c20879a6e4
Make sure to generate code for arguments that have a variably modified type.
...
llvm-svn: 61288
2008-12-20 21:28:43 +00:00
Anders Carlsson
8a01b79274
Change EmitVLASize to take a QualType that must be a variably modified type.
...
Emit the size even if the declared type is a variably modified type. This lets us handle
void f(int n) {
int (*a)[n];
printf("size: %d\n", sizeof(*a));
}
llvm-svn: 61285
2008-12-20 20:46:34 +00:00
Anders Carlsson
e388a5bf44
Split up emitting of VLA sizes and getting the size of a VLA.
...
llvm-svn: 61284
2008-12-20 20:27:15 +00:00
Anders Carlsson
6200f0c533
Add some ErrorUnsupported calls and turn on VLA codegen again.
...
llvm-svn: 61283
2008-12-20 19:33:21 +00:00
Fariborz Jahanian
1d35f12e6b
More encoding support. This time for
...
@encode of classes and bitfields.
llvm-svn: 61268
2008-12-19 23:34:38 +00:00
Fariborz Jahanian
f8f0c6b1bc
Removed a slot in ObjCMemRegExpr used in
...
code gen which did not belong there.
llvm-svn: 61203
2008-12-18 17:29:46 +00:00
Daniel Dunbar
9ae0afdcd6
Allow ABI to use StructRet even for scalar values.
...
- Update comment to reflect fact that StructRet is now supported for
any type (modulo LLVM support).
- No functionality change, no scalar types currently use this
feature.
llvm-svn: 61192
2008-12-18 04:52:14 +00:00
Fariborz Jahanian
f327e89dab
This patch will build the Records lazily per Steve's comments.
...
Note that one test duplicate-ivar-check.m will fail because I
need to re-implement duplicate ivar checking.
llvm-svn: 61154
2008-12-17 21:40:49 +00:00
Eli Friedman
c8a590dda3
Warning fixes to operator precedence warnings.
...
Someone should double-check that I didn't somehow break ObjC
serialization; I think the change there actually changes the semantics.
llvm-svn: 61098
2008-12-16 20:06:41 +00:00
Nate Begeman
f2a6e5f0c0
Remove tabs.
...
llvm-svn: 61097
2008-12-16 19:57:09 +00:00
Fariborz Jahanian
48ee658562
Name of addLayoutToClass is confusing as no layout calculation
...
is done. Layout is calculated lazily at code gen type.
This patch changes the name.
llvm-svn: 61054
2008-12-15 21:58:08 +00:00
Fariborz Jahanian
b517e90662
Code gen. for ivar references; including bitfield
...
ivars.
llvm-svn: 61043
2008-12-15 20:35:07 +00:00
Anders Carlsson
6b958f9634
Store the size of the EH stack inside each BreakContinue struct so we know when a break/continue won't cross a try block.
...
llvm-svn: 60998
2008-12-13 22:52:24 +00:00
Fariborz Jahanian
b1378f9b0f
Patch for ObjCIvarRefExpr containing the field
...
matching the storage layout for this ivar
llvm-svn: 60996
2008-12-13 22:20:28 +00:00
Chris Lattner
e69336c22d
disable Anders' recent VLA patch, this fixes PR3209.
...
llvm-svn: 60989
2008-12-13 18:58:59 +00:00
Anders Carlsson
30032889ae
Implement allocation and sizeof VLAs. This is very basic for now.
...
llvm-svn: 60943
2008-12-12 07:38:43 +00:00
Anders Carlsson
ccbe9200f9
Add map of VLA types and their sizes
...
llvm-svn: 60939
2008-12-12 07:19:02 +00:00
Anders Carlsson
8a472c3151
Work in preparation for VLAs. Make sure to restore the stack if necessary (Saving the stack isn't implemented right now :)
...
llvm-svn: 60925
2008-12-12 05:52:00 +00:00
Chris Lattner
053441f39d
Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue
...
llvm-svn: 60924
2008-12-12 05:35:08 +00:00
Chris Lattner
b4396f40a0
add codegen support for __func__ and friends, producing the same
...
output that GCC does. rdar://6440297
llvm-svn: 60922
2008-12-12 05:18:02 +00:00
Douglas Gregor
7a4fad1b0b
Address some comments on the name lookup/DeclContext patch from Chris
...
llvm-svn: 60897
2008-12-11 20:41:00 +00:00
Douglas Gregor
e029561346
Actually distinguish between RecordDecl::field_iterator and RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls.
...
llvm-svn: 60883
2008-12-11 17:59:21 +00:00
Douglas Gregor
91f84216f7
Unifies the name-lookup mechanisms used in various parts of the AST
...
and separates lexical name lookup from qualified name lookup. In
particular:
* Make DeclContext the central data structure for storing and
looking up declarations within existing declarations, e.g., members
of structs/unions/classes, enumerators in C++0x enums, members of
C++ namespaces, and (later) members of Objective-C
interfaces/implementations. DeclContext uses a lazily-constructed
data structure optimized for fast lookup (array for small contexts,
hash table for larger contexts).
* Implement C++ qualified name lookup in terms of lookup into
DeclContext.
* Implement C++ unqualified name lookup in terms of
qualified+unqualified name lookup (since unqualified lookup is not
purely lexical in C++!)
* Limit the use of the chains of declarations stored in
IdentifierInfo to those names declared lexically.
* Eliminate CXXFieldDecl, collapsing its behavior into
FieldDecl. (FieldDecl is now a ScopedDecl).
* Make RecordDecl into a DeclContext and eliminates its
Members/NumMembers fields (since one can just iterate through the
DeclContext to get the fields).
llvm-svn: 60878
2008-12-11 16:49:14 +00:00
Anders Carlsson
a726c1763a
Append an extra newline to the module inline asm if it's not empty.
...
llvm-svn: 60827
2008-12-10 02:21:04 +00:00
Fariborz Jahanian
3d8552a75d
Support for implementation of property in the case where
...
the synthesis is in an implementation of s subclass of
a super class where the property has been declared.
llvm-svn: 60792
2008-12-09 20:23:04 +00:00
Chris Lattner
2e41b0e6e7
Fix a serious null termination bug found by David Chisnall!
...
llvm-svn: 60778
2008-12-09 19:10:54 +00:00
Fariborz Jahanian
8e0079c787
Change condition under which 'retain'/'copy' are directly evaluated.
...
llvm-svn: 60729
2008-12-08 23:56:17 +00:00
Douglas Gregor
4619e439b6
Introduce basic support for dependent types, type-dependent
...
expressions, and value-dependent expressions. This permits us to parse
some template definitions.
This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.
llvm-svn: 60615
2008-12-05 23:32:09 +00:00
Douglas Gregor
5101c24f60
Representation of template type parameters and non-type template
...
parameters, with some semantic analysis:
- Template parameters are introduced into template parameter scope
- Complain about template parameter shadowing (except in Microsoft mode)
Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates.
Next up: dependent types and value-dependent/type-dependent
expressions.
llvm-svn: 60597
2008-12-05 18:15:24 +00:00
Daniel Dunbar
2c4efe68ea
Mention an optimization opportunity pointed out by Chris.
...
llvm-svn: 60535
2008-12-04 09:05:45 +00:00
Sebastian Redl
45c2f9d320
Correct CodeGen assumption that LongTy == Int32Ty in a few places. This makes several CodeGenObjC tests pass on 64-bit by fixing assertions. This doesn't mean that the result is actually what the GNU runtime expects, though.
...
llvm-svn: 60515
2008-12-04 00:10:55 +00:00
Anders Carlsson
6a113d9ddb
If a global var decl has an initializer, make sure to always set its linkage to external.
...
llvm-svn: 60462
2008-12-03 05:51:23 +00:00
Eli Friedman
e918435f94
Fix for PR3150: obvious copy-paste bug in
...
ScalarExprEmitter::VisitBinLOr.
llvm-svn: 60415
2008-12-02 16:02:46 +00:00
Eli Friedman
f5d08c9ee4
Disabling this code due to regression on test/CodeGen/bitfield.c. See
...
PR3152.
llvm-svn: 60389
2008-12-02 01:17:45 +00:00
Anders Carlsson
8628645e94
Change more code over to using the new Expr::Evaluate
...
llvm-svn: 60324
2008-12-01 02:46:24 +00:00
Anders Carlsson
38eef1de6c
Change more code over to using the new Expr::Evaluate
...
llvm-svn: 60323
2008-12-01 02:42:14 +00:00
Anders Carlsson
c9687907c5
Use the new Expr::Evaluate
...
llvm-svn: 60321
2008-12-01 02:31:41 +00:00
Eli Friedman
c59bb48e80
Fix for PR2969: generate a memcpy from a constant for constant
...
initializers. llvm-gcc appears to be more aggressive, but incorrect,
for constructs like "const int a[] = {1,2,3};"; that said, current
optimizers will do the appropriate optimizations when safe.
llvm-svn: 60270
2008-11-30 02:11:09 +00:00
Daniel Dunbar
e9095f55c7
Test commit.
...
llvm-svn: 60147
2008-11-27 03:47:29 +00:00
Fariborz Jahanian
57251782d0
Code gen for aggregate-valued properties and a test case.
...
llvm-svn: 60122
2008-11-26 22:36:09 +00:00
Anders Carlsson
f7a9a92359
Convert incomplete array types before emitting debug info for them, fixes PR3134.
...
llvm-svn: 60109
2008-11-26 17:40:42 +00:00
Anders Carlsson
32ef8ceaa1
Handle returning complex types that get coerced. Fixes PR3131
...
llvm-svn: 60058
2008-11-25 22:21:48 +00:00
Daniel Dunbar
44b58a2c14
Fix 80-col violations.
...
llvm-svn: 60051
2008-11-25 21:53:21 +00:00
Anders Carlsson
9f77f60620
Remove the #ifdeffed out code.
...
llvm-svn: 60032
2008-11-25 17:10:10 +00:00
Chris Lattner
f3d3faeca6
Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
...
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.
This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.
llvm-svn: 59947
2008-11-24 05:29:24 +00:00
Chris Lattner
1cbaacc4a0
Migrate some stuff from NamedDecl::getName() to
...
NamedDecl::getNameAsString() to make it more explicit.
llvm-svn: 59937
2008-11-24 04:00:27 +00:00
Chris Lattner
86d7d91366
Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
...
assert if the name is not an identifier. Update callers to do the right
thing and avoid this method in unsafe cases. This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.
llvm-svn: 59936
2008-11-24 03:54:41 +00:00
Chris Lattner
e4b95698df
Rename Selector::getName() to Selector::getAsString(), and add
...
a new NamedDecl::getAsString() method.
Change uses of Selector::getName() to just pass in a Selector
where possible (e.g. to diagnostics) instead of going through
an std::string.
This also adds new formatters for objcinstance and objcclass
as described in the dox.
llvm-svn: 59933
2008-11-24 03:33:13 +00:00
Anders Carlsson
4046e65b27
An expression is not foldable if it can't be fully evaluated. Fixes PR3060
...
llvm-svn: 59887
2008-11-22 22:32:07 +00:00
Fariborz Jahanian
9ac535162b
Implemented ir-gen for 'implicit' properties using the new AST nodes.
...
llvm-svn: 59886
2008-11-22 22:30:21 +00:00
Anders Carlsson
59689ed764
Use Expr::Evaluate for case statements. Fixes PR2525
...
llvm-svn: 59881
2008-11-22 21:04:56 +00:00
Fariborz Jahanian
8a1810f06b
New AST node to access "implicit" setter/getter using property dor syntax.
...
Issuing diagnostics when assigning to read-only properties.
This is work in progress.
llvm-svn: 59874
2008-11-22 18:39:36 +00:00
Anders Carlsson
20e11f8fc8
Use tryEvaluate for constant exprs.
...
llvm-svn: 59857
2008-11-22 02:34:39 +00:00
Fariborz Jahanian
e2caaaa13c
Fixed bugzilla bug# 3095 related to code gen. for @synchronized.
...
llvm-svn: 59838
2008-11-21 19:21:53 +00:00
Fariborz Jahanian
735a4158d9
Fields of ivars of struct types are considered ivars
...
themselves for gc API generation purposes.
llvm-svn: 59828
2008-11-21 18:14:01 +00:00
Chris Lattner
0f137df0aa
reapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.
...
llvm-svn: 59824
2008-11-21 16:43:15 +00:00
Chris Lattner
b7f4ce3de7
temporarily revert Sangiv's patch.
...
llvm-svn: 59821
2008-11-21 16:26:37 +00:00
Sanjiv Gupta
371298488b
mem[cpy,set,move] intrinsics are now overloaded.
...
llvm-svn: 59806
2008-11-21 07:57:42 +00:00
Fariborz Jahanian
c2ad6dc3b4
Consolidated @try and @synchronize into a single
...
code gen. method.
llvm-svn: 59767
2008-11-21 00:49:24 +00:00
Fariborz Jahanian
75686a58f3
Support generation of objc_assign_ivar for ivar
...
write-barriers.
llvm-svn: 59748
2008-11-20 20:53:20 +00:00
Fariborz Jahanian
e881b536e8
Introducing objc_assign_ivar to clang.
...
llvm-svn: 59740
2008-11-20 19:23:36 +00:00
Fariborz Jahanian
d4081c697a
Added a test case for __weak field decls. Change SetVarDeclObjCAttribute
...
to static function. Added comments.
llvm-svn: 59738
2008-11-20 18:10:58 +00:00
Chris Lattner
68e486804f
Rename IdentifierInfo::isName to ::isStr. Use a nifty trick
...
from Sebastian to enforce that a literal string is passed in,
and use this to avoid having to call strlen on it.
llvm-svn: 59706
2008-11-20 04:42:34 +00:00
Fariborz Jahanian
003e83004b
More objc gc stuff. Read/Write barriers for local static/extern,
...
diagnostics on use of __weak attribute on fields,
Early support for read/write barriers for objc fields.
llvm-svn: 59682
2008-11-20 00:15:42 +00:00
Fariborz Jahanian
a598b5286e
More of objective-c's gc code-gen. Treat objective-c
...
objects as __strong when attribute unspecified.
llvm-svn: 59654
2008-11-19 18:38:10 +00:00
Fariborz Jahanian
50a1270d87
Few more changes due to Daniel's feedback.
...
llvm-svn: 59645
2008-11-19 17:34:06 +00:00
Daniel Dunbar
7689f6be47
Add spec ref to comment.
...
llvm-svn: 59622
2008-11-19 11:54:05 +00:00
Daniel Dunbar
9b1335eca8
Fix redundant load of bit-fields on assignment (to get the updated
...
value).
- Use extra argument to EmitStoreThroughLValue to provide place to
write update bit-field value if caller requires it.
- This fixes several FIXMEs.
llvm-svn: 59615
2008-11-19 09:36:46 +00:00
Sanjiv Gupta
f99d54498a
Pointer width for PIC16 is 16 bits. Modify getMemCpy, getMemMove and getMemSet accordingly.
...
llvm-svn: 59613
2008-11-19 09:02:07 +00:00
Chris Lattner
e503373e67
fix save-o
...
llvm-svn: 59611
2008-11-19 08:26:36 +00:00
Chris Lattner
d9c7bcf4bc
simplify
...
llvm-svn: 59610
2008-11-19 08:24:49 +00:00
Daniel Dunbar
1b9ad472a4
Discard unused runtime function declarations (for readability).
...
llvm-svn: 59594
2008-11-19 06:15:35 +00:00
Fariborz Jahanian
d7db964495
Generate strong write barriers for __strong objects.
...
Also, took care of Daniel's commments.
llvm-svn: 59575
2008-11-19 00:59:10 +00:00