Objective-C. Turn off designated initialization warnings on
'init' methods which are unavailable. Subclasses of NSObject
have to implement such methods as a common pattern to prevent
user's own implementation. // rdar://16305460
Richard Smith [Fri, 14 Mar 2014 20:26:09 +0000 (20:26 +0000)]
Try to remove confusion about C++11 feature support:
* Explicitly say that we conform to the two N/A bullets that required no
compiler changes.
* Remove a library feature from our features list.
Aaron Ballman [Fri, 14 Mar 2014 19:41:04 +0000 (19:41 +0000)]
[C++11] Replacing CapturedStmt iterators capture_init_begin() and capture_init_end() with iterator_range capture_inits(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 18:34:04 +0000 (18:34 +0000)]
[C++11] Replacing BlockDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
Objective-C. Allow objc_designated_initializer for private
initializers; but only those declared in class extensions
(not in implementations). // rdar://16305347
Aaron Ballman [Fri, 14 Mar 2014 18:08:33 +0000 (18:08 +0000)]
[C++11] Replacing CapturedStmt iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 17:01:24 +0000 (17:01 +0000)]
[C++11] Replacing DeclStmt iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 16:29:14 +0000 (16:29 +0000)]
[C++11] Replacing VarTemplateDecl iterators spec_begin() and spec_end() with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 16:13:33 +0000 (16:13 +0000)]
[C++11] Replacing ClassTemplateDecl iterators spec_begin() and spec_end() with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 16:05:56 +0000 (16:05 +0000)]
[C++11] Replacing FunctionTemplateDecl iterators spec_begin() and spec_end() with iterator_range specializations(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 15:55:35 +0000 (15:55 +0000)]
[C++11] Replacing OMPThreadPrivateDecl and OMPClause iterators varlist_begin() and varlist_end() with iterator_range varlists(). Updating all of the usages of the iterators with range-based for loops.
Objective-C++ IRGen. Due to change to AST for initialization of c++11’s
data members by addition of CXXDefaultInitExpr node to the initializer expression,
it has broken treatment of arc code for such initializations. Reviewed by John McCall.
// rdar://16299964
Aaron Ballman [Fri, 14 Mar 2014 15:28:49 +0000 (15:28 +0000)]
[C++11] Replacing DeclContext iterators lookups_begin() and lookups_end() with iterator_range lookups(). Similar for noload_lookups(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 15:16:45 +0000 (15:16 +0000)]
[C++11] Replacing ObjCImplementationDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 15:02:45 +0000 (15:02 +0000)]
[C++11] Replacing ObjCCategoryDecl iterators propimpl_begin() and propimpl_end() with iterator_range property_impls(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 13:13:27 +0000 (13:13 +0000)]
[C++11] Replacing ObjCCategoryDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 13:03:32 +0000 (13:03 +0000)]
[C++11] Replacing ObjCCategoryDecl iterators protocol_loc_begin() and protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 12:55:57 +0000 (12:55 +0000)]
[C++11] Replacing ObjCCategoryDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Fri, 14 Mar 2014 12:38:50 +0000 (12:38 +0000)]
[C++11] Replacing ObjCProtocolDecl iterators protocol_loc_begin() and protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 22:58:06 +0000 (22:58 +0000)]
[C++11] Replacing ObjCProtocolDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 21:57:01 +0000 (21:57 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators known_extensions_begin() and known_extensions_end() with iterator_range known_extensions(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 21:47:07 +0000 (21:47 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators visible_extensions_begin() and visible_extensions_end() with iterator_range visible_extensions(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 21:35:02 +0000 (21:35 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators known_categories_begin() and known_categories_end() with iterator_range known_categories(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 21:23:55 +0000 (21:23 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators visible_categories_begin() and visible_categories_end() with iterator_range visible_categories(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 21:09:43 +0000 (21:09 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators ivar_begin() and ivar_end() with iterator_range ivars(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 20:55:22 +0000 (20:55 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators all_referenced_protocol_begin() and all_referenced_protocol_end() with iterator_range all_referenced_protocols(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 20:34:24 +0000 (20:34 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators protocol_loc_begin() and protocol_loc_end() with iterator_range protocol_locs(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 20:29:09 +0000 (20:29 +0000)]
[C++11] Replacing ObjCInterfaceDecl iterators protocol_begin() and protocol_end() with iterator_range protocols(). Updating all of the usages of the iterators with range-based for loops.
Drive-by fixing some incorrect types where a for loop would be improperly using ObjCInterfaceDecl::protocol_iterator. No functional changes in these cases.
Aaron Ballman [Thu, 13 Mar 2014 20:11:06 +0000 (20:11 +0000)]
[C++11] Replacing ObjCContainerDecl iterators classmeth_begin() and classmeth_end() with iterator_range class_methods(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 19:50:17 +0000 (19:50 +0000)]
[C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops.
Tim Northover [Thu, 13 Mar 2014 19:25:48 +0000 (19:25 +0000)]
CodeGen: make use of weaker failure orders on cmpxchg.
This makes Clang take advantage of the recent IR addition of a
"failure" memory ordering requirement. As with the "success" ordering,
we try to emit just a single version if the expression is constant,
but fall back to runtime detection (to allow optimisation across
function-call boundaries).
Aaron Ballman [Thu, 13 Mar 2014 19:03:34 +0000 (19:03 +0000)]
[C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 18:47:37 +0000 (18:47 +0000)]
[C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() with iterator_range props(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 18:07:29 +0000 (18:07 +0000)]
[C++11] Replacing UsingDecl iterators shadow_begin() and shadow_end() with iterator_range shadows(). Updating all of the usages of the iterators with range-based for loops.
Jordan Rose [Thu, 13 Mar 2014 17:55:39 +0000 (17:55 +0000)]
[analyzer] Warn when passing pointers to const but uninitialized memory.
Passing a pointer to an uninitialized memory buffer is normally okay,
but if the function is declared to take a pointer-to-const then it's
very unlikely it will be modifying the buffer. In this case the analyzer
should warn that there will likely be a read of uninitialized memory.
This doesn't check all elements of an array, only the first one.
It also doesn't yet check Objective-C methods, only C functions and
C++ methods.
This is controlled by a new check: alpha.core.CallAndMessageUnInitRefArg.
Aaron Ballman [Thu, 13 Mar 2014 17:35:02 +0000 (17:35 +0000)]
[C++11] Replacing ObjCImplementationDecl iterators init_begin() and init_end() with iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 17:34:31 +0000 (17:34 +0000)]
[C++11] Replacing CXXRecordDecl iterators init_begin() and init_end() with iterator_range inits(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 17:08:33 +0000 (17:08 +0000)]
[C++11] Replacing CXXRecordDecl iterators capture_begin() and capture_end() with iterator_range captures(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 17:00:06 +0000 (17:00 +0000)]
[C++11] Replacing CXXRecordDecl iterators friend_begin() and friend_end() with iterator_range friends(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 16:51:27 +0000 (16:51 +0000)]
[C++11] Replacing CXXRecordDecl iterators ctor_begin() and ctor_end() with iterator_range ctors(). Updating all of the usages of the iterators with range-based for loops.
Ben Langmuir [Thu, 13 Mar 2014 16:46:36 +0000 (16:46 +0000)]
Prevent outputting HeaderFileInfos for files not used as headers
When building an AST file, we don't want to output HeaderFileInfo
structures for files that are not actually used as headers in the
current context. This can lead to assuming that unrelated files have
include counts of 0, defeating multiple-include prevention.
This is accomplished by adding an IsValid bit to the HFI.
Aaron Ballman [Thu, 13 Mar 2014 16:36:16 +0000 (16:36 +0000)]
[C++11] Replacing CXXRecordDecl iterators method_begin() and method_end() with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 16:15:17 +0000 (16:15 +0000)]
[C++11] Replacing CXXRecordDecl iterators vbases_begin() and vbases_end() with iterator_range vbases(). Updating all of the usages of the iterators with range-based for loops.
Aaron Ballman [Thu, 13 Mar 2014 15:41:46 +0000 (15:41 +0000)]
[C++11] Replacing CXXRecordDecl iterators bases_begin() and bases_end() with iterator_range bases(). Updating all of the usages of the iterators with range-based for loops.
Remove an unnecessary check for FormatTok not being null.
Summary:
This check hints clang analyzer, that FormatTok may be null, and it
reports a null pointer dereference error:
http://buildd-clang.debian.net/scan-build/report-827c64.html#Path28
Richard Smith [Thu, 13 Mar 2014 00:28:45 +0000 (00:28 +0000)]
PR18275: If a member function of a class template is declared with a
const-qualified parameter type and the defined with a non-const-qualified
parameter type, the parameter is not const inside its body. Ensure that
the type we use when instantiating the body is the right one. Patch by
suyog sarda!
This is still rather unsatisfactory; it seems like it might be better to
instantiate at least the function parameters, and maybe the complete function
declaration, when we instantiate the definition for such a member function
(instead of reusing the declaration from inside the instantiated class
definition).
Richard Smith [Wed, 12 Mar 2014 23:36:42 +0000 (23:36 +0000)]
Only allow streaming exactly type 'bool' to a DiagnosticBuilder, not anything
that implicitly converts to 'bool' (such as pointers, and the first operand of
?:). Clean up issues found by this. Patch by Stephan Tolksdorf!
Richard Smith [Wed, 12 Mar 2014 23:14:33 +0000 (23:14 +0000)]
Fix crash if delayed template parsing meets an erroneous trailing return type.
Based on a patch and test by Stephan Tolksdorf! Refactoring and fixing adjacent
brokenness by me.
Hans Wennborg [Wed, 12 Mar 2014 21:09:03 +0000 (21:09 +0000)]
MS intrinsics: don't declare __readeflags and __writeeflags in Intrin.h
They're already defined in ia32intrin.h, and this would cause including Intrin.h
in 64-bit mode to fail because of conflicting types. Update ms-intrin.cpp to
also run in 64-bit mode to catch things like this.
Justin Bogner [Wed, 12 Mar 2014 20:53:16 +0000 (20:53 +0000)]
CodeGen: Use a binary format for instrumentation based profiling
This updates CodeGenPGO to use the ProfileDataReader introduced to
llvm in r203703 and the new API for writing out the profile introduced
to compiler-rt in r203710.