Commit Graph

51411 Commits

Author SHA1 Message Date
Richard Smith dcc2c453a5 Range-ify and simplify some of the AST dumping code by factoring out the lastChild check.
llvm-svn: 204086
2014-03-17 23:00:06 +00:00
Richard Smith baf3ca5c01 Don't fold together the name lookup entries for two declarations if they are
declared in different namespaces in the same inline namespace set.

llvm-svn: 204082
2014-03-17 21:46:03 +00:00
Fariborz Jahanian ba419ce21d Objective-C. Consider blocks for designated initializer
warnings (warning or lack there of) as well since
blocks are another pattern for envoking other
designated initializers. // rdar://16323233

llvm-svn: 204081
2014-03-17 21:41:40 +00:00
Duncan P. N. Exon Smith 2fe531cb07 PGO: Statically generate data structures
In instrumentation-based profiling, we need a set of data structures to
represent the counters.  Previously, these were built up during static
initialization.  Now, they're shoved into a specially-named section so
that they show up as an array.

As a consequence of the reorganizing symbols, instrumentation data
structures for linkonce functions are now correctly coalesced.

This is the first step in a larger project to minimize runtime overhead
and dependencies in instrumentation-based profilng.  The larger picture
includes removing all initialization overhead and making the dependency
on libc optional.

<rdar://problem/15943240>

