]> granicus.if.org Git - clang/log
clang
7 years ago[NFC] Refactor the Preprocessor function that handles Macro definitions and rename...
Faisal Vali [Mon, 17 Jul 2017 17:18:43 +0000 (17:18 +0000)]
[NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions.
  - Extracted the reading of the tokens out into a separate function.
  - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation).

This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible.

I will also directly update some extra clang tooling that is broken by the change from Argument to Parameter.

Hopefully the bots will stay appeased.

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308190 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix dereference of pointers in throw statements.
Manuel Klimek [Mon, 17 Jul 2017 15:27:53 +0000 (15:27 +0000)]
Fix dereference of pointers in throw statements.

Before:
  throw * x;

After:
  throw *x;

Patch by Erik Uhlmann.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308185 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix reduction combiner test
Alexey Bataev [Mon, 17 Jul 2017 14:53:02 +0000 (14:53 +0000)]
[OPENMP] Fix reduction combiner test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308183 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Further fixes of the reduction codegen tests
Alexey Bataev [Mon, 17 Jul 2017 14:47:59 +0000 (14:47 +0000)]
[OPENMP] Further fixes of the reduction codegen tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308182 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Further test fixes.
Alexey Bataev [Mon, 17 Jul 2017 14:22:34 +0000 (14:22 +0000)]
[OPENMP] Further test fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308178 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Rework tests to pacify buildbots.
Alexey Bataev [Mon, 17 Jul 2017 14:06:41 +0000 (14:06 +0000)]
[OPENMP] Rework tests to pacify buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308176 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Codegen for reduction clauses in 'taskloop' directives.
Alexey Bataev [Mon, 17 Jul 2017 13:30:36 +0000 (13:30 +0000)]
[OPENMP] Codegen for reduction clauses in 'taskloop' directives.

Adds codegen for taskloop-based directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308174 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert changes from my previous refactoring - will need to fix dependencies in clang...
Faisal Vali [Mon, 17 Jul 2017 02:03:21 +0000 (02:03 +0000)]
Revert changes from my previous refactoring - will need to fix dependencies in clang's extra tooling (such as clang-tidy etc.).

Sorry about that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308158 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NFC] Refactor the Preprocessor function that handles Macro definitions and rename...
Faisal Vali [Mon, 17 Jul 2017 01:27:53 +0000 (01:27 +0000)]
[NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions.
  - Extracted the reading of the tokens out into a separate function.
  - Replace 'Argument' with 'Parameter' when referring to the identifiers of the macro definition (as opposed to the supplied arguments - MacroArgs - during the macro invocation).

This is in preparation for submitting patches for review to implement __VA_OPT__ which will otherwise just keep lengthening the HandleDefineDirective function and making it less comprehensible.

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308157 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnable TLS support on OpenBSD.
Brad Smith [Mon, 17 Jul 2017 01:06:46 +0000 (01:06 +0000)]
Enable TLS support on OpenBSD.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308156 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnable TLS support on OpenBSD, but default to the emulatated TLS model.
Brad Smith [Mon, 17 Jul 2017 00:49:31 +0000 (00:49 +0000)]
Enable TLS support on OpenBSD, but default to the emulatated TLS model.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308155 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Bash-autocompletion] Add support for -W<warning> and -Wno<warning>
Yuka Takahashi [Sun, 16 Jul 2017 15:07:20 +0000 (15:07 +0000)]
[Bash-autocompletion] Add support for -W<warning> and -Wno<warning>

Summary:
`-W[tab]` will autocomplete warnings defined in this link:
https://clang.llvm.org/docs/DiagnosticsReference.html#wweak-vtables

Differential Revision: https://reviews.llvm.org/D35447

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308139 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[c++2a] Add option -std=c++2a to enable support for potential/transitional C++2a...
Faisal Vali [Sun, 16 Jul 2017 00:23:04 +0000 (00:23 +0000)]
[c++2a] Add option -std=c++2a to enable support for potential/transitional C++2a features

- as usual C++2a implies all the C++'s that came before it.

Thank you Aaron for the feedback here: https://reviews.llvm.org/D35454

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308118 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cxx_status] Fix typos.
Richard Smith [Sat, 15 Jul 2017 15:51:59 +0000 (15:51 +0000)]
[cxx_status] Fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308101 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cxx_status] Add approved Toronto WG21 motions.
Richard Smith [Sat, 15 Jul 2017 15:42:36 +0000 (15:42 +0000)]
[cxx_status] Add approved Toronto WG21 motions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308099 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse ARC parsing rules for ns_returns_retained in MRC so that code can
John McCall [Sat, 15 Jul 2017 11:06:46 +0000 (11:06 +0000)]
Use ARC parsing rules for ns_returns_retained in MRC so that code can
be shared without warnings.  Build AttributedTypes to leave breadcrumbs
for tools like the static analyzer.  Warn about attempting to use the
attribute with incompatible return types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308092 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Bash-autocompletion] Fixed a bug on bash
Yuka Takahashi [Sat, 15 Jul 2017 09:09:51 +0000 (09:09 +0000)]
[Bash-autocompletion] Fixed a bug on bash

