]> granicus.if.org Git - clang/log
clang
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

7 years agoRemove incorrect FIXME comment; the FIXME was addressed before the changes were committed
Eric Fiselier [Mon, 10 Jul 2017 02:59:26 +0000 (02:59 +0000)]
Remove incorrect FIXME comment; the FIXME was addressed before the changes were committed

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

7 years agoRemove non-ascii characters introduced in r307513
Eric Fiselier [Mon, 10 Jul 2017 02:52:34 +0000 (02:52 +0000)]
Remove non-ascii characters introduced in r307513

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

7 years ago[coroutines] Include the implicit object parameter type when looking up coroutine_tra...
Eric Fiselier [Mon, 10 Jul 2017 01:27:22 +0000 (01:27 +0000)]
[coroutines] Include the implicit object parameter type when looking up coroutine_traits for member functions.

This patch was originally from Toby Allsopp, but I hijacked it and
fixed it up with his permission.

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

7 years ago[analyzer] Faster hashing of subsequences in CompoundStmts.
Raphael Isemann [Sun, 9 Jul 2017 21:14:36 +0000 (21:14 +0000)]
[analyzer] Faster hashing of subsequences in CompoundStmts.

Summary: This patches improves the hashing subsequences in CompoundStmts by incrementally hashing all subsequences with the same starting position. This results in a reduction of the time for this constraint while running over SQLite from 1.10 seconds to 0.55 seconds (-50%).

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits, xazax.hun, v.g.vassilev

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

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

7 years ago[X86] Add more feature flag bit defines to cpuid.h for gcc compatibility.
Craig Topper [Sun, 9 Jul 2017 17:43:11 +0000 (17:43 +0000)]
[X86] Add more feature flag bit defines to cpuid.h for gcc compatibility.

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

7 years ago[X86] Add __get_cpuid_count to cpuid.h. Update __get_cpuid to check the maximum level...
Craig Topper [Sun, 9 Jul 2017 17:43:10 +0000 (17:43 +0000)]
[X86] Add __get_cpuid_count to cpuid.h. Update __get_cpuid to check the maximum level support before accessing the leaf. Rename level to leaf everywhere.

This matches gcc behavior.

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

7 years ago[analyzer] Make StmtDataCollector part of the CloneDetection API
Raphael Isemann [Sun, 9 Jul 2017 15:56:39 +0000 (15:56 +0000)]
[analyzer] Make StmtDataCollector part of the CloneDetection API

Summary: We probably want to use this useful templates in other pieces of code (e.g. the one from D34329), so we should make this public.

Reviewers: NoQ

Reviewed By: NoQ

Subscribers: cfe-commits, xazax.hun, v.g.vassilev, johannes

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

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

7 years agoFix build failure with gcc about mixing enum and non-enum
Yaxun Liu [Sat, 8 Jul 2017 19:13:41 +0000 (19:13 +0000)]
Fix build failure with gcc about mixing enum and non-enum

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