llvm-svn: 204080
2014-03-17 21:18:30 +00:00
Aaron Ballman ec47bc2bae [C++11] Replacing CGFunctionInfo arg iterators with iterator_range arguments(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204068
2014-03-17 18:10:01 +00:00
Fariborz Jahanian 83d674e007 Objective-C. Do not warn when an instance method and
class method with the same selctor but different argument 
types having one of them in class extension.
// rdar://16312105

llvm-svn: 204065
2014-03-17 17:46:10 +00:00
Aaron Ballman 36a7fa80ab [C++11] Replacing CallArgList writeback iterators with iterator_range writebacks(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.
llvm-svn: 204062
2014-03-17 17:22:27 +00:00
Aaron Ballman 804a7fb7ba [C++11] Replacing DeclContext iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions. Also used as an opportunity to normalize the name from getUsingDirectives() to using_directives().
llvm-svn: 204061
2014-03-17 17:14:12 +00:00
Aaron Ballman 5df6aa465e [C++11] Replacing Scope iterators using_directives_begin() and using_directives_end() with iterator_range using_directives(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.
llvm-svn: 204053
2014-03-17 17:03:37 +00:00
Aaron Ballman 35c5495bbb [C++11] Replacing Scope iterators decl_begin() and decl_end() with iterator_range decls(). Updating all of the usages of the iterators with range-based for loops, and removing the no-longer-needed iterator versions.
llvm-svn: 204052
2014-03-17 16:55:25 +00:00
Richard Smith 650459721a Remove unused variable from test.
llvm-svn: 204051
2014-03-17 16:53:13 +00:00
Aaron Ballman 83731469a1 [C++11] Replacing ObjCObjectPointerType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204048
2014-03-17 16:14:00 +00:00
Aaron Ballman 1683f7baf6 [C++11] Replacing ObjCObjectType iterators qual_begin() and qual_end() with iterator_range quals(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204047
2014-03-17 15:55:30 +00:00
Aaron Ballman b088fbee3f [C++11] Replacing FunctionProtoType iterators exception_begin() and exception_end() with iterator_range exceptions(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204046
2014-03-17 15:38:09 +00:00
Aaron Ballman 40bd0aaf68 [C++11] Replacing FunctionProtoType iterators param_type_begin() and param_type_end() with iterator_range param_types(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204045
2014-03-17 15:23:01 +00:00
Daniel Jasper 1fd6f1f8d6 clang-format: Indent from dict literal labels.
Before:
  @{
    NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :
    regularFont,
  };

After:
  @{
    NSFontAttributeNameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee :
        regularFont,
  };

llvm-svn: 204041
2014-03-17 14:32:47 +00:00
Aaron Ballman c7e4e219b5 [C++11] Replacing CompoundStmt iterators body_begin() and body_end() with iterator_range body(). Updating all of the usages of the iterators with range-based for loops.
llvm-svn: 204040
2014-03-17 14:19:37 +00:00
NAKAMURA Takumi 23b5eaf706 clang/test/CXX/drs: Add "REQUIRES:LP64" to a couple of tests in r204033. [PR8833]
llvm-svn: 204038
2014-03-17 11:55:46 +00:00
Richard Smith ba41a73993 Tests for DR400-450.
llvm-svn: 204033
2014-03-17 08:20:10 +00:00
Richard Smith d292b24f94 PR19152: If a variable template's type involves 'auto', instantiate the
initializer with the variable in order to determine the type.

llvm-svn: 204015
2014-03-16 01:00:40 +00:00
Benjamin Kramer a939c23aec Make some assertions on constant expressions static.
llvm-svn: 204012
2014-03-15 18:54:13 +00:00
Benjamin Kramer 4f938ef1d8 The year is 2014. MSVC is still unable to synthesize move ctors.
Work around with a ton of boilerplate.

llvm-svn: 204009
2014-03-15 17:35:02 +00:00
Benjamin Kramer 329c596e58 Preprocessor: Clarify the ownership of the IncludeMacroStack with unique_ptr.
llvm-svn: 204007
2014-03-15 16:40:40 +00:00
Benjamin Kramer a6f3950e39 Serialization: Directly compare objects instead of using a functor duplicating the compare operators.
No functionality change.

llvm-svn: 204006
2014-03-15 14:21:58 +00:00
Stephan Tolksdorf e96f8b3774 Fix PR18806: Canonicalize the replacement type when deserializing a SubstTemplateTypeParmType
What's going on in the test case (without the patch applied) is this:

When the header is parsed, decltype(B()) is canonicalized to decltype(Y()),
because that was the first parsed equivalent decltype expression. Hence, the
TemplateSpecializationType for Id<decltype(B())> ends up with
SubstTemplateTypeParmType(T, decltype(Y())) as the AliasedType member.

When the PCH file is included and the AST reader reads Id<decltype(B())>, it
sees decltype(B()) before decltype(Y()). So, this time decltype(B()) ends up
being the canonical type for both decltypes, which leads to an assert violation
when the reader calls getSubstTemplateTypeParmType with the non-canonical
decltype(Y()) as the replacement type.

Reviewers: rsmith

Reviewed By: rsmith

CC: cfe-commits, aemerson

Differential Revision: http://llvm-reviews.chandlerc.com/D3073

llvm-svn: 204005
2014-03-15 10:23:27 +00:00
Benjamin Kramer 8cef8867ee Remove dead functions from unreachable code analysis.
llvm-svn: 204004
2014-03-15 10:20:49 +00:00
Craig Topper 36835568d8 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 204002
2014-03-15 07:47:46 +00:00
Ted Kremenek 9dfe400dc2 -Wunreachable-code: treat 'const bool' locals as control values.
llvm-svn: 204001
2014-03-15 06:47:45 +00:00
Ted Kremenek ad8753c00e Further refine -Wunreachable-code groups so that -Wno-unreachable-code-break doesn't turn off all unreachable code warnings.
Also relax unreachable 'break' and 'return' to not check for being
preceded by a call to 'noreturn'.  That turns out to not be so
interesting in practice.

llvm-svn: 204000
2014-03-15 05:47:06 +00:00
Craig Topper fb6b25b5e4 [C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 203999
2014-03-15 04:29:04 +00:00
Ted Kremenek 1a8641c1e7 Start breaking -Wunreachable-code up into different diagnostic groups.
Recent work on -Wunreachable-code has focused on suppressing uninteresting
unreachable code that center around "configuration values", but
there are still some set of cases that are sometimes interesting
or uninteresting depending on the codebase.  For example, a dead
"break" statement may not be interesting for a particular codebase,
potentially because it is auto-generated or simply because code
is written defensively.

To address these workflow differences, -Wunreachable-code is now
broken into several diagnostic groups:

-Wunreachable-code: intended to be a reasonable "default" for
most users.

and then other groups that turn on more aggressive checking:

-Wunreachable-code-break: warn about dead break statements

-Wunreachable-code-trivial-return: warn about dead return statements
that return "trivial" values (e.g., return 0).  Other return
statements that return non-trivial values are still reported
under -Wunreachable-code (this is an area subject to more refinement).

-Wunreachable-code-aggressive: supergroup that enables all these
groups.

The goal is to eventually make -Wunreachable-code good enough to
either be in -Wall or on-by-default, thus finessing these warnings
into different groups helps achieve maximum signal for more users.

TODO: the tests need to be updated to reflect this extra control
via diagnostic flags.

llvm-svn: 203994
2014-03-15 01:26:32 +00:00
NAKAMURA Takumi 7ebbda83a2 ASTTests//EvaluateAsRValueTest.cpp: Appease *-win32 target to add -fno-delayed-template-parsing.
llvm-svn: 203991
2014-03-15 00:36:51 +00:00
Richard Smith ae385084c5 Implement the MS extension __identifier properly: take a token and strip it of
its keywordliness.

llvm-svn: 203987
2014-03-15 00:06:08 +00:00
Fariborz Jahanian e3b5c99fde Objective-C. Redo turning 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

llvm-svn: 203984
2014-03-14 23:30:18 +00:00
Richard Smith 594461f02c Call RequireCompleteType when performing ADL even if the type is already
complete. We hook into this check from a couple of other places (modules,
debug info) so it's not OK to elide the check if the type was already
complete.

llvm-svn: 203978
2014-03-14 22:07:27 +00:00
Aaron Ballman e6f465e51f [C++11] Removing the found_decls_begin() and found_decls_end() APIs and replacing with a range-only found_decls() API.
llvm-svn: 203975
2014-03-14 21:38:48 +00:00
Richard Smith 7e34fbdaa0 Add two missing entries to the C++11 support page. Bump one relevant diagnostic
(for an integer too large for any signed type) from Warning to ExtWarn -- it's
ill-formed in C++11 and C99 onwards, and UB during translation in C89 and
C++98. Add diagnostic groups for two relevant diagnostics.

llvm-svn: 203974
2014-03-14 21:21:24 +00:00
Aaron Ballman e42430ea31 [C++11] Removing the types_begin() and types_end() APIs and replacing with a range-only types() API.
llvm-svn: 203971
2014-03-14 21:11:14 +00:00
Aaron Ballman bbc3121301 [C++11] Removing the local_import_begin() and local_import_end() APIs and replacing with a range-only local_imports() API. Privatizes the iterator class as well.
llvm-svn: 203970
2014-03-14 20:59:21 +00:00
Fariborz Jahanian 312104a716 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

llvm-svn: 203966
2014-03-14 20:35:00 +00:00
Aaron Ballman f5d65b1ea7 Removing some unused functionality from AttributeList.
llvm-svn: 203965
2014-03-14 20:33:18 +00:00
Richard Smith d997cce05f 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.

llvm-svn: 203964
2014-03-14 20:26:09 +00:00
James Dennett 622831b739 Change a raw string literal back to C++98 style to fix freeBSD9.2 builtbot
llvm-svn: 203961
2014-03-14 20:08:11 +00:00
Aaron Ballman ba0238fa95 [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.
llvm-svn: 203959
2014-03-14 19:41:04 +00:00
Aaron Ballman 9371dd2287 [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.
llvm-svn: 203958
2014-03-14 18:34:04 +00:00
Fariborz Jahanian 6efab6eed7 Objective-C. Allow objc_designated_initializer for private
initializers; but only those declared in class extensions
(not in implementations). // rdar://16305347

llvm-svn: 203954
2014-03-14 18:19:46 +00:00
Aaron Ballman c656303a2c [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.
llvm-svn: 203953
2014-03-14 18:08:33 +00:00
Hans Wennborg 73945149b7 Fix VS2012 build after r203881
llvm-svn: 203951
2014-03-14 17:45:06 +00:00
James Dennett 0492ef0e0b Fix a crash (assertion failure) in EvaluateAsRValue.
Summary:
Gracefully fail to evaluate a constant expression if its type is
unknown, rather than failing an assertion trying to access the type.

Reviewers: klimek

Reviewed By: klimek

CC: chandlerc, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3075

llvm-svn: 203950
2014-03-14 17:44:10 +00:00
Timur Iskhodzhanov f1749427c5 Fix PR19104: Incorrect handling of non-virtual calls of virtual methods
Reviewed at http://llvm-reviews.chandlerc.com/D3054

llvm-svn: 203949
2014-03-14 17:43:37 +00:00