Summary: Maybe I mismerged when merging previous commits by hand.

Differential Revision: https://reviews.llvm.org/D35448

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308091 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang/test/FixIt/format.m: Tweak for i686, where ssize_t is int. (r308067)
NAKAMURA Takumi [Sat, 15 Jul 2017 06:14:47 +0000 (06:14 +0000)]
clang/test/FixIt/format.m: Tweak for i686, where ssize_t is int. (r308067)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308084 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ODRHash] Revert r307743 which reverted r307720
Richard Trieu [Sat, 15 Jul 2017 02:55:13 +0000 (02:55 +0000)]
[ODRHash] Revert r307743 which reverted r307720

Reapply r307720 to allow processing of constructors and destructors.  Reuse
the diagnostics for CXXMethodDecl for them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308077 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang] Fix format test
Alexander Shaposhnikov [Sat, 15 Jul 2017 01:06:59 +0000 (01:06 +0000)]
[clang] Fix format test

This diff makes the test FixIt/format.m more robust.
The issue was caught by the build bot clang-cmake-thumbv7-a15.

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308073 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTry to fix modules build
Matthias Braun [Sat, 15 Jul 2017 00:29:25 +0000 (00:29 +0000)]
Try to fix modules build

Module builds somehow report an ambiguity between clang::Diagnostic and
clang::Tooling::Diagnostic. It seems as if one of the additional headers
brought in by the module brings the clang namespace to the toplevel. I
could not find out the reason for that, so for now I go with the simple
fix to bring the build back to green.

rdar://33321397

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308071 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang] Fix handling of "%zd" format specifier
Alexander Shaposhnikov [Fri, 14 Jul 2017 22:57:00 +0000 (22:57 +0000)]
[clang] Fix handling of "%zd" format specifier

This diff addresses FIXME in lib/Analysis/PrintfFormatString.cpp
and makes PrintfSpecifier::getArgType return the correct type.
In particular, this change enables Clang to emit a warning on
incorrect using of "%zd"/"%zn" format specifiers.

Differential revision: https://reviews.llvm.org/D35427

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308067 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix flag names in @available docs.
Nico Weber [Fri, 14 Jul 2017 18:52:30 +0000 (18:52 +0000)]
Fix flag names in @available docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308048 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix link in docs.
Nico Weber [Fri, 14 Jul 2017 18:45:36 +0000 (18:45 +0000)]
Fix link in docs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308046 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodo more processing in clang-fuzzer (use EmitAssemblyAction)
Kostya Serebryany [Fri, 14 Jul 2017 18:42:07 +0000 (18:42 +0000)]
do more processing in clang-fuzzer (use EmitAssemblyAction)

Summary: use EmitAssemblyAction in clang-fuzzer

Reviewers: klimek, rsmith

Reviewed By: klimek

Subscribers: cfe-commits, mgorny

Differential Revision: https://reviews.llvm.org/D34267

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308045 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd documentation for @available
Nico Weber [Fri, 14 Jul 2017 18:40:52 +0000 (18:40 +0000)]
Add documentation for @available

https://reviews.llvm.org/D35379

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308044 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoPrevent ClangTools from generating dependency files.
Sterling Augustine [Fri, 14 Jul 2017 18:33:30 +0000 (18:33 +0000)]
Prevent ClangTools from generating dependency files.

D34304 created a way for ToolInvocations to conditionally generate
dependency files, and updated call sites to preserve the old behavior
of not generating them by default. CompilerInvocations...

Summary:
...are yet another
call-path that needs updating to preserve the old behavior.

Reviewers: klimek, echristo

Reviewed By: echristo

Subscribers: echristo, cfe-commits

Differential Revision: https://reviews.llvm.org/D35131

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308043 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Dominators] Update Clang's DominatorTree to use the new template argument
Jakub Kuderski [Fri, 14 Jul 2017 18:26:21 +0000 (18:26 +0000)]
[Dominators] Update Clang's DominatorTree to use the new template argument

Summary: This patch makes the Clang's DominatorTree use the new IsPostDom template argument for DominatorTreeBase.

Reviewers: dberlin, sanjoy, davide, grosser

Reviewed By: dberlin

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D35316

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308041 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUnconditionally use .init_array instead of .ctors on Solaris.
Aaron Ballman [Fri, 14 Jul 2017 17:49:52 +0000 (17:49 +0000)]
Unconditionally use .init_array instead of .ctors on Solaris.

Patch by Fedor Sergeev

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308038 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang] Add getSignedSizeType method
Alexander Shaposhnikov [Fri, 14 Jul 2017 17:30:14 +0000 (17:30 +0000)]
[clang] Add getSignedSizeType method