7 years ago[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified
Yuka Takahashi [Sat, 8 Jul 2017 17:48:59 +0000 (17:48 +0000)]
[Bash-autocompletion] Auto complete cc1 options if -cc1 is specified

Summary:
We don't want to autocomplete flags whose Flags class has `NoDriverOption` when argv[1] is not `-cc1`.

Another idea for this implementation is to make --autocomplete a cc1
option and handle it in clang Frontend, by porting --autocomplete
handler from Driver to Frontend, so that we can handle Driver options
and CC1 options in unified manner.

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

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

7 years ago[Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly
Yuka Takahashi [Sat, 8 Jul 2017 17:34:02 +0000 (17:34 +0000)]
[Bash-autocompletion] Fix a bug that -foo=bar doesn't handled properly

Summary: Fixed a bug that -foo=bar wasn't handled properly on old version of bash.

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

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

7 years ago[CodeGen] Fold variable into assert.
Benjamin Kramer [Sat, 8 Jul 2017 14:14:57 +0000 (14:14 +0000)]
[CodeGen] Fold variable into assert.

Avoids warnings in Release builds.

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

7 years agoCodeGen: Fix address space of global variable
Yaxun Liu [Sat, 8 Jul 2017 13:24:52 +0000 (13:24 +0000)]
CodeGen: Fix address space of global variable

Certain targets (e.g. amdgcn) require global variable to stay in global or constant address
space. In C or C++ global variables are emitted in the default (generic) address space.
This patch introduces virtual functions TargetCodeGenInfo::getGlobalVarAddressSpace
and TargetInfo::getConstantAddressSpace to handle this in a general approach.

It only affects IR generated for amdgcn target.

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

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

7 years ago[analyzer] Fix a path in the developer manual
Gabor Horvath [Sat, 8 Jul 2017 08:23:52 +0000 (08:23 +0000)]
[analyzer] Fix a path in the developer manual

Patch by: Reka Nikolett Kovacs

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

7 years ago[ODRHash] Support FriendDecl
Richard Trieu [Sat, 8 Jul 2017 02:04:42 +0000 (02:04 +0000)]
[ODRHash] Support FriendDecl

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

7 years ago[X86] Move AVX512VPOPCNTDQ in __builtin_cpu_support's enum to match trunk gcc.
Craig Topper [Sat, 8 Jul 2017 00:47:44 +0000 (00:47 +0000)]
[X86] Move AVX512VPOPCNTDQ in __builtin_cpu_support's enum to match trunk gcc.

There are two other features before it that we don't currently support in the the frontend or backend so I left placeholders to keep the encoding correct.

I think the compiler-rt implementation of this feature is even further out of date.

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

7 years agoFix warnings introduced by r307434.
Richard Smith [Sat, 8 Jul 2017 00:37:59 +0000 (00:37 +0000)]
Fix warnings introduced by r307434.

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

7 years agoRevert r307445 as it breaks on certain platforms.
Dehao Chen [Fri, 7 Jul 2017 22:40:37 +0000 (22:40 +0000)]
Revert r307445 as it breaks on certain platforms.

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

7 years ago[MS] Don't statically initialize dllimport member function pointers
Reid Kleckner [Fri, 7 Jul 2017 22:04:29 +0000 (22:04 +0000)]
[MS] Don't statically initialize dllimport member function pointers

Summary:
r306137 made dllimport pointers to member functions non-constant. This
is correct because a load must be executed to resolve any dllimported
data. However, r306137 did not account for the use of dllimport member
function pointers used as template arguments.

This change re-lands r306137 with a template instantiation fix.

This fixes PR33570.

Reviewers: rnk, majnemer

Subscribers: cfe-commits

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

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

7 years agoAdd sample PGO integration test to cover profile annotation and inlining.
Dehao Chen [Fri, 7 Jul 2017 22:01:47 +0000 (22:01 +0000)]
Add sample PGO integration test to cover profile annotation and inlining.

Summary: The patch makes the integration test cover major sample PGO components.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: sanjoy, cfe-commits

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

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

7 years agoAdd testcase for r305850.
Lang Hames [Fri, 7 Jul 2017 21:51:11 +0000 (21:51 +0000)]
Add testcase for r305850.

Accidentally left this out of the original commit.

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

7 years agoEnable the new PM + SamlePGO + ThinLTO testing.
Dehao Chen [Fri, 7 Jul 2017 20:53:17 +0000 (20:53 +0000)]
Enable the new PM + SamlePGO + ThinLTO testing.

Summary: This patch should be enabled after https://reviews.llvm.org/D34895

Reviewers: chandlerc, tejohnson, davidxl

Reviewed By: tejohnson

Subscribers: sanjoy, mehdi_amini, inglorion, eraman, cfe-commits

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

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

7 years ago[modules ts] Basic for module linkage.
Richard Smith [Fri, 7 Jul 2017 20:04:28 +0000 (20:04 +0000)]
[modules ts] Basic for module linkage.

In addition to the formal linkage rules, the Modules TS includes cases where
internal-linkage symbols within a module interface unit can be referenced from
outside the module via exported inline functions / templates. We give such
declarations "module-internal linkage", which is formally internal linkage, but
results in an externally-visible symbol.

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

7 years ago[X86] Replace 'fallthrough' comments with LLVM_FALLTHROUGH.
Craig Topper [Fri, 7 Jul 2017 18:41:09 +0000 (18:41 +0000)]
[X86] Replace 'fallthrough' comments with LLVM_FALLTHROUGH.

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

7 years agoclang-format: [JS] do not wrap after "readonly".
Martin Probst [Fri, 7 Jul 2017 13:17:10 +0000 (13:17 +0000)]
clang-format: [JS] do not wrap after "readonly".

Summary:
Breaks after "readonly" trigger automatic semicolon insertion in field
declarations.

Reviewers: krasimir, djasper

Subscribers: klimek

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

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

7 years agoRecommit [driver][macOS] Pick the system version for the
Alex Lorenz [Fri, 7 Jul 2017 10:41:19 +0000 (10:41 +0000)]
Recommit [driver][macOS] Pick the system version for the
deployment target if the SDK is newer than the system

This commit reverts the revert commit r305891. Now the change from r305678
should be correct because `llvm::sys::getProcessTriple` now returns the correct
macOS version of the system after the LLVM change r307372.

Original commit message:

This commit improves the driver by making sure that it picks the system version
for the deployment target when the version of the macOS SDK is newer than the
system version.

rdar://29449467

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

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

7 years ago[driver][mips] Pass long-calls feature flag to the MIPS backend
Simon Atanasyan [Fri, 7 Jul 2017 10:35:33 +0000 (10:35 +0000)]
[driver][mips] Pass long-calls feature flag to the MIPS backend

Check the `-mlong-calls` command line option and pass the `long-calls`
feature flag to the backend. Handling of this feature flag in the backend
needs to be implemented by a separate commit.

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

7 years ago[Frontend] Verify that the bitstream is not empty before reading
Alex Lorenz [Fri, 7 Jul 2017 10:25:12 +0000 (10:25 +0000)]
[Frontend] Verify that the bitstream is not empty before reading
the serialised diagnostics

Clang should avoid calling report_fatal_error when the file with the serialised
diagnostics is empty. This commit changes Clang's serialised diagnostic reader,
now it reports an appropriate error instead of crashing.

rdar://31939877

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

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

7 years agoFix crash parsing invalid code
Olivier Goffart [Fri, 7 Jul 2017 09:38:59 +0000 (09:38 +0000)]
Fix crash parsing invalid code

The code in the test caused a crash with this backtrace:

 RecordLayoutBuilder.cpp:2934: const clang::ASTRecordLayout &clang::ASTContext::getASTRecordLayout(const clang::RecordDecl *) const: Assertion `!D->isInvalidDecl() && "Cannot get layout of invalid decl!"' failed.
 [...]
 #7 0x00007f63963d845a __assert_fail_base (/usr/lib/libc.so.6+0x2c45a)
 #8 0x00007f63963d84d2 (/usr/lib/libc.so.6+0x2c4d2)
 #9 0x00007f63937a0631 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const /home/olivier/prog/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:2935:3
 #10 0x00007f63937a1ad5 getFieldOffset(clang::ASTContext const&, clang::FieldDecl const*) /home/olivier/prog/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp:3057:37
 #11 0x00007f6391869f14 clang::Sema::RefersToMemberWithReducedAlignment(clang::Expr*, llvm::function_ref<void (clang::Expr*, clang::RecordDecl*, clang::FieldDecl*, clang::CharUnits)>) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaChecking.cpp:12139:23
 #12 0x00007f639186a2f8 clang::Sema::CheckAddressOfPackedMember(clang::Expr*) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaChecking.cpp:12190:1
 #13 0x00007f6391a7a81c clang::Sema::CheckAddressOfOperand(clang::ActionResult<clang::Expr*, true>&, clang::SourceLocation) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaExpr.cpp:11111:10
 #14 0x00007f6391a7f5d2 clang::Sema::CreateBuiltinUnaryOp(clang::SourceLocation, clang::UnaryOperatorKind, clang::Expr*) /home/olivier/prog/llvm/tools/clang/lib/Sema/SemaExpr.cpp:11932:18

Fixing by bailing out for invalid classes.

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

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

7 years ago[ObjC] Avoid the -Wunguarded-availability warnings for protocol
Alex Lorenz [Fri, 7 Jul 2017 09:15:29 +0000 (09:15 +0000)]
[ObjC] Avoid the -Wunguarded-availability warnings for protocol
requirements in protocol/class/category declarations

The unguarded availability warnings in the protocol requirements of a protocol
/class/category declaration can be avoided. This matches the behaviour of
Swift's diagnostics. The warnings for deprecated/unavailable protocols are
preserved.

rdar://33156429

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

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

7 years agoUpdate Cross-DSO CFI documentation.
Evgeniy Stepanov [Fri, 7 Jul 2017 00:48:12 +0000 (00:48 +0000)]
Update Cross-DSO CFI documentation.

Reviewers: pcc

Subscribers: llvm-commits

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

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

7 years agoThis call-site should have been updated as part of D34304.
Sterling Augustine [Thu, 6 Jul 2017 22:47:19 +0000 (22:47 +0000)]
This call-site should have been updated as part of D34304.

Summary: Use an argument adjuster to preserve behavior inadvertantly changed by D34304.

Reviewers: klimek

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

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

7 years agoChange remaining references to lit.util.capture to use subprocess.check_output.
David L. Jones [Thu, 6 Jul 2017 21:46:47 +0000 (21:46 +0000)]
Change remaining references to lit.util.capture to use subprocess.check_output.

Summary:
The capture() function was removed in r306625. This should fix PGO breakages
reported by Michael Zolotukhin.

Reviewers: mzolotukhin

Subscribers: sanjoy, llvm-commits

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

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

7 years agoReject attempts to build a module without -fmodules, rather than silently doing weird...
Richard Smith [Thu, 6 Jul 2017 21:05:56 +0000 (21:05 +0000)]
Reject attempts to build a module without -fmodules, rather than silently doing weird things.

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

7 years agoAllow CompilerInvocations to generate .d files.
Sterling Augustine [Thu, 6 Jul 2017 21:02:52 +0000 (21:02 +0000)]
Allow CompilerInvocations to generate .d files.

Summary:
Most clang tools should ignore the -M
family of options because one wouldn't want them
to generate a new dependency (.d) file. However,
some tools may want this dependency file. This
patch creates a mechanism for them to do this.

This implementation just plumbs a boolean down
several layers of calls. Each of the modified calls
has several call sites, and so a single member
variable or new API entry point won't work.

An alternative would be to write a function to filter
the -M family of arguments out of CC1Args, and have
each caller call that function by hand before calling
newInvocation, Invocation::run, or buildAstFromCodeWithArgs.
This is a more complicated and error-prone solution.
Why burden all the callers to remember to use
this function?

But I could rewrite this patch to use that method if
that is deemed more appropriate.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

7 years ago [Objective-C] Fix non-determinism in clang
Mandeep Singh Grang [Thu, 6 Jul 2017 18:49:57 +0000 (18:49 +0000)]
 [Objective-C] Fix non-determinism in clang

Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet).

Reviewers: dblaikie, davide, rsmith

Reviewed By: dblaikie

Subscribers: cfe-commits, llvm-commits

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

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

7 years agoThis reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
Sjoerd Meijer [Thu, 6 Jul 2017 16:37:31 +0000 (16:37 +0000)]
This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
problems in testing, see comments in D34161 for some more details.
A fix is in progres in D35011, but a revert seems better now as the fix will
probably take some more time to land.

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

7 years ago[OpenMP] Extend CLANG target options with device offloading kind.
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:22:21 +0000 (16:22 +0000)]
[OpenMP] Extend CLANG target options with device offloading kind.

Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld

Reviewed By: hfinkel

Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits

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

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

7 years ago[OpenMP] Customize CUDA-based tool chain selection
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:08:15 +0000 (16:08 +0000)]
[OpenMP] Customize CUDA-based tool chain selection

Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: Hahnfeld

Subscribers: rengolin, cfe-commits

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

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

7 years ago[clang-format] Add TextProto language name, NFC
Krasimir Georgiev [Thu, 6 Jul 2017 14:39:39 +0000 (14:39 +0000)]
[clang-format] Add TextProto language name, NFC

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

7 years ago[clang-format] Add space between a message field key and the opening bracket in proto...
Krasimir Georgiev [Thu, 6 Jul 2017 13:58:29 +0000 (13:58 +0000)]
[clang-format] Add space between a message field key and the opening bracket in proto messages

Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[OpenCL] Test on image access modifiers and image type can only be a type of a functi...
Egor Churaev [Thu, 6 Jul 2017 07:06:11 +0000 (07:06 +0000)]
[OpenCL] Test on image access modifiers and image type can only be a type of a function argument.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years ago[modules ts] Do not emit strong function definitions from the module interface unit...
Richard Smith [Thu, 6 Jul 2017 00:30:00 +0000 (00:30 +0000)]
[modules ts] Do not emit strong function definitions from the module interface unit in every user.

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

7 years ago[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS...
Richard Smith [Thu, 6 Jul 2017 00:29:13 +0000 (00:29 +0000)]
[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS flag to work if copy-pasted.

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

7 years agoFix test case in pre-C++11 mode; address Aaron Ballman's code review.
Douglas Gregor [Wed, 5 Jul 2017 21:12:37 +0000 (21:12 +0000)]
Fix test case in pre-C++11 mode; address Aaron Ballman's code review.

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

7 years agoFix one more reference to lit.util.capture()
Michael Zolotukhin [Wed, 5 Jul 2017 21:06:11 +0000 (21:06 +0000)]
Fix one more reference to lit.util.capture()

The capture method was removed in r306643.

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

7 years agoCope with Range-v3's CONCEPT_REQUIRES idiom
Douglas Gregor [Wed, 5 Jul 2017 20:20:15 +0000 (20:20 +0000)]
Cope with Range-v3's CONCEPT_REQUIRES idiom

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

7 years agoCustomize the SFINAE diagnostics for enable_if to provide the failed condition.
Douglas Gregor [Wed, 5 Jul 2017 20:20:14 +0000 (20:20 +0000)]
Customize the SFINAE diagnostics for enable_if to provide the failed condition.

When enable_if disables a particular overload resolution candidate,
rummage through the enable_if condition to find the specific condition
that caused the failure. For example, if we have something like:

    template<
      typename Iter,
      typename = std::enable_if_t<Random_access_iterator<Iter> &&
                                  Comparable<Iterator_value_type<Iter>>>>
    void mysort(Iter first, Iter last) {}

and we call "mysort" with "std::list<int>" iterators, we'll get a
diagnostic saying that the "Random_access_iterator<Iter>" requirement
failed. If we call "mysort" with
"std::vector<something_not_comparable>", we'll get a diagnostic saying
that the "Comparable<...>" requirement failed.

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

7 years agoAdd docs for -foptimization-record-file=
Brian Gesiak [Wed, 5 Jul 2017 19:55:51 +0000 (19:55 +0000)]
Add docs for -foptimization-record-file=

Summary: The Clang option was previously not included in the User's Manual.

Reviewers: anemet, davidxl, hfinkel

Reviewed By: hfinkel

Subscribers: cfe-commits

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

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

7 years ago[Sema] Don't allow -Wunguarded-availability to be silenced with redecls
Erik Pilkington [Wed, 5 Jul 2017 17:08:56 +0000 (17:08 +0000)]
[Sema] Don't allow -Wunguarded-availability to be silenced with redecls

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

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

7 years agoAddress comments that escaped D33333
Erich Keane [Wed, 5 Jul 2017 16:43:45 +0000 (16:43 +0000)]
Address comments that escaped D33333

Patch By: Jen Yu

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

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

7 years ago[SystemZ] Simplify handling of ISA revisions
Ulrich Weigand [Wed, 5 Jul 2017 13:19:47 +0000 (13:19 +0000)]
[SystemZ] Simplify handling of ISA revisions

This moves determination of the ISA revision from the CPU name to
one single place, removing a bunch of duplicated code.  It also
makes the supported ISA revisions available as feature strings.

No functional change.

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

7 years ago[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:37 +0000 (12:57 +0000)]
[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC

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

7 years ago[driver][mips] Remove redundant curly brackets. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:32 +0000 (12:57 +0000)]
[driver][mips] Remove redundant curly brackets. NFC

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

7 years ago[clang-format] Fix an uninitialized memory access
Krasimir Georgiev [Wed, 5 Jul 2017 12:24:01 +0000 (12:24 +0000)]
[clang-format] Fix an uninitialized memory access

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

7 years agoAdd const to reference arguments of Diagnostic ctor
Alexander Kornienko [Wed, 5 Jul 2017 11:45:09 +0000 (11:45 +0000)]
Add const to reference arguments of Diagnostic ctor

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

7 years agoFix invalid warnings for header guards in preambles
Erik Verbruggen [Wed, 5 Jul 2017 09:44:07 +0000 (09:44 +0000)]
Fix invalid warnings for header guards in preambles

Fixes https://bugs.llvm.org/show_bug.cgi?id=33574

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

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

7 years ago[modules ts] Improve merging of module-private declarations.
Richard Smith [Wed, 5 Jul 2017 07:47:11 +0000 (07:47 +0000)]
[modules ts] Improve merging of module-private declarations.

These cases occur frequently for declarations in the global module (above the
module-declaration) in a Modules TS module interface. When we merge a
definition from another module into such a module-private definition, ensure
that we transitively make everything lexically within that definition visible
to that translation unit.

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Wed, 5 Jul 2017 05:37:45 +0000 (05:37 +0000)]
fix trivial typos in comments; NFC

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

7 years ago[AMDGPU] Fix size and alignment of size_t and pointer types
Yaxun Liu [Wed, 5 Jul 2017 04:58:24 +0000 (04:58 +0000)]
[AMDGPU] Fix size and alignment of size_t and pointer types

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

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

7 years ago[modules ts] Declarations from a module interface unit are only visible outside
Richard Smith [Wed, 5 Jul 2017 01:42:07 +0000 (01:42 +0000)]
[modules ts] Declarations from a module interface unit are only visible outside
the module if declared in an export block.

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

7 years ago[AMDGPU] Fix regressions on mesa/clover with libclc due to address space
Yaxun Liu [Tue, 4 Jul 2017 19:57:18 +0000 (19:57 +0000)]
[AMDGPU] Fix regressions on mesa/clover with libclc due to address space

Currently AMDGPUTargetInfo does not initialize AddrSpaceMap in constructor, which causes regressions in mesa/clover with libclc.

This patch fixes that.

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

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

7 years agoEnable LLVM asan support for NetBSD/amd64
Kamil Rytarowski [Tue, 4 Jul 2017 19:55:56 +0000 (19:55 +0000)]
Enable LLVM asan support for NetBSD/amd64

Summary:
Enable LLVM asan sanitizer for NetBSD/amd64.

Don't generate -ldl for dlopen(3)-like functions on NetBSD.
These features are available in libc on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, eugenis, kcc, dim

Reviewed By: dim

Subscribers: #clang, #sanitizers

Tags: #clang, #sanitizers

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

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

7 years agoclang-format: [JS] space between pseudo keywords and template literals.
Martin Probst [Tue, 4 Jul 2017 15:30:21 +0000 (15:30 +0000)]
clang-format: [JS] space between pseudo keywords and template literals.

Summary:
Before:
  yield`foo`;

After:
  yield `foo`;

This reinstates commit 71d3b5cd91 / r307023 and fixes the logic by
introducing an explicit table of JavaScript pseudo keywords.

Reviewers: djasper

Subscribers: klimek

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

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

7 years ago[index] Index nested name qualifiers in a forward declaration of a
Alex Lorenz [Tue, 4 Jul 2017 12:50:53 +0000 (12:50 +0000)]
[index] Index nested name qualifiers in a forward declaration of a
class template specialization

rdar://33122110

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

7 years ago[OpenCL] Rename err_opencl_enqueue_kernel_expected_type
Joey Gouly [Tue, 4 Jul 2017 11:50:23 +0000 (11:50 +0000)]
[OpenCL] Rename err_opencl_enqueue_kernel_expected_type

Rename err_opencl_enqueue_kernel_expected_type so that other builtins
can use the same diagnostic.

https://reviews.llvm.org/D34948

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

7 years ago[CodeGen] Check key function for typeinfo import
Shoaib Meenai [Tue, 4 Jul 2017 01:02:19 +0000 (01:02 +0000)]
[CodeGen] Check key function for typeinfo import

If the imported class does not have a key function, we should emit its
typeinfo locally instead of attempting to import it.

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

7 years ago[Sema] Make BreakContinueFinder handle nested loops.
Eli Friedman [Tue, 4 Jul 2017 00:52:24 +0000 (00:52 +0000)]
[Sema] Make BreakContinueFinder handle nested loops.

We don't care about break or continue statements that aren't
associated with the current loop, so make sure the visitor
doesn't find them.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32648 .

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

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

7 years ago[clang] Implement -Wcast-qual for C++
Roman Lebedev [Mon, 3 Jul 2017 17:59:22 +0000 (17:59 +0000)]
[clang] Implement -Wcast-qual for C++

Summary:
This way, the behavior of that warning flag
more closely resembles that of GCC.

Do note that there is at least one false-negative (see FIXME in tests).

Fixes PR4802.

Testing:
```
ninja check-clang-sema check-clang-semacxx
```

Reviewers: dblaikie, majnemer, rnk

Reviewed By: dblaikie, rnk

Subscribers: mclow.lists, cfe-commits, alexfh, rnk

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

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

7 years agoRevert "clang-format: [JS] space between pseudo keywords and template literals."
Martin Probst [Mon, 3 Jul 2017 15:31:28 +0000 (15:31 +0000)]
Revert "clang-format: [JS] space between pseudo keywords and template literals."

This reverts commit 71d3b5cd916106005ef23467e3f6c7fbca7bc499.

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

7 years ago[clang-format] Support text proto messages
Krasimir Georgiev [Mon, 3 Jul 2017 15:05:14 +0000 (15:05 +0000)]
[clang-format] Support text proto messages

Summary: This patch adds support for textual protocol buffer messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek, mgorny

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

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

7 years agoclang-format: [JS] space between pseudo keywords and template literals.
Martin Probst [Mon, 3 Jul 2017 14:29:13 +0000 (14:29 +0000)]
clang-format: [JS] space between pseudo keywords and template literals.

Summary:
Before:
    yield`foo`;

After:
    yield `foo`;

Reviewers: djasper

Subscribers: klimek

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

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

7 years ago[index] Remove 'implicit' role for message sends in implicit ObjC
Alex Lorenz [Mon, 3 Jul 2017 10:34:46 +0000 (10:34 +0000)]
[index] Remove 'implicit' role for message sends in implicit ObjC
property references

rdar://32375673

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

7 years agoAdd a fixit for -Wobjc-protocol-property-synthesis
Alex Lorenz [Mon, 3 Jul 2017 10:12:24 +0000 (10:12 +0000)]
Add a fixit for -Wobjc-protocol-property-synthesis

rdar://32132756

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

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Mon, 3 Jul 2017 08:49:44 +0000 (08:49 +0000)]
fix trivial typos in comments; NFC

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Sun, 2 Jul 2017 06:12:49 +0000 (06:12 +0000)]
fix trivial typos in comments; NFC

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

7 years agoAdd an option group for deprecated warnings. Add the removed
Joerg Sonnenberger [Sat, 1 Jul 2017 21:36:21 +0000 (21:36 +0000)]
Add an option group for deprecated warnings. Add the removed
-fslp-vectorize-aggressive and -fno-slp-vectorize-aggressive flags back
under this group and test for the warning. Document the future removal
in the ReleaseNotes.

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

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

7 years ago[modules] Teach clang how to merge typedef over anonymous structs in C mode.
Vassil Vassilev [Sat, 1 Jul 2017 20:44:49 +0000 (20:44 +0000)]
[modules] Teach clang how to merge typedef over anonymous structs in C mode.

In C mode clang fails to merge the textually included definition with the one imported from a module. The C lookup rules fail to find the imported definition because its linkage is internal in non C++ mode.

This patch reinstates some of the ODR merging rules for typedefs of anonymous tags for languages other than C++.

Patch by Raphael Isemann and me (D34510).

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

7 years ago[Bash-autocompletion] Add support for older bash version.
Yuka Takahashi [Sat, 1 Jul 2017 18:32:55 +0000 (18:32 +0000)]
[Bash-autocompletion] Add support for older bash version.

Summary:
OS X seems to use older bash version which doesn't suport
_init_completion and compopt, so add support for this.

Reviewers: ruiu, v.g.vassilev, teemperor

Subscribers: cfe-commits

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

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

7 years ago[Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME
Yuka Takahashi [Sat, 1 Jul 2017 16:30:02 +0000 (16:30 +0000)]
[Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME

Summary: `~/build/bin/clang -f[tab]` was executed without ~ expanded to $HOME, so changed this by expanding ~ to path using eval.

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

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

7 years ago[OpenMP] Fix mapping of scalars for combined directives
Jonas Hahnfeld [Sat, 1 Jul 2017 10:40:50 +0000 (10:40 +0000)]
[OpenMP] Fix mapping of scalars for combined directives

Combined directives like 'target parallel' have two captured statements.
Sema has to check the right one from the right direction.

Previously, Sema::IsOpenMPCapturedByRef would return false for mapped
scalars on combined directives. This results in a wrong signature of
the outlined function which triggers an assertion:
void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.

Fixes PR30975 (and PR31985). New function was taken from clang-ykt.

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

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

7 years agofix trivial typos; NFC
Hiroshi Inoue [Sat, 1 Jul 2017 08:46:43 +0000 (08:46 +0000)]
fix trivial typos; NFC

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

7 years agoChanged Opts.EABIVersion type string to llvm::EABI enum class
Yuka Takahashi [Sat, 1 Jul 2017 07:57:23 +0000 (07:57 +0000)]
Changed Opts.EABIVersion type string to llvm::EABI enum class

Summary:
Changed EABIVersion type from string to llvm::EABI.
It seems it was just a typo and this is intended implementation.

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

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

7 years agoUn-revert "[Driver] Add -fdiagnostics-hotness-threshold"
Brian Gesiak [Sat, 1 Jul 2017 05:45:26 +0000 (05:45 +0000)]
Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"

Summary:
Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the
documentation to fix an error -- I had used the wrong syntax for a link.

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

7 years agoRevert "[Driver] Add -fdiagnostics-hotness-threshold"
Brian Gesiak [Sat, 1 Jul 2017 04:54:53 +0000 (04:54 +0000)]
Revert "[Driver] Add -fdiagnostics-hotness-threshold"

Summary:
The commit caused a documentation breakage.

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

7 years ago[Driver] Add -fdiagnostics-hotness-threshold
Brian Gesiak [Sat, 1 Jul 2017 04:44:38 +0000 (04:44 +0000)]
[Driver] Add -fdiagnostics-hotness-threshold

Summary:
Depends on https://reviews.llvm.org/D34867.

Add a Clang frontend option to enable optimization remark hotness
thresholds, which were added to LLVM in https://reviews.llvm.org/D34867.
This prevents diagnostics that do not meet a minimum hotness
threshold from being output. When generating optimization remarks for large
codebases with a ton of cold code paths, this option can be used
to limit the optimization remark output at a reasonable size.
Discussion of this change can be read here:
http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html

Reviewers: anemet, davidxl, hfinkel

Reviewed By: anemet

Subscribers: fhahn, cfe-commits

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

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

7 years agoFix indentation.
Akira Hatanaka [Sat, 1 Jul 2017 04:37:54 +0000 (04:37 +0000)]
Fix indentation.

This is an attempt to fix a failing bot:

http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror

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