Commit Graph

19 Commits

Author SHA1 Message Date
David Blaikie 6adc78e0df Replace TypeLoc llvm::cast support to be well-defined.
The TypeLoc hierarchy used the llvm::cast machinery to perform undefined
behavior by casting pointers/references to TypeLoc objects to derived types
and then using the derived copy constructors (or even returning pointers to
derived types that actually point to the original TypeLoc object).

Some context is in this thread:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html
Though it's spread over a few months which can be hard to read in the mail
archive.

llvm-svn: 175462
2013-02-18 22:06:02 +00:00
Benjamin Kramer 4ab984e74b Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.
llvm-svn: 159723
2012-07-04 20:19:54 +00:00
David Blaikie b15de1eaed Remove ref/value inconsistency in redecl_iterator.
Similar to r155808 - this mistake has been made in a few iterators.

Based on Chandler Carruth's feedback to r155808 I added an implicit conversion
to Decl* to ease adoption/usage. Useful for the pointer comparison, but not the
dyn_cast (due to template argument deduction causing the conversion not to be
used) - there for future convenience, though. This idiom (op T* for iterators)
seems to be fairly idiomatic within the LLVM codebase & I'll likely add it as I
fix up the other iterators here.

llvm-svn: 155869
2012-05-01 00:48:43 +00:00
David Blaikie 2d7c57ec1d Remove the ref/value inconsistency in filter_decl_iterator.
filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

llvm-svn: 155808
2012-04-30 02:36:29 +00:00
David Blaikie bbafb8a745 Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

llvm-svn: 152536
2012-03-11 07:00:24 +00:00
Argyrios Kyrtzidis 981a961d03 Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.
Needs llvm update.

llvm-svn: 151829
2012-03-01 19:45:56 +00:00
Argyrios Kyrtzidis bb5abc7b49 Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"
to make it more widely available.

Depends on llvm commit r151564

llvm-svn: 151566
2012-02-27 21:09:45 +00:00
Argyrios Kyrtzidis 01c047e003 [arcmt] GC migrator: don't try to remove redundant __strong, it does
more harm than good.

Fixes rdar://10522805&10521433

llvm-svn: 151424
2012-02-25 01:57:42 +00:00
Dylan Noblesmith 2c1dd2716a Basic: import SmallString<> into clang namespace
(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

llvm-svn: 149799
2012-02-05 02:13:05 +00:00
Benjamin Kramer 4903802fbf Move a method from IdentifierTable.h out of line and remove the SmallString include.
Fix all the transitive include users.

llvm-svn: 149783
2012-02-04 13:45:25 +00:00
Argyrios Kyrtzidis eca1f36a54 [arcmt] Integrate GC __weak into property attributes even when we don't have
the implementation.

llvm-svn: 145224
2011-11-28 02:04:36 +00:00
Argyrios Kyrtzidis 3fc3dcd80f [arcmt] Don't add __weak if there is already a GC __weak and make sure to clear
__weak from a readonly property.

llvm-svn: 145210
2011-11-28 00:23:12 +00:00
Argyrios Kyrtzidis 2519a0801f [arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
later on, or we will end up with a redundant '__unsafe_unretained'.

llvm-svn: 144059
2011-11-08 02:02:38 +00:00
Argyrios Kyrtzidis 722d21c646 [arcmt] In GC, handle (assign) @properties.
-Move __strong/__weak added to a property type to the property attribute,
e.g.  "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;"

-Remove (assign) in a property so that it becomes strong-by-default in ARC.

llvm-svn: 143979
2011-11-07 18:46:46 +00:00
Argyrios Kyrtzidis 0dd98a4c51 [arcmt] Map property decls to their GC attributes.
llvm-svn: 143978
2011-11-07 18:40:32 +00:00
Argyrios Kyrtzidis e80d4f228c [arcmt] In GC, change '__weak' -> '__unsafe_unretained' when applied
to objects of classes that don't support ARC weak

llvm-svn: 143976
2011-11-07 18:40:29 +00:00
Argyrios Kyrtzidis f233dac67c [arcmt] In GC, error for __strong/__weak on non-objc pointers.
llvm-svn: 143887
2011-11-06 18:58:23 +00:00
Argyrios Kyrtzidis 0c233fa23e [arcmt] In GC, clear redundant __strong's.
llvm-svn: 143886
2011-11-06 18:58:17 +00:00
Argyrios Kyrtzidis e43ae79038 [arcmt] Collect all the places where GC attributes __strong/__weak occur.
llvm-svn: 143883
2011-11-06 18:58:03 +00:00