C11 standard refers to the signed counterpart of the type size_t in
the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers
(in printf format string).
In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case
(which is not handled correctly at the moment).
This diff adds getSignedSizeType method to TargetInfo and exposes it
in ASTContext similarly to how it is done for getSizeType.
lib/Analysis/PrintfFormatString.cpp will be changed in a separate commit.

Differential revision: https://reviews.llvm.org/D35378

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308037 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Add intrinsics for data cache operations
Krzysztof Parzyszek [Fri, 14 Jul 2017 16:01:24 +0000 (16:01 +0000)]
[Hexagon] Add intrinsics for data cache operations

This is the clang part, adding support for
  void __builtin_HEXAGON_Y2_dccleana(void*);
  void __builtin_HEXAGON_Y2_dccleaninva(void*);
  void __builtin_HEXAGON_Y2_dcinva(void*);
  void __builtin_HEXAGON_Y2_dczeroa(void*);
  void __builtin_HEXAGON_Y4_l2fetch(void*, unsigned);
  void __builtin_HEXAGON_Y5_l2fetch(void*, unsigned long long);
Requires r308032.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308035 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[index] Added a method indexTopLevelDecls to run indexing on a list of Decls.
Ilya Biryukov [Fri, 14 Jul 2017 10:47:45 +0000 (10:47 +0000)]
[index] Added a method indexTopLevelDecls to run indexing on a list of Decls.

Summary:
We need it in clangd for refactoring that replaces ASTUnit
with manual AST management.

Reviewers: akyrtzi, benlangmuir, arphaman, klimek

Reviewed By: arphaman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D35405

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308016 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output
Alexander Kornienko [Fri, 14 Jul 2017 10:37:44 +0000 (10:37 +0000)]
[Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output

Summary:
To get properly integration Clang-Tidy with CLion IDE, next things were implemented:
1) Preserve `Message`, `FileOffset`, `FilePath` in the clang-tidy output.
2) Export all diagnostics, not just the ones with fixes
3) Test-cases

Reviewers: klimek, ilya-biryukov, alexfh

Reviewed By: alexfh

Subscribers: alexfh, JDevlieghere, mgorny, xazax.hun, cfe-commits, klimek

Tags: #clang-tools-extra

Patch by Vladimir Plyashkun!

Differential Revision: https://reviews.llvm.org/D34404

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308014 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Add annotation for functions taking user-facing strings
Erik Verbruggen [Fri, 14 Jul 2017 10:24:36 +0000 (10:24 +0000)]
[analyzer] Add annotation for functions taking user-facing strings

There was already a returns_localized_nsstring annotation to indicate
that the return value could be passed to UIKit methods that would
display them. However, those UIKit methods were hard-coded, and it was
not possible to indicate that other classes/methods in a code-base would
do the same.

The takes_localized_nsstring annotation can be put on function
parameters and selector parameters to indicate that those will also show
the string to the user.

Differential Revision: https://reviews.llvm.org/D35186

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308012 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoKeep the IdentifierInfo in the Token for alternative operator keyword
Olivier Goffart [Fri, 14 Jul 2017 09:23:40 +0000 (09:23 +0000)]
Keep the IdentifierInfo in the Token for alternative operator keyword

The goal of this commit is to fix clang-format so it does not merge tokens when
using the alternative spelling keywords. (eg: "not foo" should not become "notfoo")

The problem is that Preprocessor::HandleIdentifier used to drop the identifier info
from the token for these keyword. This means the first condition of
TokenAnnotator::spaceRequiredBefore is not met. We could add explicit check for
the spelling in that condition, but I think it is better to keep the IdentifierInfo
and handle the operator keyword explicitly when needed. That actually leads to simpler
code, and probably slightly more efficient as well.

Another side effect of this change is that __identifier(and) will now work as
one would expect, removing a FIXME from the MicrosoftExtensions.cpp test

Differential Revision: https://reviews.llvm.org/D35172

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308008 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add 'movbe' to btver2 CPU.
Craig Topper [Fri, 14 Jul 2017 06:36:17 +0000 (06:36 +0000)]
[X86] Add 'movbe' to btver2 CPU.

This probably doesn't change anything because the frotend doesn't do anything with this feature and the backend will infer from the cpu string. So this is just for consistency with other cpus that support movbe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308002 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd release notes for the overloadable attribute
George Burgess IV [Fri, 14 Jul 2017 03:23:57 +0000 (03:23 +0000)]
Add release notes for the overloadable attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307995 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and silence...
Eric Christopher [Fri, 14 Jul 2017 02:03:03 +0000 (02:03 +0000)]
Use EXPECT_TRUE rather than EXPECT_EQ(true, ...) to clean up the code and silence a null conversion warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307989 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoChange dyn_casts with unused variables to isa statements to avoid unused variables.
Eric Christopher [Fri, 14 Jul 2017 01:42:57 +0000 (01:42 +0000)]
Change dyn_casts with unused variables to isa statements to avoid unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307988 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ODRHash] Avoid taking the types of FunctionDecl's
Richard Trieu [Fri, 14 Jul 2017 01:36:41 +0000 (01:36 +0000)]
[ODRHash] Avoid taking the types of FunctionDecl's

