Rafael Espindola
c50c27cca8
the big refactoring bits of PR3782.
...
This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.
llvm-svn: 99920
2010-03-30 20:24:48 +00:00
Benjamin Kramer
eb92dc0b09
Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
...
llvm-svn: 98630
2010-03-16 14:14:31 +00:00
Douglas Gregor
e0fbb83b8b
Give SourceManager a Diagnostic object with which to report errors,
...
and start simplifying the interfaces in SourceManager that can fail.
llvm-svn: 98594
2010-03-16 00:06:06 +00:00
Douglas Gregor
802b77601e
Introduce a new BufferResult class to act as the return type of
...
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.
Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).
llvm-svn: 98585
2010-03-15 22:54:52 +00:00
Fariborz Jahanian
3a106e7029
Add tentative support for accessing local variables with
...
external linkage (static, extern, etc.) in blocks in
rewriter. wip.
llvm-svn: 98265
2010-03-11 18:20:03 +00:00
Fariborz Jahanian
a4a925febb
Change the 'super' messaging API in the rewriter.
...
Fixes radar 7738452.
llvm-svn: 98190
2010-03-10 21:17:41 +00:00
Fariborz Jahanian
535c9c0ba2
Patch to get around a rewriter bug rewriting storage class
...
on a block API struct definition.
llvm-svn: 97754
2010-03-04 21:35:37 +00:00
Fariborz Jahanian
8bb35c4d7c
Fixes a bug whereby static const block var has static
...
moved incorrectly. (radar 7714443).
llvm-svn: 97734
2010-03-04 18:54:29 +00:00
Fariborz Jahanian
db217c4bad
Cast a pointer to 'long long' to satisfy all compilation models.
...
Satisfies radar 7703202.
llvm-svn: 97532
2010-03-02 01:19:04 +00:00
Fariborz Jahanian
f4609d431f
More rewriter of nested blocks fun stuff.
...
Radar 7696893.
llvm-svn: 97520
2010-03-01 23:36:21 +00:00
Fariborz Jahanian
6005bd821c
Prevent rewriter crash when variable type is missing.
...
Fixes radar 7692183.
llvm-svn: 97281
2010-02-26 22:49:11 +00:00
Fariborz Jahanian
be730c9e34
Minor cleanup of the rewriter.
...
llvm-svn: 97280
2010-02-26 22:36:30 +00:00
Fariborz Jahanian
9bbc148e16
Removed some unused code in rewriter.
...
llvm-svn: 97274
2010-02-26 21:46:27 +00:00
Fariborz Jahanian
ce2ea59d2c
Fix rewriting of byref variables in nested blocks.
...
Fixes radar 7692350.
llvm-svn: 97254
2010-02-26 19:55:31 +00:00
Fariborz Jahanian
5743d4d280
Rewriting of imported variable from outer
...
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.
llvm-svn: 97244
2010-02-26 19:05:20 +00:00
Fariborz Jahanian
ec201dc3c6
Support rewriting of property synthesis with retain/copy
...
attributes. Fixes radar 7214439.
llvm-svn: 97203
2010-02-26 01:42:20 +00:00
Fariborz Jahanian
8652be05b7
Implement nasty rewriting of nested blocks when inner
...
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).
llvm-svn: 97073
2010-02-24 22:48:18 +00:00
Fariborz Jahanian
f89eb2b9c2
Fix rewriting of a method when return type is
...
a block pointer type. Fixes radar 7682149.
llvm-svn: 97008
2010-02-24 01:25:40 +00:00
Fariborz Jahanian
c1b7acbaeb
Fixes a rewriting of qualified-id type which exposed a bigger
...
rewriting problem. Fixes radar 7680953.
llvm-svn: 96987
2010-02-23 21:34:38 +00:00
Fariborz Jahanian
b8f018d1e9
Fixes a rewriting of byref variable when its initializer is
...
itself rewritten. Radar 7669784.
llvm-svn: 96798
2010-02-22 20:48:10 +00:00
Douglas Gregor
36c569fb33
Eliminate the default arguments to ASTContext::getFunctionType(),
...
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.
llvm-svn: 96766
2010-02-21 22:15:06 +00:00
Ted Kremenek
013041eef0
Revert: "Change InitListExpr to allocate the array for holding references"
...
This was causing buildbot breakage.
This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.
llvm-svn: 96652
2010-02-19 01:50:18 +00:00
Ted Kremenek
445a603c78
Change InitListExpr to allocate the array for holding references
...
to initializer expressions in an array allocated using ASTContext.
This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.
In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.
llvm-svn: 96642
2010-02-19 00:42:33 +00:00
Fariborz Jahanian
aef662206b
Patch removes IVars list from ObjCInterfaceDecl and
...
instead relies on their DeclContext for iteration, etc.
llvm-svn: 96638
2010-02-19 00:31:17 +00:00
Fariborz Jahanian
f50679151b
__typeof should be able to handle block pointer types when
...
rewriting. Fixes radar 7659483.
llvm-svn: 96549
2010-02-18 01:20:22 +00:00
Fariborz Jahanian
b6a68c0465
Minor rewriter cleanup and a test for a block rewriting bug.
...
llvm-svn: 96361
2010-02-16 17:26:03 +00:00
Fariborz Jahanian
e1ff123214
Fix rewriter bug when function call inside block with block parameter
...
causes C++ compile error (radar 7651312).
llvm-svn: 96352
2010-02-16 16:21:26 +00:00
Fariborz Jahanian
02d964babe
Fix a broken rewritin of @implementation keyword.
...
(fixes radar 7649577).
llvm-svn: 96270
2010-02-15 21:11:41 +00:00
Benjamin Kramer
88ab94e7a3
Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.
...
llvm-svn: 96164
2010-02-14 14:14:16 +00:00
Fariborz Jahanian
a459c4453d
Fixes a rewriter bug rewriting function decl.
...
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.
llvm-svn: 95992
2010-02-12 17:52:31 +00:00
Fariborz Jahanian
4c4ca5a9d3
Fixes a rewriting bug where order of constructor expression arguments did not match
...
order of constructor arguments (all block API specific). This was exposed only in
a large block literal expression in a large file where PtrSet container size
execceded its limit and required reallocation. Fixes radar 7638294
llvm-svn: 95936
2010-02-11 23:35:57 +00:00
Ted Kremenek
2c809308ca
Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).
...
llvm-svn: 95930
2010-02-11 22:41:21 +00:00
Douglas Gregor
d505812422
Eliminate a bunch of unnecessary ASTContexts from members functions of
...
Decl subclasses. No functionality change.
llvm-svn: 95841
2010-02-11 01:19:42 +00:00
Fariborz Jahanian
c3bdefa08d
Patch to rewrite blocks into unique api names.
...
Fixes radar 7630551
llvm-svn: 95796
2010-02-10 20:18:25 +00:00
Fariborz Jahanian
bbf4320390
Provide rewriting suppport for use of __typeof__
...
in a declaration statement. Fixes radar 7628153.
llvm-svn: 95788
2010-02-10 18:54:22 +00:00
Fariborz Jahanian
68ebe63865
Comment out category's property decls. in rewrite.
...
Fixes radar 7630636.
llvm-svn: 95744
2010-02-10 01:15:09 +00:00
Ted Kremenek
31e7f0f293
Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
...
anything when Sema has issued an error. This matches the behavior in
RewriteObjC::HandleTranslationUnit().
llvm-svn: 95434
2010-02-05 21:28:51 +00:00
Fariborz Jahanian
314333847e
Fixes a minor rewriter bug messaging inside a function call.
...
Fixes radar 7617047.
llvm-svn: 95392
2010-02-05 17:48:10 +00:00
Fariborz Jahanian
a7e1dcdc0e
Some clean up of replacement text API no longer needed by
...
my recent changes.
llvm-svn: 95391
2010-02-05 16:43:40 +00:00
Fariborz Jahanian
80fadb5069
Fix a nested ivar reference rewriting bug.
...
(Fixes radar 7607605).
llvm-svn: 95341
2010-02-05 01:35:00 +00:00
Fariborz Jahanian
b8355e3b9f
Fix rewriting of 'const' __block variables in
...
the rewriter. (Fixes radar 7607781).
llvm-svn: 95267
2010-02-04 00:07:58 +00:00
Fariborz Jahanian
80c54b05a0
Fix more rewriting of protocol-quialified 'id' type.
...
(Fixes radar 7607413).
llvm-svn: 95257
2010-02-03 21:29:28 +00:00
Fariborz Jahanian
06769f9197
Fix up rewriting of protocol qualified types in objc rewriter.
...
Fixes radar 7589414.
llvm-svn: 95097
2010-02-02 18:35:07 +00:00
Fariborz Jahanian
b5f99c3f4f
Fixes rewriter bug rewriting byref related API where a struct
...
definition comes after where it is needed. Fixes radar 7589385.
llvm-svn: 94788
2010-01-29 01:55:49 +00:00
Fariborz Jahanian
81310810bd
Fixes a rewrite bug rewriting nested ivars reference.
...
(Radar 7583971).
llvm-svn: 94724
2010-01-28 01:41:20 +00:00
Fariborz Jahanian
f0ed69cb5b
Added assert to the rewrite.
...
llvm-svn: 94584
2010-01-26 20:37:44 +00:00
Fariborz Jahanian
f9e8c2b759
Refix rewriting of an ivar access when it is
...
type-cast to its sub-class (radar 7575882).
llvm-svn: 94559
2010-01-26 18:28:51 +00:00
Fariborz Jahanian
7b99f27392
Fix a regression caused by my rewriting of cast of ivar
...
access (was radar 7575882).
llvm-svn: 94481
2010-01-26 00:29:22 +00:00
Fariborz Jahanian
d360ce9d57
Fixes a rewriting bug of access ivar of a variable cast
...
to subclass. (Fixes radar 7575882).
llvm-svn: 94444
2010-01-25 20:50:02 +00:00
Fariborz Jahanian
da8ec2bc9e
Patch to implement rewriting of properties.
...
Fixes radar 7562952.
llvm-svn: 94087
2010-01-21 17:36:00 +00:00