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
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
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
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
Aaron Ballman
f5d65b1ea7
Removing some unused functionality from AttributeList.
...
llvm-svn: 203965
2014-03-14 20:33:18 +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
Duncan P. N. Exon Smith
0a8f5ec255
NFC: remove unused variables from r203938, r203942, and r203947
...
llvm-svn: 203948
2014-03-14 17:19:40 +00:00
Aaron Ballman
535bbcccb1
[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.
...
llvm-svn: 203947
2014-03-14 17:01:24 +00:00
Aaron Ballman
9ddbf59109
Removing some more unused iterator methods for partial specializations.
...
llvm-svn: 203945
2014-03-14 16:32:36 +00:00
Aaron Ballman
c0768e81d3
[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.
...
llvm-svn: 203942
2014-03-14 16:29:14 +00:00
Aaron Ballman
c6e61715dd
Removing some unused iterator methods for partial specializations.
...
llvm-svn: 203941
2014-03-14 16:19:04 +00:00
Aaron Ballman
702fa310e5
[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.
...
llvm-svn: 203940
2014-03-14 16:13:33 +00:00
Aaron Ballman
b8733c5ba4
[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.
...
llvm-svn: 203938
2014-03-14 16:05:56 +00:00
Aaron Ballman
2205d2a56a
[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.
...
llvm-svn: 203937
2014-03-14 15:55:35 +00:00
Aaron Ballman
576114e676
[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.
...
llvm-svn: 203933
2014-03-14 15:28:49 +00:00
Aaron Ballman
d6d25de46e
[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.
...
llvm-svn: 203932
2014-03-14 15:16:45 +00:00
Aaron Ballman
d85eff49a3
[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.
...
llvm-svn: 203930
2014-03-14 15:02:45 +00:00
Aaron Ballman
865fbcdd8d
[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.
...
llvm-svn: 203924
2014-03-14 13:13:27 +00:00
Aaron Ballman
a73c85738c
[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.
...
llvm-svn: 203923
2014-03-14 13:03:32 +00:00
Aaron Ballman
19a417699f
[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.
...
llvm-svn: 203922
2014-03-14 12:55:57 +00:00
Aaron Ballman
a964ec1f14
[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.
...
llvm-svn: 203919
2014-03-14 12:38:50 +00:00
Craig Topper
b45acb8a16
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203893
2014-03-14 06:02:07 +00:00
Argyrios Kyrtzidis
6d0753d42a
[Modules] Emit the module file paths as dependencies of the PCH when we are building one.
...
This is because the PCH is tied to the module files, if one of the module files changes or gets removed
the build system should re-build the PCH file.
rdar://16321245
llvm-svn: 203885
2014-03-14 03:07:38 +00:00
Argyrios Kyrtzidis
68ccbe01b0
[Modules] Make sure that the synthesized file "__inferred_module.map" doesn't show up as dependency of a module file.
...
Follow-up for rdar://15459210
llvm-svn: 203882
2014-03-14 02:26:31 +00:00
Argyrios Kyrtzidis
ce9b49e5ec
Refactor ASTReader::readInputFileInfo to return a struct containing the related information.
...
No functionality change.
llvm-svn: 203881
2014-03-14 02:26:27 +00:00
Aaron Ballman
0f6e64d505
[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.
...
llvm-svn: 203863
2014-03-13 22:58:06 +00:00
Aaron Ballman
b4a5345598
[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.
...
llvm-svn: 203857
2014-03-13 21:57:01 +00:00
Aaron Ballman
f53d8dd37d
[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.
...
llvm-svn: 203855
2014-03-13 21:47:07 +00:00
Aaron Ballman
15063e19c6
[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.
...
llvm-svn: 203854
2014-03-13 21:35:02 +00:00
Aaron Ballman
3fe486a332
[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.
...
llvm-svn: 203851
2014-03-13 21:23:55 +00:00
Aaron Ballman
59abbd4d9b
[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.
...
llvm-svn: 203849
2014-03-13 21:09:43 +00:00
Aaron Ballman
a9f49e394c
[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.
...
llvm-svn: 203848
2014-03-13 20:55:22 +00:00
Aaron Ballman
e937888e1c
[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.
...
llvm-svn: 203847
2014-03-13 20:34:24 +00:00
Stephan Tolksdorf
232670fc05
Refactor InstantiatingTemplate constructors
...
This patch factors the bodies of 9 constructors out into a single initialization
method.
Reviewed By: rsmith
Differential Revision: http://llvm-reviews.chandlerc.com/D3059
llvm-svn: 203846
2014-03-13 20:34:22 +00:00
Aaron Ballman
a49c5064a1
[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.
llvm-svn: 203842
2014-03-13 20:29:09 +00:00
Aaron Ballman
e8a7dc9889
[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.
...
llvm-svn: 203840
2014-03-13 20:11:06 +00:00
Aaron Ballman
f26acce6f7
[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.
...
llvm-svn: 203839
2014-03-13 19:50:17 +00:00
Aaron Ballman
d174edffa0
Renaming the recently-created (r203830) props() range API to properties() for clarity.
...
llvm-svn: 203835
2014-03-13 19:11:50 +00:00
Aaron Ballman
aff18c0446
[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.
...
llvm-svn: 203832
2014-03-13 19:03:34 +00:00
Aaron Ballman
dc4bea4676
[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.
...
llvm-svn: 203830
2014-03-13 18:47:37 +00:00
Aaron Ballman
91cdc28d93
[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.
...
llvm-svn: 203825
2014-03-13 18:07:29 +00:00
Aaron Ballman
9bc5f36099
[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.
...
llvm-svn: 203820
2014-03-13 17:35:02 +00:00
Aaron Ballman
0ad78303de
[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.
...
llvm-svn: 203819
2014-03-13 17:34:31 +00:00
Aaron Ballman
6def98ab5f
[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.
...
llvm-svn: 203817
2014-03-13 17:08:33 +00:00
Aaron Ballman
522a6ddf9e
[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.
...
llvm-svn: 203815
2014-03-13 17:00:06 +00:00
Aaron Ballman
2a4bd6d189
[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.
...
llvm-svn: 203814
2014-03-13 16:51:27 +00:00
Ben Langmuir
d285c50390
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.
llvm-svn: 203813
2014-03-13 16:46:36 +00:00
Aaron Ballman
2b124d1a5d
[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.
...
llvm-svn: 203812
2014-03-13 16:36:16 +00:00
Aaron Ballman
445a939db8
[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.
...
llvm-svn: 203808
2014-03-13 16:15:17 +00:00
Aaron Ballman
ee1caf3bff
Removing some methods which appear to be unused (at least in clang, lld and lldb).
...
llvm-svn: 203805
2014-03-13 15:47:51 +00:00
Aaron Ballman
574705ed7f
[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.
...
llvm-svn: 203803
2014-03-13 15:41:46 +00:00
Craig Topper
2e5c11ff5c
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203769
2014-03-13 08:12:15 +00:00
Craig Topper
afa7cb3aa5
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203758
2014-03-13 06:07:04 +00:00
Craig Topper
3e89dfee00
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203746
2014-03-13 02:13:41 +00:00
Richard Smith
5b5d21ea1a
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!
llvm-svn: 203735
2014-03-12 23:36:42 +00:00
Richard Smith
8e6002f3bd
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.
llvm-svn: 203733
2014-03-12 23:14:33 +00:00
Fariborz Jahanian
44be154b04
Objective-C. Issue diagnostics on mismatched methods when their selector is used
...
in an @selector expression. // rdar://15794055
llvm-svn: 203693
2014-03-12 18:34:01 +00:00
Richard Smith
66204ecff9
DR1346: a parenthesized braced-init-list cannot be used as the initializer when
...
performing auto type deduction.
llvm-svn: 203683
2014-03-12 17:42:45 +00:00
Craig Topper
2b07f0252e
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203641
2014-03-12 05:09:18 +00:00
Craig Topper
e14c0f8e73
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203640
2014-03-12 04:55:44 +00:00
Ben Langmuir
dcf73861a5
Add an option -fmodules-validate-system-headers
...
When enabled, always validate the system headers when loading a module.
The end result of this is that when these headers change, we will notice
and rebuild the module.
llvm-svn: 203630
2014-03-12 00:06:17 +00:00
David Blaikie
29559b1efa
Driver: Support -gmlt as an alias for -gline-tables-only
...
llvm-svn: 203603
2014-03-11 21:05:26 +00:00
Fariborz Jahanian
bf678e82e1
Objective-C. Diagose use of undefined protocols
...
when a class adopts a protocol that inherits from
undefined protocols. // rdar://16111182
llvm-svn: 203586
2014-03-11 17:10:51 +00:00
Aaron Ballman
b5c59f5862
Gracefully handle an attribute specifier following a lambda introducer when the parameter list wasn't present.
...
llvm-svn: 203565
2014-03-11 13:03:15 +00:00
Tim Northover
c83472e0ff
Sema: demote invalid atomic ordering message to warning.
...
Someone could write:
if (0) {
__c11_atomic_load(ptr, memory_order_release);
}
or the equivalent, which is perfectly valid, so we shouldn't outright reject
invalid orderings on purely static grounds.
rdar://problem/16242991
llvm-svn: 203564
2014-03-11 11:35:10 +00:00
Tim Northover
e94a34cae2
Sema: produce error when invalid ordering is passed to atomic builtin
...
This is a conservative check, because it's valid for the expression to be
non-constant, and in cases like that we just don't know whether it's valid.
rdar://problem/16242991
llvm-svn: 203561
2014-03-11 10:49:14 +00:00
NAKAMURA Takumi
6c336fa5a7
clang::HeaderSearch: Use default constructor even for POD.
...
Unfortunately, msvc 2012 didn't accept non-static member initializer.
llvm-svn: 203554
2014-03-11 09:37:27 +00:00
Richard Smith
52e3fbaee8
Revert C++11ification in r203534 and r203536. Apparently our toolchains aren't
...
ready for this yet.
llvm-svn: 203548
2014-03-11 07:17:35 +00:00
Craig Topper
9140dd2fe7
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203547
2014-03-11 06:50:42 +00:00
Craig Topper
cbce6e9e63
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203543
2014-03-11 06:22:39 +00:00
Argyrios Kyrtzidis
34fad42003
[HeaderSearch] Fix issue where if a headermap entry maps the filename to a framework import (non-absolute path)
...
then we fail to find it if it is re-included later on.
rdar://16285490
llvm-svn: 203542
2014-03-11 06:21:28 +00:00
Craig Topper
3164f33f8f
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203537
2014-03-11 03:39:26 +00:00
Richard Smith
cf91493176
Speculative workaround for apparent libstdc++ bug exposed by r203534.
...
llvm-svn: 203536
2014-03-11 03:30:30 +00:00
Richard Trieu
99e1c9515a
Move the warning about unused relational comparison from -Wunused-value to
...
-Wunused-comparison. Also, newly warn on unused result from overloaded
relational comparisons, now also in -Wunused-comparison.
llvm-svn: 203535
2014-03-11 03:11:08 +00:00
Richard Smith
d91747980a
If a visibility update record is found for a DeclContext after that Decl has
...
already been loaded, apply that update record to the Decl immediately, rather
than adding it to a pending list and never applying it.
llvm-svn: 203534
2014-03-11 03:10:46 +00:00
Richard Smith
723928c7dc
If a module map is found in a relative -I path, convert the filenames within it
...
to absolute paths when building the includes file for the module. Without this,
the module build would fail, because the relative paths we were using are not
necessarily relative to a directory in our include path.
llvm-svn: 203528
2014-03-11 02:02:47 +00:00
David Majnemer
2f1f1818bf
Basic: Add -Wswitch-bool to control warn_bool_switch_condition
...
This warning was missing a flag, add one.
test/Misc/warning-flags.c has one fewer entry.
llvm-svn: 203522
2014-03-11 00:26:28 +00:00
Ben Langmuir
3fd7a63d67
Turn on the uncovered umbrella header warning by default
...
This warning (under -Wincomplete-umbrella) diagnoses cases that are
difficult to understand without the compiler's help, since the symptom
is likely to be that you are missing the contents of headers that are
mistakenly omitted from a module. This seems like a good thing to have
on by default (with the usual caveat for -Wsystem-headers).
llvm-svn: 203506
2014-03-10 22:34:23 +00:00
Benjamin Kramer
3f755aa7a8
[C++11] Avoid implicit conversion of ArrayRef to std::vector and use move semantics where appropriate.
...
llvm-svn: 203477
2014-03-10 17:55:02 +00:00
Aaron Ballman
be22bcb180
[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203474
2014-03-10 17:08:28 +00:00
Samuel Benzaquen
a083935d0a
Add loc() to the dynamic registry.
...
Summary:
Add loc() to the dynamic registry.
Other fixes:
- Fix the polymorphic variant value to accept an exact match, even if
there are other possible conversions.
- Fix specifiesTypeLoc() to not crash on an empty
NestedNameSpecifierLoc.
Reviewers: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2928
llvm-svn: 203467
2014-03-10 15:40:23 +00:00
Aaron Ballman
53d413f794
[C++11] Replacing some using declarations which are not supported on all compilers (such as MSVC 2012) with a less problematic typedef.
...
llvm-svn: 203397
2014-03-09 12:59:45 +00:00
Ahmed Charles
dfca6f97bc
[C++11] Replace OwningPtr include with <memory>.
...
llvm-svn: 203389
2014-03-09 11:36:40 +00:00
Ahmed Charles
af94d56b56
[C++11] Remove the remaining uses of OwningPtr.
...
Replace OwningArrayPtr with std::unique_ptr<T[]>.
llvm-svn: 203388
2014-03-09 11:34:25 +00:00
Ted Kremenek
2dd810a331
[-Wunreachable-code] Handle Objective-C bool literals in 'isConfigurationValue'.
...
This includes special casing 'YES' and 'NO', which are constants
defined as macros.
llvm-svn: 203380
2014-03-09 08:13:49 +00:00
Argyrios Kyrtzidis
b255ee91a7
[libclang] Don't pad the main buffer for the preamble.
...
Padding does not seem to be useful currently, and it leads to bogus location if an error
points to the end of the file.
rdar://15836513
llvm-svn: 203370
2014-03-09 04:24:57 +00:00
Aaron Ballman
b97112e4bd
[C++11] Replacing Decl iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
...
This is a reapplication of r203236 with modifications to the definition of attrs() and following the new style guidelines on auto usage.
llvm-svn: 203362
2014-03-08 22:19:01 +00:00
Aaron Ballman
e8a8baef44
[C++11] Replacing RecordDecl iterators field_begin() and field_end() with iterator_range fields(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203355
2014-03-08 20:12:42 +00:00
Aaron Ballman
23a6dcb365
[C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203353
2014-03-08 18:45:14 +00:00
Aaron Ballman
43027eb093
Reapplying r203299 in a slightly different manner. Now range APIs are implemented in terms of iterator APIs.
...
llvm-svn: 203351
2014-03-08 18:30:40 +00:00
Ted Kremenek
fcc1417fad
Fix CFG bug where the 'isTemporaryDtorsBranch' bit was silently lost for terminators.
...
llvm-svn: 203335
2014-03-08 02:22:29 +00:00
Ismail Pazarbasi
025f428c73
Replace "can not" with "cannot" in diagnostics messages.
...
llvm-svn: 203302
2014-03-07 22:36:23 +00:00
Aaron Ballman
da634f1dee
In my tests, I'm finding that declaring iterators in terms of ranges can sometimes have dangerous side-effects where the range temporary is destroyed, taking the underlying iterators out with it.
...
This changes the iterators so that they are no longer implemented in terms of ranges (so it's a very partial revert of the existing rangification efforts).
llvm-svn: 203299
2014-03-07 22:17:20 +00:00
Ahmed Charles
b89843299a
Replace OwningPtr with std::unique_ptr.
...
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Aaron Ballman
629afaefe0
[C++11] Replacing DeclBase iterators decls_begin() and decls_end() with iterator_range decls(). The same is true for the noload versions of these APIs. Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203278
2014-03-07 19:56:05 +00:00
Ahmed Charles
d72a5f103d
Replace OwningPtr::isValid() with conversion to bool.
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203277
2014-03-07 19:51:06 +00:00
Ahmed Charles
9a16beb8bc
Change OwningPtr::take() to OwningPtr::release().
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203275
2014-03-07 19:33:25 +00:00
Aaron Ballman
29c9460d3e
Renaming the chains() ranged iterator to chain() per suggestion by Richard Smith.
...
llvm-svn: 203262
2014-03-07 18:36:15 +00:00
Aaron Ballman
1391608234
[C++11] Replacing IndirectFieldDecl iterators chain_begin() and chain_end() with iterator_range chains(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203261
2014-03-07 18:11:58 +00:00
Aaron Ballman
43b68bebe7
[C++11] Replacing ObjCMethodDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203255
2014-03-07 17:50:17 +00:00
Aaron Ballman
e7fbde8cb6
[C++11] Adding an iterator_range accessor for parameter declarations to the CaptureDecl class; however, the only usage of the iterators cannot be converted to using the range yet. This change is for consistency with other Decls exposing parameters.
...
llvm-svn: 203252
2014-03-07 16:40:17 +00:00
Aaron Ballman
b2b8b1dc66
[C++11] Replacing BlockDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203250
2014-03-07 16:09:59 +00:00
Aaron Ballman
f6bf62e2d0
[C++11] Replacing FunctionDecl iterators param_begin() and param_end() with iterator_range params(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203248
2014-03-07 15:12:56 +00:00
Benjamin Kramer
ed2f476b20
[C++11] Replace LLVM-style type traits with C++11 standard ones.
...
No functionality change.
llvm-svn: 203241
2014-03-07 14:30:23 +00:00
Aaron Ballman
b105e49f28
[C++11] Replacing iterators ddiag_begin() and ddiag_end() with iterator_range ddiags(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203240
2014-03-07 14:09:15 +00:00
Aaron Ballman
63ab760ebe
[C++11] Updating getUsingDirectives to use iterator_range instead of a std::pair.
...
llvm-svn: 203239
2014-03-07 13:44:44 +00:00
Aaron Ballman
7dce1a840c
Fully reverting r203236 -- it seems the only bots that are happy are the MSVC bots.
...
llvm-svn: 203237
2014-03-07 13:13:38 +00:00
Aaron Ballman
690829696c
[C++11] Replacing iterators attr_begin() and attr_end() with iterator_range attrs(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203236
2014-03-07 12:50:00 +00:00
Argyrios Kyrtzidis
e1974dcd92
[Preprocessor] Pass TranslationUnitKind to the preprocessor and if it is TU_Prefix
...
avoid warning for unused macros.
rdar://15034698
llvm-svn: 203213
2014-03-07 07:47:58 +00:00
Ben Langmuir
198c168518
Add a bunch of missing changes from r203208
...
Somehow lost these in a git operation.
llvm-svn: 203210
2014-03-07 07:27:49 +00:00
Ben Langmuir
cb69b57b2a
Add dependencies from imported modules with -MD
...
Add module dependencies to the dependency files created by -MD/-MMD/etc.
by attaching an ASTReaderListener that will call into the dependency
file generator when a module input file is seen in the serialized AST.
llvm-svn: 203208
2014-03-07 06:40:32 +00:00
Aaron Ballman
211cd8ccb7
Partial revert of r203179. The build bots are telling me that some out-of-tree builds are using redecls_begin()/redecls_end(), so adding some machinery back in to support them.
...
llvm-svn: 203182
2014-03-07 00:10:58 +00:00
Aaron Ballman
86c9390673
[C++11] Replacing iterators redecls_begin() and redecls_end() with iterator_range redecls(). Updating all of the usages of the iterators with range-based for loops, which allows the begin/end forms to be removed entirely.
...
llvm-svn: 203179
2014-03-06 23:45:36 +00:00
Alexander Kornienko
a74979d66f
Added an inserter for ArrayRef<SourceRange>.
...
Summary:
Added an inserter for ArrayRef<SourceRange>, as it is already needed in at least
two places (static analyzer and clang-tidy).
Reviewers: jordan_rose
CC: cfe-commits, gribozavr
Differential Revision: http://llvm-reviews.chandlerc.com/D2984
llvm-svn: 203117
2014-03-06 13:23:30 +00:00
Alexey Bataev
568a833f68
[OPENMP] Clause 'num_threads'
...
llvm-svn: 203087
2014-03-06 06:15:19 +00:00
Alexey Bataev
186b28a8cf
[OPENMP] Added option -fopenmp=libiomp5|libgomp
...
llvm-svn: 203081
2014-03-06 05:43:53 +00:00
Richard Smith
faf156ad15
Tests for DR370-380.
...
Also promote a couple of Warnings on ill-formed code found by this testing to
ExtWarns.
llvm-svn: 203021
2014-03-05 22:54:58 +00:00
Aaron Ballman
6c8100748f
Capabilities are required to pass a name specifying what type of capability is being annotated. There are currently only two supported names: mutex and role. Adding functionality to check for the capability name and diagnose when it's unexpected.
...
Note that for backwards compatibility, an unnamed capability will default to being a "mutex." This allows the deprecated lockable attribute to continue to function.
llvm-svn: 203012
2014-03-05 21:47:13 +00:00
David Majnemer
f27217ffaf
AST: Remove layering violation with Sema
...
Scope lives in Sema and cannot be used in AST. Shuffle things around.
llvm-svn: 202993
2014-03-05 18:55:38 +00:00
Ben Langmuir
53145df884
Use ThreadSafeRefCountedBase for vfs::FileSystem
...
Allow trivial read-only filesystems such as RealFileSystem to be shared
between threads.
llvm-svn: 202986
2014-03-05 15:25:59 +00:00
Alexander Kornienko
cef10edcb2
Added a const qualifier to SourceManager& parameters.
...
llvm-svn: 202964
2014-03-05 10:38:27 +00:00
David Majnemer
2206bf5d5b
[-cxx-abi microsoft] Implement local manglings accurately
...
Summary:
The MSVC ABI appears to mangle the lexical scope into the names of
statics. Specifically, a counter is incremented whenever a scope is
entered where things can be declared in such a way that an ambiguity can
arise. For example, a class scope inside of a class scope doesn't do
anything interesting because the nested class cannot collide with
another nested class.
There are problems with this scheme:
- It is unreliable. The counter is only incremented when a previously
never encountered scope is entered. There are cases where this will
cause ambiguity amongst declarations that have the same name where one
was introduced in a deep scope while the other was introduced right
after in the previous lexical scope.
- It is wasteful. Statements like: {{{{{{{ static int foo = a; }}}}}}}
will make the mangling of "foo" larger than it need be because the
scope counter has been incremented many times.
Because of these problems, and practical implementation concerns. We
choose not to implement this scheme if the local static or local type
isn't visible. The mangling of these declarations will look very
similar but the numbering will make far more sense, this scheme is
lifted from the Itanium ABI implementation.
Reviewers: rsmith, doug.gregor, rnk, eli.friedman, cdavis5x
Reviewed By: rnk
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2953
llvm-svn: 202951
2014-03-05 08:57:59 +00:00
Alexey Bataev
2759a7c9c0
[OPENMP] allow clause 'private' on directive 'omp simd'
...
llvm-svn: 202944
2014-03-05 07:21:14 +00:00
David Majnemer
75991301d2
TokenKinds: _Atomic isn't a keyword in MS mode
...
Summary:
This is needed to allow MSVC's <atomic> header to properly parse.
It uses _Atomic as a class-id.
Reviewers: rnk
Reviewed By: rnk
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2948
llvm-svn: 202901
2014-03-04 22:07:09 +00:00
Benjamin Kramer
cfcdd23339
Revert "FileEntry: Remove unused and half-broken copy ctor."
...
Looks like libstdc++ 4.7 still needs it.
llvm-svn: 202896
2014-03-04 21:49:45 +00:00
Benjamin Kramer
5bc79bfc10
[C++11] Push move semantics through APValue.
...
llvm-svn: 202894
2014-03-04 21:47:57 +00:00
Benjamin Kramer
4bd1ffa3ee
FileEntry: Remove unused and half-broken copy ctor.
...
llvm-svn: 202893
2014-03-04 21:47:50 +00:00
Benjamin Kramer
9299637dc0
Pass llvm::Triple objects by const reference.
...
Copying isn't cheap as it contains a std::string.
llvm-svn: 202880
2014-03-04 19:31:42 +00:00
Benjamin Kramer
b99c6b5d94
[C++11] Make StoredDeclsList move-only.
...
It is only moved when a StoredDeclsMap grows.
llvm-svn: 202859
2014-03-04 16:42:46 +00:00
Chandler Carruth
757fcd6d1f
[cleanup] Re-sort includes with llvm/utils/sort_includes.py and fix
...
a missing include from CLog.h.
CLog.h referenced most of the core libclang types but never directly
included Index.h that provides them. Previously it got lucky and other
headers were always included first but with the sorting it ended up
first in one case and stopped compiling. Adding the Index.h include
fixes it right up.
llvm-svn: 202810
2014-03-04 10:05:20 +00:00
Hans Wennborg
04110bfb77
Include <tuple> to speculatively try to fix VS2013 build after r202755
...
llvm-svn: 202765
2014-03-03 22:25:31 +00:00
Richard Smith
446161b9ac
Improve diagnostics for malformed constructor declarations (where lookup for
...
the type of the first parameter fails, and it is the only, unnamed, parameter).
llvm-svn: 202759
2014-03-03 21:12:53 +00:00
Benjamin Kramer
5367356a64
[C++11] Add missing include.
...
llvm-svn: 202757
2014-03-03 20:39:28 +00:00
Benjamin Kramer
a741b8c451
[C++11] Simplify compare operators with std::tie.
...
No functionality change.
llvm-svn: 202755
2014-03-03 20:26:46 +00:00
Aaron Ballman
f08a5c7608
I guess we're still using LLVM_DELETED_FUNCTION instead of = delete. This should fix a complaining built bot.
...
llvm-svn: 202734
2014-03-03 18:41:48 +00:00
Jordan Rose
7ef1c387a0
Serialized diagnostic severity levels should be stable.
...
Serialized diagnostics were accidentally using the AST diagnostic level values
rather than a dedicated stable enum, so the addition of "remark" broke the
reading of existing serialized diagnostics files. I've added a .dia file
generated from Xcode 5's Clang to make sure we don't break this in the future.
llvm-svn: 202733
2014-03-03 18:29:52 +00:00
Aaron Ballman
3efb895bb1
Removing some unused functionality.
...
llvm-svn: 202727
2014-03-03 16:21:37 +00:00
Argyrios Kyrtzidis
1594c15500
Introduce '-fmodules-user-build-path' which accepts the "canonical" path to a user workspace build.
...
This is used to avoid conflicts with user modules with the same name from different workspaces.
rdar://16042513
llvm-svn: 202683
2014-03-03 08:12:05 +00:00
Argyrios Kyrtzidis
d502a10c5e
[libclang] Introduce APIs that assist in constructing a simple module.map file for a user framework.
...
rdar://16092858
llvm-svn: 202681
2014-03-03 07:41:45 +00:00
Ahmed Charles
bf8e283f15
[C++11] Add #include's for OwningPtr.
...
Allows removing #include's in LLVM while switching to std::unique_ptr.
llvm-svn: 202677
2014-03-03 07:11:21 +00:00