Chris Lattner
553e583e1d
make the rewriter add a #ifndef around the #define of __attribute__.
...
Without it, there is no reason for a compiler that supports it to
emit the dead static globals that the rewriter labels attribute(used).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-13 17:33:56 +00:00
Chris Lattner
53eee7ba97
Instead of counting totally diagnostics, split the count into a count
...
of errors and warnings. This allows us to emit something like this:
2 warnings and 1 error generated.
instead of:
3 diagnostics generated.
This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:47:42 +00:00
Fariborz Jahanian
6cb6eb4c79
Add tentative support for accessing local variables with
...
external linkage (static, extern, etc.) in blocks in
rewriter. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 18:20:03 +00:00
Fariborz Jahanian
d314e9e123
Change the 'super' messaging API in the rewriter.
...
Fixes radar 7738452.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-10 21:17:41 +00:00
Fariborz Jahanian
a74326651c
Make rewritten source compiled with clang++.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97762 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 23:13:29 +00:00
Fariborz Jahanian
ef2b0d8c7b
Make rewritten source compiled with clang++ for correctness.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 23:03:49 +00:00
Fariborz Jahanian
7c7e349c99
Change test to compile rewritten test with clang++.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97756 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 21:57:21 +00:00
Fariborz Jahanian
61b82e3ed6
Fixes a bug whereby static const block var has static
...
moved incorrectly. (radar 7714443).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 18:54:29 +00:00
Fariborz Jahanian
72952fc11f
More rewriter of nested blocks fun stuff.
...
Radar 7696893.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97520 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 23:36:21 +00:00
Fariborz Jahanian
d64a4f4798
Prevent rewriter crash when variable type is missing.
...
Fixes radar 7692183.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 22:49:11 +00:00
Fariborz Jahanian
f89c4270c9
Fix rewriting of byref variables in nested blocks.
...
Fixes radar 7692350.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:55:31 +00:00
Fariborz Jahanian
e7c5c93e37
Rewriting of imported variable from outer
...
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:05:20 +00:00
Fariborz Jahanian
7c63fddad6
Support rewriting of property synthesis with retain/copy
...
attributes. Fixes radar 7214439.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 01:42:20 +00:00
Fariborz Jahanian
2ce692aa82
Added test case for non-objective-c situation in
...
my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:53:58 +00:00
Fariborz Jahanian
5e49b2f3e0
Implement nasty rewriting of nested blocks when inner
...
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:48:18 +00:00
Fariborz Jahanian
170ee0cb60
Correct radar no.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:37:04 +00:00
Fariborz Jahanian
86aa9fdbb5
Fix rewriting of a method when return type is
...
a block pointer type. Fixes radar 7682149.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:25:40 +00:00
Fariborz Jahanian
5f1c45f7c8
Fixes a rewriting of qualified-id type which exposed a bigger
...
rewriting problem. Fixes radar 7680953.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:34:38 +00:00
Fariborz Jahanian
1d35b16834
Fixes a rewriting of byref variable when its initializer is
...
itself rewritten. Radar 7669784.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-22 20:48:10 +00:00
Ted Kremenek
240670c8f8
Don't emit a warning about a dllimport attribute being used in a typedef
...
when -fms-extensions is specified. Fixes <rdar://problem/7653870>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 05:12:56 +00:00
Ted Kremenek
12911a85b2
Don't warn about functions redeclared without the dllimport attribute when
...
-fms-extensions is enabled. Fixes <rdar://problem/7669559>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96721 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-21 05:12:53 +00:00
Fariborz Jahanian
afad76f613
__typeof should be able to handle block pointer types when
...
rewriting. Fixes radar 7659483.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96549 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-18 01:20:22 +00:00
Fariborz Jahanian
0c7627c77c
More rewriter test converted to compile with clang.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:27:50 +00:00
Fariborz Jahanian
264e15902f
With addition of -Wno-address-of-temporary (thank you Doug) we can now
...
have rewriter test cases which pass the .cpp file through clang
and also test c++ aspect of clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96405 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 22:13:48 +00:00
Fariborz Jahanian
210c248449
Minor rewriter cleanup and a test for a block rewriting bug.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-16 17:26:03 +00:00
Fariborz Jahanian
aad49232a7
Test to compile the rewritten file for my last patch.
...
(radar 7649577 related).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96274 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 21:37:11 +00:00
Fariborz Jahanian
52b2e1e077
Fixes a rewriter bug rewriting function decl.
...
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 17:52:31 +00:00
Fariborz Jahanian
e61a1d4c57
Patch to rewrite blocks into unique api names.
...
Fixes radar 7630551
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 20:18:25 +00:00
Fariborz Jahanian
4c863ef92c
Provide rewriting suppport for use of __typeof__
...
in a declaration statement. Fixes radar 7628153.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 18:54:22 +00:00
Fariborz Jahanian
13751e3edc
Comment out category's property decls. in rewrite.
...
Fixes radar 7630636.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 01:15:09 +00:00
Fariborz Jahanian
8ca3eb0eca
Removed non-essential header file from test.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 18:04:36 +00:00
Fariborz Jahanian
376338a68d
Fixes a minor rewriter bug messaging inside a function call.
...
Fixes radar 7617047.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 17:48:10 +00:00
Fariborz Jahanian
2b9b0b2c9a
Fix a nested ivar reference rewriting bug.
...
(Fixes radar 7607605).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95341 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05 01:35:00 +00:00
Fariborz Jahanian
2663f527c2
Fix rewriting of 'const' __block variables in
...
the rewriter. (Fixes radar 7607781).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 00:07:58 +00:00
Fariborz Jahanian
32132a08c0
Fix more rewriting of protocol-quialified 'id' type.
...
(Fixes radar 7607413).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-03 21:29:28 +00:00
Fariborz Jahanian
84aa9464a4
Fix up rewriting of protocol qualified types in objc rewriter.
...
Fixes radar 7589414.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-02 18:35:07 +00:00
Fariborz Jahanian
0e1c99a1a9
Fixes rewriter bug rewriting byref related API where a struct
...
definition comes after where it is needed. Fixes radar 7589385.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 01:55:49 +00:00
Fariborz Jahanian
7e20ffe322
Fixes a rewrite bug rewriting nested ivars reference.
...
(Radar 7583971).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:41:20 +00:00
Fariborz Jahanian
a5d5fbcb44
Fix a regression caused by my rewriting of cast of ivar
...
access (was radar 7575882).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94481 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-26 00:29:22 +00:00
Fariborz Jahanian
5bfc536440
Fixes a rewriting bug of access ivar of a variable cast
...
to subclass. (Fixes radar 7575882).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-25 20:50:02 +00:00
Fariborz Jahanian
2f93a98d40
Enhance test to check on expected rewritten output.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94368 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-24 18:40:06 +00:00
Fariborz Jahanian
d0502407c1
Patch to implement rewriting of properties.
...
Fixes radar 7562952.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-21 17:36:00 +00:00
Fariborz Jahanian
1d4fca2e42
Rewriteing of gnu extension __typeof in objective-c rewriter.
...
Fixes radar 6358225.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 21:48:35 +00:00
Fariborz Jahanian
dfa4fa0fc5
Fix a rewriting crash and correct rewriting of __block
...
declaration where its initializer has a type-cast.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 19:36:43 +00:00
Fariborz Jahanian
bf07012cf9
Do not do the block-specific rewrite when there is no block literals.
...
Fixes radar 7546096.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 18:14:52 +00:00
Fariborz Jahanian
a73165e47a
Patch to avoid duplicate declaration of byref structs
...
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 23:05:52 +00:00
Fariborz Jahanian
abfd83e74c
Fix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
...
Fixes radar 7284618.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 00:35:56 +00:00
Fariborz Jahanian
c75da518fd
Fixes a rewrite bug rewriting a block call argument which has a trvial
...
constructor. Fixes radar 7537770.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 21:41:11 +00:00
Fariborz Jahanian
453c1349a5
Define __weak attribute for objective-c pointers in
...
win32 targets. Fixes radar 7530235. Daniel please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 18:33:57 +00:00
Fariborz Jahanian
66867c526c
Fix rewriting of MacOS sjlj based eh.
...
Fixes radar 7522880.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93219 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-12 01:22:23 +00:00