llvm-project/clang/lib/Lex
John McCall 460ce58fa6 Define weak and __weak to mean ARC-style weak references, even in MRC.
Previously, __weak was silently accepted and ignored in MRC mode.
That makes this a potentially source-breaking change that we have to
roll out cautiously.  Accordingly, for the time being, actual support
for __weak references in MRC is experimental, and the compiler will
reject attempts to actually form such references.  The intent is to
eventually enable the feature by default in all non-GC modes.
(It is, of course, incompatible with ObjC GC's interpretation of
__weak.)

If you like, you can enable this feature with
  -Xclang -fobjc-weak
but like any -Xclang option, this option may be removed at any point,
e.g. if/when it is eventually enabled by default.

This patch also enables the use of the ARC __unsafe_unretained qualifier
in MRC.  Unlike __weak, this is being enabled immediately.  Since
variables are essentially __unsafe_unretained by default in MRC,
the only practical uses are (1) communication and (2) changing the
default behavior of by-value block capture.

As an implementation matter, this means that the ObjC ownership
qualifiers may appear in any ObjC language mode, and so this patch
removes a number of checks for getLangOpts().ObjCAutoRefCount
that were guarding the processing of these qualifiers.  I don't
expect this to be a significant drain on performance; it may even
be faster to just check for these qualifiers directly on a type
(since it's probably in a register anyway) than to do N dependent
loads to grab the LangOptions.

rdar://9674298

llvm-svn: 251041
2015-10-22 18:38:17 +00:00
..
CMakeLists.txt [CMake] Use LINK_LIBS instead of target_link_libraries(). 2014-02-26 06:41:29 +00:00
HeaderMap.cpp Make VFS and FileManager match the current MemoryBuffer API. 2014-10-26 22:44:13 +00:00
HeaderSearch.cpp Add back null check removed accidentally in r250554 2015-10-20 18:45:57 +00:00
Lexer.cpp Disable trigraph and escaped newline expansion on all types of raw string literals not just ASCII type. 2015-10-22 15:35:21 +00:00
LiteralSupport.cpp [Lex] A source-file new-line in a raw string literal results in a new-line 2015-09-23 16:04:47 +00:00
MacroArgs.cpp [modules] Stop trying to fake up a linear MacroDirective history. 2015-04-29 23:20:19 +00:00
MacroInfo.cpp [modules] Add a mechanism to dump information about a macro. 2015-04-30 23:10:40 +00:00
Makefile
ModuleMap.cpp [modules] Remove unnecessary deserialization of fully-external HeaderFileInfos for all files we've seen in this compilation. 2015-08-24 21:59:32 +00:00
PPCaching.cpp Fix the build break introduced by r195799 by restoring two close 2013-11-27 01:40:12 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion. 2015-05-04 03:15:40 +00:00
PPDirectives.cpp Change MacroInfo::setArgumentList to take an ArrayRef instead of pointer and size. While there use std::copy intead of a manual loop. 2015-10-22 04:59:52 +00:00
PPExpressions.cpp SourceRanges are small and trivially copyable, don't them by reference. 2015-10-04 04:53:55 +00:00
PPLexerChange.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
PPMacroExpansion.cpp Define weak and __weak to mean ARC-style weak references, even in MRC. 2015-10-22 18:38:17 +00:00
PTHLexer.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Pragma.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
PreprocessingRecord.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Preprocessor.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
PreprocessorLexer.cpp Make Preprocessor::Lex non-recursive. 2013-09-19 00:41:32 +00:00
ScratchBuffer.cpp MSan told me that we actually dump the entire scratch buffer into PCH files, initialize it. 2015-04-06 20:01:49 +00:00
TokenConcatenation.cpp [clang] Refactoring of conditions so they use isOneOf() instead of multiple is(). 2015-06-18 10:59:26 +00:00
TokenLexer.cpp [clang] Refactoring of conditions so they use isOneOf() instead of multiple is(). 2015-06-18 10:59:26 +00:00
UnicodeCharSets.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00