FunctionDecl already hashes most of the information in the function's type.
Add hashing of the return type, and skip hashing the function's type to avoid
redundancy and extra work when computing the hash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307986 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Respect -target when determining target platform on Apple
Akira Hatanaka [Fri, 14 Jul 2017 00:21:32 +0000 (00:21 +0000)]
[Driver] Respect -target when determining target platform on Apple
platforms.

Set the target OS based on -target if it is present on the command
line and -arch is not.

With this commit, "-target x86_64-apple-ios8.0" does the same thing as
"-arch x86_64 -mios-version-min=8.0".

rdar://problem/21012522

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307982 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PS4] Disable LTO unit features under ThinLTO, like for Darwin.
Paul Robinson [Thu, 13 Jul 2017 21:25:47 +0000 (21:25 +0000)]
[PS4] Disable LTO unit features under ThinLTO, like for Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307964 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse getNameAsString instead of getName to get method names when dumping
Lang Hames [Thu, 13 Jul 2017 21:08:29 +0000 (21:08 +0000)]
Use getNameAsString instead of getName to get method names when dumping
overrides:  getName can fail if the decl's name isn't a simple identifier.

This is a more general replacement for the fix in r305860.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307959 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)
Vedant Kumar [Thu, 13 Jul 2017 20:55:26 +0000 (20:55 +0000)]
[ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (PR33430)

The pointer overflow check gives false negatives when dealing with
expressions in which an unsigned value is subtracted from a pointer.
This is summarized in PR33430 [1]: ubsan permits the result of the
subtraction to be greater than "p", but it should not.

To fix the issue, we should track whether or not the pointer expression
is a subtraction. If it is, and the indices are unsigned, we know to
expect "p - <unsigned> <= p".

I've tested this by running check-{llvm,clang} with a stage2
ubsan-enabled build. I've also added some tests to compiler-rt, which
are in D34122.

[1] https://bugs.llvm.org/show_bug.cgi?id=33430

Differential Revision: https://reviews.llvm.org/D34121

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307955 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Produce the right kind of va_arg for windows
Martin Storsjo [Thu, 13 Jul 2017 17:59:14 +0000 (17:59 +0000)]
[AArch64] Produce the right kind of va_arg for windows

On windows on arm64, the va_list is a plain pointer.

Differential Revision: https://reviews.llvm.org/D35008

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307933 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix spelling mistakes in comments. NFCI.
Simon Pilgrim [Thu, 13 Jul 2017 17:34:44 +0000 (17:34 +0000)]
Fix spelling mistakes in comments. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307932 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix -Wdocumentation warning. NFCI
Simon Pilgrim [Thu, 13 Jul 2017 17:29:48 +0000 (17:29 +0000)]
Fix -Wdocumentation warning. NFCI

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307931 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoExtend -Wdeprecated-implementations to warn about unavailable methods
Alex Lorenz [Thu, 13 Jul 2017 16:37:11 +0000 (16:37 +0000)]
Extend -Wdeprecated-implementations to warn about unavailable methods

rdar://22867595

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307924 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNFC, Cleanup the code for -Wdeprecated-implementations
Alex Lorenz [Thu, 13 Jul 2017 16:35:59 +0000 (16:35 +0000)]
NFC, Cleanup the code for -Wdeprecated-implementations
and void capitalization of the warning message

rdar://22867595

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307923 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] Add support for handling the +sve target feature.
Amara Emerson [Thu, 13 Jul 2017 15:36:01 +0000 (15:36 +0000)]
[AArch64] Add support for handling the +sve target feature.

This also adds the appropriate predefine for SVE if enabled.

Differential Revision: https://reviews.llvm.org/D35118

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307919 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix reduction tests, NFC.
Alexey Bataev [Thu, 13 Jul 2017 15:15:25 +0000 (15:15 +0000)]
[OPENMP] Fix reduction tests, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307916 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix reduction tests, NFC.
Alexey Bataev [Thu, 13 Jul 2017 15:09:05 +0000 (15:09 +0000)]
[OPENMP] Fix reduction tests, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307915 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Further reduction test fix, NFC.
Alexey Bataev [Thu, 13 Jul 2017 15:02:27 +0000 (15:02 +0000)]
[OPENMP] Further reduction test fix, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307914 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix reduction tests, NFC.
Alexey Bataev [Thu, 13 Jul 2017 14:54:42 +0000 (14:54 +0000)]
[OPENMP] Fix reduction tests, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307912 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Fix reduction tests, NFC.
Alexey Bataev [Thu, 13 Jul 2017 14:29:19 +0000 (14:29 +0000)]
[OPENMP] Fix reduction tests, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307911 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Generalization of codegen for reduction clauses.
Alexey Bataev [Thu, 13 Jul 2017 13:36:14 +0000 (13:36 +0000)]
[OPENMP] Generalization of codegen for reduction clauses.

Reworked codegen for reduction clauses for future support of reductions
in task-based directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307910 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove another 'using namespace llvm' from the
Alex Lorenz [Thu, 13 Jul 2017 12:49:22 +0000 (12:49 +0000)]
Remove another 'using namespace llvm' from the
RecursiveSymbolVisitor.h header

This should fix the modules build
(http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307908 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove 'using namespace llvm' from the USRFinder.h header
Alex Lorenz [Thu, 13 Jul 2017 11:27:12 +0000 (11:27 +0000)]
Remove 'using namespace llvm' from the USRFinder.h header

This should fix the modules build
(http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307905 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjC] Pick a 'readwrite' property when synthesizing ambiguous
Alex Lorenz [Thu, 13 Jul 2017 11:06:22 +0000 (11:06 +0000)]
[ObjC] Pick a 'readwrite' property when synthesizing ambiguous
property and check for incompatible attributes

This commit changes the way ambiguous property synthesis (i.e. when synthesizing
a property that's declared in multiple protocols) is performed. Previously,
Clang synthesized the first property that was found. This lead to problems when
the property was synthesized in a class that conformed to two protocols that
declared that property and a second protocols had a 'readwrite' declaration -
the setter was not synthesized so the class didn't really conform to the second
protocol and user's code would crash at runtime when they would try to set the
property.

This commit ensures that a first readwrite property is selected. This is a
semantic change that changes users code in this manner:

```
@protocol P @property(readonly) int p; @end
@protocol P2 @property(readwrite) id p; @end
@interface I <P2> @end
@implementation I
@syntesize p; // Users previously got a warning here, and Clang synthesized
              // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p..
@end
```

To ensure that this change is safe, the warning about incompatible types is
promoted to an error when this kind of readonly/readwrite ambiguity is detected
in the @implementation. This will ensure that previous code that had this subtle
bug and ignored the warning now will fail to compile with an error, and users
should not get suprises at runtime once they resolve the error.

The commit also extends the ambiguity checker, and now it can detect conflicts
among the different property attributes. An error diagnostic is used for
conflicting attributes, to ensure that the user won't get "suprises" at runtime.

ProtocolPropertyMap is removed in favour of a a set + vector because the map's
order of iteration is non-deterministic, so it couldn't be used to select the
readwrite property.

rdar://31579994

Differential Revision: https://reviews.llvm.org/D35268

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307903 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[index] Objective-C method declarations and message sends with
Alex Lorenz [Thu, 13 Jul 2017 10:50:21 +0000 (10:50 +0000)]
[index] Objective-C method declarations and message sends with
an empty first selector piece should store the location of the first ':'

rdar://33188656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307901 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[refactor][rename] Use a single base class for class that finds
Alex Lorenz [Thu, 13 Jul 2017 10:36:33 +0000 (10:36 +0000)]
[refactor][rename] Use a single base class for class that finds
a declaration at location and for class that searches for all occurrences of
a specific declaration

This commit uses a single RecursiveSymbolVisitor class for both
USRLocFindingASTVisitor and NamedDeclOccurrenceFindingVisitor to avoid duplicate
traversal code. It also traverses nested name specifier locs in the new class
and remove the separate matching step.

Differential Revision: https://reviews.llvm.org/D34949

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307898 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofix typos in comments; NFC
Hiroshi Inoue [Thu, 13 Jul 2017 06:51:20 +0000 (06:51 +0000)]
fix typos in comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307886 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Sema] Mark a virtual CXXMethodDecl as used if a call to it can be
Akira Hatanaka [Thu, 13 Jul 2017 06:08:27 +0000 (06:08 +0000)]
[Sema] Mark a virtual CXXMethodDecl as used if a call to it can be
devirtualized.

The code to detect devirtualized calls is already in IRGen, so move the
code to lib/AST and make it a shared utility between Sema and IRGen.

This commit fixes a linkage error I was seeing when compiling the
following code:

$ cat test1.cpp
struct Base {
  virtual void operator()() {}
};

template<class T>
struct Derived final : Base {
  void operator()() override {}
};

Derived<int> *d;

int main() {
  if (d)
    (*d)();
  return 0;
}

rdar://problem/33195657

Differential Revision: https://reviews.llvm.org/D34301

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307883 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReland "[Driver] Update Fuchsia driver path handling"
Petr Hosek [Wed, 12 Jul 2017 22:14:41 +0000 (22:14 +0000)]
Reland "[Driver] Update Fuchsia driver path handling"

Several improvements to the Fuchsia driver:

* Search for C++ library headers and libraries in directories that
are part of the toolchain distribution rather than sysroot.

* Use LLVM support utlities to construct paths to make sure the driver
is also usable on Windows for cross-compiling.

* Change the driver to inherit directly from ToolChain rather than
Generic_GCC since we don't need any of the GCC related multilib logic.

Differential Revision: https://reviews.llvm.org/D35328

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307856 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[index] Don't add relation to a NamedDecl with no name
Ben Langmuir [Wed, 12 Jul 2017 22:05:30 +0000 (22:05 +0000)]
[index] Don't add relation to a NamedDecl with no name

Unless it's one of the special cases (tag, category) that we can handle.
This syncs up the check between handling a decl and handling a relation.

This would cause invalid nameless decls to end up in relations despite
having no name or USR.

rdar://problem/32474406

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307855 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[analyzer] Support generating and reasoning over more symbolic constraint...
Dominic Chen [Wed, 12 Jul 2017 21:43:42 +0000 (21:43 +0000)]
Revert "[analyzer] Support generating and reasoning over more symbolic constraint types"

Assertion `Loc::isLocType(SSE->getLHS()->getType())' failed in Analysis/PR3991.m

This reverts commit e469ff2759275e67f9072b3d67fac90f647c0fe6.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307853 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips][mt][7/7] Add driver option for the MIPS MT ASE.
Simon Dardis [Wed, 12 Jul 2017 21:13:05 +0000 (21:13 +0000)]
[mips][mt][7/7] Add driver option for the MIPS MT ASE.

Reviewers: atanasyan, slthakur

Differential Revision: https://reviews.llvm.org/D35254

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307847 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[Driver] Update Fuchsia driver path handling"
Petr Hosek [Wed, 12 Jul 2017 21:03:54 +0000 (21:03 +0000)]
Revert "[Driver] Update Fuchsia driver path handling"

The tests are failing on Windows.

This reverts commit 429fe8229496f639df6b0b4734beedb1d4317aa5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307845 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DOXYGEN] Corrected typos and incorrect parameters description.
Ekaterina Romanova [Wed, 12 Jul 2017 20:18:55 +0000 (20:18 +0000)]
[DOXYGEN] Corrected typos and incorrect parameters description.

Corrected several typos and incorrect parameters description that Sony
's techinical writer found during review.

I got an OK from Eric Christopher to commit doxygen comments without prior code
review upstream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307838 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Support generating and reasoning over more symbolic constraint types
Dominic Chen [Wed, 12 Jul 2017 19:37:57 +0000 (19:37 +0000)]
[analyzer] Support generating and reasoning over more symbolic constraint types

Summary: Generate more IntSymExpr constraints, perform SVal simplification for IntSymExpr and SymbolCast constraints, and create fully symbolic SymExprs

Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun

Subscribers: mgorny, cfe-commits

Differential Revision: https://reviews.llvm.org/D28953

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307833 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Driver] Update Fuchsia driver path handling
Petr Hosek [Wed, 12 Jul 2017 19:15:51 +0000 (19:15 +0000)]
[Driver] Update Fuchsia driver path handling

Several improvements to the Fuchsia driver:

* Search for C++ library headers and libraries in directories that
are part of the toolchain distribution rather than sysroot.

* Use LLVM support utlities to construct paths to make sure the driver
is also usable on Windows for cross-compiling.

* Change the driver to inherit directly from ToolChain rather than
Generic_GCC since we don't need any of the GCC related multilib logic.

Differential Revision: https://reviews.llvm.org/D32613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307830 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Emit implicit taskgroup block around taskloop directives.
Alexey Bataev [Wed, 12 Jul 2017 18:09:32 +0000 (18:09 +0000)]
[OPENMP] Emit implicit taskgroup block around taskloop directives.

If taskloop directive has no associated nogroup clause, it must emitted
inside implicit taskgroup block. Runtime supports it, but we need to
generate implicit taskgroup block explicitly to support future
reductions codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307822 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[diagtool] Add a 'find-diagnostic-id' subcommand that converts a name of
Alex Lorenz [Wed, 12 Jul 2017 16:41:49 +0000 (16:41 +0000)]
[diagtool] Add a 'find-diagnostic-id' subcommand that converts a name of
the diagnostic to its enum value

This will be used by a script that invokes clang in a debugger and forces it
to stop when it reports a particular diagnostic.

Differential Revision: https://reviews.llvm.org/D35306

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307813 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang] buildFixItInsertionLine should use Hints of the same FID and LineNo
Chih-Hung Hsieh [Wed, 12 Jul 2017 16:25:40 +0000 (16:25 +0000)]
[clang] buildFixItInsertionLine should use Hints of the same FID and LineNo

Fix bug https://bugs.llvm.org/show_bug.cgi?id=33734

Differential Revision: https://reviews.llvm.org/D35230

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307809 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang-format] Keep level of comment before an empty line
Krasimir Georgiev [Wed, 12 Jul 2017 15:21:43 +0000 (15:21 +0000)]
[clang-format] Keep level of comment before an empty line

Summary:
This patch fixes bug https://bugs.llvm.org/show_bug.cgi?id=3313: a comment line
was aligned with the next #ifdef even in the presence of an empty line between
them.

Reviewers: djasper, klimek

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D35296

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307795 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libclang] Support for querying whether an enum is scoped
Alex Lorenz [Wed, 12 Jul 2017 11:35:11 +0000 (11:35 +0000)]
[libclang] Support for querying whether an enum is scoped

This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).

Patch by Johann Klähn!

Differential Revision: https://reviews.llvm.org/D35187

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307771 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r307769 (Forgot to mention the name of the contributor).
Alex Lorenz [Wed, 12 Jul 2017 11:34:14 +0000 (11:34 +0000)]
Revert r307769 (Forgot to mention the name of the contributor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307770 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libclang] Support for querying whether an enum is scoped
Alex Lorenz [Wed, 12 Jul 2017 11:31:37 +0000 (11:31 +0000)]
[libclang] Support for querying whether an enum is scoped

This commit allows checking whether an enum declaration is scoped
through libclang and clang.cindex (Python).

Differential Revision: https://reviews.llvm.org/D35187

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307769 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoExpose some type-conversion functions as part of the IRGen ABI.
John McCall [Wed, 12 Jul 2017 07:44:17 +0000 (07:44 +0000)]
Expose some type-conversion functions as part of the IRGen ABI.

Patch by Benoit Vey!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307760 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCFG: Add CFGElement for automatic variables that leave the scope
Matthias Gehre [Wed, 12 Jul 2017 07:04:19 +0000 (07:04 +0000)]
CFG: Add CFGElement for automatic variables that leave the scope

Summary:
This mimics the implementation for the implicit destructors. The
generation of this scope leaving elements is hidden behind
a flag to the CFGBuilder, thus it should not affect existing code.

Currently, I'm missing a test (it's implicitly tested by the clang-tidy
lifetime checker that I'm proposing).
I though about a test using debug.DumpCFG, but then I would
have to add an option to StaticAnalyzer/Core/AnalyzerOptions
to enable the scope leaving CFGElement,
which would only be useful to that particular test.

Any other ideas how I could make a test for this feature?

Reviewers: krememek, jordan_rose

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D15031

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307759 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ODRHash] Revert r307720 to fix buildbot.
Richard Trieu [Wed, 12 Jul 2017 00:38:27 +0000 (00:38 +0000)]
[ODRHash] Revert r307720 to fix buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307743 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnhance synchscope representation (clang)
Konstantin Zhuravlyov [Tue, 11 Jul 2017 22:23:37 +0000 (22:23 +0000)]
Enhance synchscope representation (clang)

Relevant changes required for r307722.

Differential Revision: https://reviews.llvm.org/D33109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307723 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ODRHash] Support more method types.
Richard Trieu [Tue, 11 Jul 2017 22:10:49 +0000 (22:10 +0000)]
[ODRHash] Support more method types.

Hash CXXConstructorDecl and CXXDestructorDecl.  Extend the diagnostics from
CXXMethodDecl to include constructors and destructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307720 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda
Alexey Bataev [Tue, 11 Jul 2017 19:43:28 +0000 (19:43 +0000)]
[OPENMP] Skip BuildMemberExpr() in BuildFieldReferenceExpr(), NFC, by Kai Noda

In the OpenMP mode, we don't need to call BuildMemberExpr() only to discard its
return value. BuildDeclRefExpr() is called instead.

Differential revision: https://reviews.llvm.org/D35201

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307697 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OPENMP] Add restriction for reduction clause in taskloop directives.
Alexey Bataev [Tue, 11 Jul 2017 19:16:44 +0000 (19:16 +0000)]
[OPENMP] Add restriction for reduction clause in taskloop directives.

Added checks for the reduction clauses in the taskloop directives:
1. Only addressable items must be used in reduction clauses.
2. Reduction clauses cannot be used with nogroup clauses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307693 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd missing dllimport member pointer template argument test from r307446
Reid Kleckner [Tue, 11 Jul 2017 16:18:05 +0000 (16:18 +0000)]
Add missing dllimport member pointer template argument test from r307446

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307670 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNetBSD uses soft-float by default, unless the environment is EABIHF or
Joerg Sonnenberger [Tue, 11 Jul 2017 15:50:48 +0000 (15:50 +0000)]
NetBSD uses soft-float by default, unless the environment is EABIHF or
GNUEABIHF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307665 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRun the preprocessor test as frontend test for NetBSD, since CC1 mode
Joerg Sonnenberger [Tue, 11 Jul 2017 15:49:45 +0000 (15:49 +0000)]
Run the preprocessor test as frontend test for NetBSD, since CC1 mode
doesn't get flags like the default target CPU. Update for test to
reflect the difference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307664 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ASTMatchers][NFC] integerLiteral(): Mention negative integers in
Clement Courbet [Tue, 11 Jul 2017 15:45:22 +0000 (15:45 +0000)]
[ASTMatchers][NFC] integerLiteral(): Mention negative integers in
documentation.

Trying to match integerLiteral(-1) will silently fail, because an numeric
literal is always positive.
- Update the documentation to explain how to match negative numeric
  literals.
- Add a unit test.

Differential Revision: https://reviews.llvm.org/D35196

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307663 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ObjC] Check that a subscript methods is declared for a qualified id type
Alex Lorenz [Tue, 11 Jul 2017 10:18:35 +0000 (10:18 +0000)]
[ObjC] Check that a subscript methods is declared for a qualified id type

Objective-C subscript expressions report errors when a subscript method is not
declared in the base class. However, prior to this commit, qualified id types
were not checked. This commit ensures that an appropriate error is reported
when a subscript method is not declared in any of the protocols that are
included in the qualified id type.

rdar://33213924

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307642 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRecursiveASTVisitor should visit the nested name qualifiers in
Alex Lorenz [Tue, 11 Jul 2017 09:39:23 +0000 (09:39 +0000)]
RecursiveASTVisitor should visit the nested name qualifiers in
a template specialisation

rdar://33123354

Differential Revision: https://reviews.llvm.org/D34981

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307638 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Create the correct profiling symbol on Linux MIPS
Simon Atanasyan [Tue, 11 Jul 2017 06:19:01 +0000 (06:19 +0000)]
[mips] Create the correct profiling symbol on Linux MIPS

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307627 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[analyzer] Start fixing modeling of bool based types
Alexander Shaposhnikov [Tue, 11 Jul 2017 00:30:14 +0000 (00:30 +0000)]
[analyzer] Start fixing modeling of bool based types

This is a follow up for one of
the previous diffs https://reviews.llvm.org/D32328.
getTypeSize and with getIntWidth are not equivalent for bool
(see https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l08444),
this causes a number of issues
(for instance, if APint X representing a bool is created
with the wrong bit width then X is not comparable against Min/Max
(because of the different bit width), that results in crashes
(triggered asserts) inside assume* methods),
for examples see the newly added test cases.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D35041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307604 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang-import-test] Test that enumerators and their values are found.
Sean Callanan [Tue, 11 Jul 2017 00:29:37 +0000 (00:29 +0000)]
[clang-import-test] Test that enumerators and their values are found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307603 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[clang-import-test] Committed missed update to clang-import-test.cpp
Sean Callanan [Tue, 11 Jul 2017 00:27:57 +0000 (00:27 +0000)]
[clang-import-test] Committed missed update to clang-import-test.cpp

I didn't commit clang-import-test.cpp in r307600, but it had some
changes that were part of https://reviews.llvm.org/D35220

Corrected that now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307602 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoclang-import-test had some dead code. I did the following to eliminate it:
Sean Callanan [Mon, 10 Jul 2017 23:47:00 +0000 (23:47 +0000)]
clang-import-test had some dead code. I did the following to eliminate it:

- eliminated error handling for the indirect CompilerInstance, which should
  never generate an error as it is created;
- added a new test for direct importation; and
- removed an unused implementation of the CompleteType() API.

This brings clang-import-test.cpp and ExternalASTMerge.cpp back to 100%
coverage on all metrics measured by DLLVM_BUILD_INSTRUMENTED_COVERAGE.

Differential Revision: https://reviews.llvm.org/D35220

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307600 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIsSpecialLong was only ever set in release mode as all of the uses are in asserts...
Eric Christopher [Mon, 10 Jul 2017 21:28:54 +0000 (21:28 +0000)]
IsSpecialLong was only ever set in release mode as all of the uses are in asserts. Wrap in ifndef NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307594 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse DenseMap instead std::map for GVSummaryMapTy
Dehao Chen [Mon, 10 Jul 2017 20:31:37 +0000 (20:31 +0000)]
Use DenseMap instead std::map for GVSummaryMapTy

Summary: Frontend change for https://reviews.llvm.org/D35148

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: sanjoy, cfe-commits

Differential Revision: https://reviews.llvm.org/D35153

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307584 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAvoid white spaces in file names. NFC
Eric Liu [Mon, 10 Jul 2017 16:05:48 +0000 (16:05 +0000)]
Avoid white spaces in file names. NFC

Summary: White spaces in file names are causing Phabricator/SVN to crash.

Reviewers: bkramer

Subscribers: bogner, cfe-commits

Differential Revision: https://reviews.llvm.org/D35203

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307551 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoX86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__
Zvi Rackover [Mon, 10 Jul 2017 07:13:56 +0000 (07:13 +0000)]
X86 Intrinsics: _bit_scan_forward should not be under #ifdef __RDRND__

Summary:
The _bit_scan_forward and _bit_scan_reverse intrinsics were accidentally
masked under the preprocessor checks that prune intrinsics definitions for the
benefit of faster compile-time on Windows. This patch moves the
definitons out of that region.

Fixes pr33722

Reviewers: craig.topper, aaboud, thakis

Reviewed By: craig.topper

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D35184

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307524 91177308-0d34-0410-b5e6-96231b3b80d8