]> granicus.if.org Git - clang/log
clang
6 years agoMake DiagnosticIDs::getAllDiagnostics static. NFC.
Gabor Horvath [Tue, 14 Nov 2017 12:14:49 +0000 (12:14 +0000)]
Make DiagnosticIDs::getAllDiagnostics static. NFC.

Patch by: Andras Leitereg!

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

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

6 years ago[ASTImporter] TypeAliasTemplate and PackExpansion importing capability
Gabor Horvath [Tue, 14 Nov 2017 11:30:38 +0000 (11:30 +0000)]
[ASTImporter] TypeAliasTemplate and PackExpansion importing capability

Patch by: Zoltan Gera!

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

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

6 years ago[libclang] Allow crash recovery with LIBCLANG_NOTHREADS
Erik Verbruggen [Tue, 14 Nov 2017 09:34:39 +0000 (09:34 +0000)]
[libclang] Allow crash recovery with LIBCLANG_NOTHREADS

Enabled crash recovery for some libclang operations on a calling thread even
when LIBCLANG_NOTHREAD is specified.

Previously it would only run under crash recovery if LIBCLANG_NOTHREAD is not
set. Moved handling of LIBCLANG_NOTHREAD env variable into RunSafely from its
call sites.

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

6 years agoRefactor ContinuationIndenter's breakProtrudingToken logic.
Manuel Klimek [Tue, 14 Nov 2017 09:19:53 +0000 (09:19 +0000)]
Refactor ContinuationIndenter's breakProtrudingToken logic.

Create more orthogonal pieces. The restructuring made it easy to try out
several alternatives to D33589, and while none of the alternatives
turned out to be the right solution, the underlying simplification of
the structure is helpful.

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

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

6 years ago[NewPassManager] Pass the -fdebug-pass-manager flag setting into the Analysis manager...
Craig Topper [Tue, 14 Nov 2017 08:48:28 +0000 (08:48 +0000)]
[NewPassManager] Pass the -fdebug-pass-manager flag setting into the Analysis managers to match what we do in opt

Summary: Currently the -fdebug-pass-manager flag for clang doesn't enable the debug logging in the analysis managers. This is different than what the switch does when passed to opt.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: cfe-commits

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

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

6 years ago[PM] Require a registered x86 target for this test which uses the x86
Chandler Carruth [Tue, 14 Nov 2017 05:20:03 +0000 (05:20 +0000)]
[PM] Require a registered x86 target for this test which uses the x86
triple.

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

6 years ago[PM] Wire up support for the bounds checking sanitizer with the new PM.
Chandler Carruth [Tue, 14 Nov 2017 01:59:18 +0000 (01:59 +0000)]
[PM] Wire up support for the bounds checking sanitizer with the new PM.

Not much interesting here. Mostly wiring things together.

One thing worth noting is that the approach is substantially different
from the old PM. Here, the -O0 case works fundamentally differently in
that we just directly build the pipeline without any callbacks or other
cruft. In some ways, this is nice and clean. However, I don't like that
it causes the sanitizers to be enabled with different changes at
different times. =/ Suggestions for a better way to do this are welcome.

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

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

6 years ago[PM] Add a missing header that I had in the next commit but was needed
Chandler Carruth [Tue, 14 Nov 2017 01:47:24 +0000 (01:47 +0000)]
[PM] Add a missing header that I had in the next commit but was needed
in r318128. Should fix the build.

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

6 years ago[completion] complete ObjC interface names in an expression
Alex Lorenz [Tue, 14 Nov 2017 01:46:24 +0000 (01:46 +0000)]
[completion] complete ObjC interface names in an expression

Objective-C interfaces can be used in a class property expression.

rdar://26982192

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

6 years ago[PM] Port BoundsChecking to the new PM.
Chandler Carruth [Tue, 14 Nov 2017 01:30:04 +0000 (01:30 +0000)]
[PM] Port BoundsChecking to the new PM.

Registers it and everything, updates all the references, etc.

Next patch will add support to Clang's `-fexperimental-new-pass-manager`
path to actually enable BoundsChecking correctly.

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

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

6 years ago[Sema] Stable sort OverloadCandidates to remove non-deterministic ordering
Mandeep Singh Grang [Tue, 14 Nov 2017 00:22:24 +0000 (00:22 +0000)]
[Sema] Stable sort OverloadCandidates to remove non-deterministic ordering

Summary: This fixes failure in Misc/diag-template-diffing.cpp uncovered by D39245.

Reviewers: rjmccall, rsmith

Reviewed By: rjmccall

Subscribers: cfe-commits

Tags: #clang

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

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

6 years agoRevert "Update test_debuginfo.pl script to point to new tree location."
Zachary Turner [Mon, 13 Nov 2017 23:33:29 +0000 (23:33 +0000)]
Revert "Update test_debuginfo.pl script to point to new tree location."

This reverts the aforementioned patch and 2 subsequent follow-ups,
as some buildbots are still failing 2 tests because of it.
Investigation is ongoing into the cause of the failures.

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

6 years agoUpdate link to protobuf
Hans Wennborg [Mon, 13 Nov 2017 23:27:55 +0000 (23:27 +0000)]
Update link to protobuf

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

6 years agoUpdate a link to the old code.google.com bug tracker
Hans Wennborg [Mon, 13 Nov 2017 23:27:54 +0000 (23:27 +0000)]
Update a link to the old code.google.com bug tracker

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

6 years agoUpdate link to the Chromium Clang page
Hans Wennborg [Mon, 13 Nov 2017 23:27:53 +0000 (23:27 +0000)]
Update link to the Chromium Clang page

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Mon, 13 Nov 2017 23:01:27 +0000 (23:01 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoOpenCL: Assume inline asm is convergent
Matt Arsenault [Mon, 13 Nov 2017 22:40:55 +0000 (22:40 +0000)]
OpenCL: Assume inline asm is convergent

Already done for CUDA.

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

6 years ago[CodeGen] fix const-ness of cbrt and fma
Sanjay Patel [Mon, 13 Nov 2017 22:11:49 +0000 (22:11 +0000)]
[CodeGen] fix const-ness of cbrt and fma

cbrt() is always constant because it can't overflow or underflow. Therefore, it can't set errno.

fma() is not always constant because it can overflow or underflow. Therefore, it can set errno.
But we know that it never sets errno on GNU / MSVC, so make it constant in those environments.

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

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

6 years ago [clang] Remove redundant return [NFC]
Mandeep Singh Grang [Mon, 13 Nov 2017 19:29:31 +0000 (19:29 +0000)]
 [clang] Remove redundant return [NFC]

Reviewers: rsmith, sfantao, mcrosier

Reviewed By: mcrosier

Subscribers: jholewinski, cfe-commits

Tags: #clang

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

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

6 years ago[analyzer] ObjCGenerics: Don't warn on cast conversions involving explicit cast
Devin Coughlin [Mon, 13 Nov 2017 17:35:29 +0000 (17:35 +0000)]
[analyzer] ObjCGenerics: Don't warn on cast conversions involving explicit cast

The ObjCGenerics checker warns on a cast when there is no subtyping relationship
between the tracked type of the value and the destination type of the cast. It
does this even if the cast was explicitly written. This means the user can't
write an explicit cast to silence the diagnostic.

This commit treats explicit casts involving generic types as an indication from
the programmer that the Objective-C type system is not rich enough to express
the needed invariant. On explicit casts, the checker now removes any existing
information inferred about the type arguments. Further, it no longer assumes
the casted-to specialized type because the invariant the programmer specifies
in the cast may only hold at a particular program point and not later ones. This
prevents a suppressing cast from requiring a cascade of casts down the
line.

rdar://problem/33603303

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

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

6 years ago[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Teresa Johnson [Mon, 13 Nov 2017 15:38:33 +0000 (15:38 +0000)]
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

Recommit of r317951 and r317951 along with what I believe should fix
the remaining buildbot failures - the target triple should be specified
for both the ThinLTO pre-thinlink compile and backend (post-thinlink)
compile to ensure it is consistent.

Original description:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).

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

6 years ago[X86] test/testn intrinsics lowering to IR. clang side
Uriel Korach [Mon, 13 Nov 2017 12:50:52 +0000 (12:50 +0000)]
[X86] test/testn intrinsics lowering to IR. clang side

Change Header files of the intrinsics for lowering test and testn intrinsics to IR code.
Removed test and testn builtins from clang

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

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

6 years agoChange
Jina Nahias [Mon, 13 Nov 2017 11:41:41 +0000 (11:41 +0000)]
Change
// CHECK: shufflevector <8 x double> %0, <8 x double> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 8, i32 9>
To
// CHECK: shufflevector <8 x double> %{{.*}}, <8 x double> %{{.*}}, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 8, i32 9, i32 8, i32 9>
for fixing 318025 commit warning

Change-Id: Id48a1fe1f247fe6a0b84e7189f18d2e637678e79

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

6 years ago[analyzer] Document the issue hash debugging facility
Gabor Horvath [Mon, 13 Nov 2017 11:13:02 +0000 (11:13 +0000)]
[analyzer] Document the issue hash debugging facility

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

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

6 years ago[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR
Jina Nahias [Mon, 13 Nov 2017 09:15:31 +0000 (09:15 +0000)]
[x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IR

This patch, together with a matching llvm patch (https://reviews.llvm.org/D38671), implements the lowering of X86 shuffle i/f intrinsics to IR.

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

Change-Id: I9b3c2f2b34323bd9ccb21d0c1832f848b88ec047

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

6 years agoFix AST matcher documentation typo
Dave Lee [Sat, 11 Nov 2017 23:53:27 +0000 (23:53 +0000)]
Fix AST matcher documentation typo

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

6 years agoAdd ObjC exception statement AST matchers
Dave Lee [Sat, 11 Nov 2017 22:46:15 +0000 (22:46 +0000)]
Add ObjC exception statement AST matchers

Summary: Add AST matchers for Objective-C @throw, @try, @catch and @finally.

Reviewers: aaron.ballman, malcolm.parsons, alexshap, compnerd

Reviewed By: aaron.ballman

Subscribers: cfe-commits, klimek

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

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

6 years ago[python] [tests] Fix test_linkage for unique external linkage
Michal Gorny [Sat, 11 Nov 2017 20:01:41 +0000 (20:01 +0000)]
[python] [tests] Fix test_linkage for unique external linkage

Starting with r314037, anonymous namespaces no longer give
unique-external linkage to variables. However, this linkage can still be
achieved by using a type which is not exterally visible,
e.g. through being declared in an anonymous namespace but used outside
it. Fix the test to take advantage of that.

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

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

6 years agoAdjust r316292 - remove the anonymous union for sharing a bitfield in FunctionDecl.
Faisal Vali [Sat, 11 Nov 2017 18:02:29 +0000 (18:02 +0000)]
Adjust r316292 - remove the anonymous union for sharing a bitfield in FunctionDecl.

The anonymous union did NOT save us storage, but instead behaved as if we added an additional integer data member to FunctionDecl.

For additional context, the anonymous union renders the bit fields as non-adjacent and prevents them from sharing the same 'memory location' (i.e. bit-storage) by requiring the anonymous union object to be appropriately aligned.

This was confirmed through discussion with Richard Smith in Albuquerque (ISO C++ Meeting)

https://reviews.llvm.org/rL316292

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

6 years ago[cxx_status] Add resolution of CWG issue 1581, since it's an important, visible change.
Richard Smith [Sat, 11 Nov 2017 18:00:16 +0000 (18:00 +0000)]
[cxx_status] Add resolution of CWG issue 1581, since it's an important, visible change.

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

6 years ago[cxx_status] Update for moved Albuquerque papers.
Richard Smith [Sat, 11 Nov 2017 17:54:46 +0000 (17:54 +0000)]
[cxx_status] Update for moved Albuquerque papers.

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

6 years ago[coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing it in...
Gor Nishanov [Sat, 11 Nov 2017 17:00:43 +0000 (17:00 +0000)]
[coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing it in the coroutine frame

Summary:
We don't want to store cleanup dest slot saved into the coroutine frame (as some of the cleanup code may
access them after coroutine frame destroyed).

This is an alternative to https://reviews.llvm.org/D37093

It is possible to do this for all functions, but, cursory check showed that in -O0, we get slightly longer function (by 1-3 instructions), thus, we are only limiting cleanup.dest.slot elimination to coroutines.

Reviewers: rjmccall, hfinkel, eric_niebler

Reviewed By: eric_niebler

Subscribers: EricWF, cfe-commits

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

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

6 years ago[CUDA] Fix std::min on device side to return the min, not the max.
Justin Lebar [Sat, 11 Nov 2017 01:25:44 +0000 (01:25 +0000)]
[CUDA] Fix std::min on device side to return the min, not the max.

Summary:
How embarrassing.

This is tested in the test-suite -- fix to come there in a separate
patch.

Reviewers: tra

Subscribers: sanjoy, cfe-commits

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

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

6 years agoAdd CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fission
Jake Ehrlich [Sat, 11 Nov 2017 01:15:41 +0000 (01:15 +0000)]
Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fission

llvm-objcopy is getting to where it can be used in non-trivial ways
(such as for dwarf fission in clang). It now supports dwarf fission but
this feature hasn't been thoroughly tested yet. This change allows
people to optionally build clang to use llvm-objcopy rather than GNU
objcopy. By default GNU objcopy is still used so nothing should change.

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

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

6 years agoRevert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"
Teresa Johnson [Sat, 11 Nov 2017 01:06:41 +0000 (01:06 +0000)]
Revert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"

This reverts commit r317951 and r317952. The new test is aborting on
some bots and I'll need to investigate later.

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

6 years agoHandle lambda captures of variable length arrays in profiling and printing.
Richard Trieu [Sat, 11 Nov 2017 00:54:25 +0000 (00:54 +0000)]
Handle lambda captures of variable length arrays in profiling and printing.

From http://reviews.llvm.org/D4368 these cases were thought to not be reachable
and the checks removed before the rest of the code was committed in r216649.
However, these cases are reachable and the checks are added back.

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

6 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Sat, 11 Nov 2017 00:08:50 +0000 (00:08 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoAdd x86-registered-target to REQUIRES for new test
Teresa Johnson [Sat, 11 Nov 2017 00:05:39 +0000 (00:05 +0000)]
Add x86-registered-target to REQUIRES for new test

Should fix test added in r317951.

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

6 years ago[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang
Teresa Johnson [Fri, 10 Nov 2017 23:37:39 +0000 (23:37 +0000)]
[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang

Summary:
The LTO Config field wasn't being set when invoking a ThinLTO backend
via clang (i.e. for distributed builds).

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

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

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

6 years agoRemove declaration of EmitMCountInstrumentation(). NFC
Hans Wennborg [Fri, 10 Nov 2017 22:34:23 +0000 (22:34 +0000)]
Remove declaration of EmitMCountInstrumentation(). NFC

The definition was removed in r280355.

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

6 years agoFix for skipped CMake configuration on debuginfo-tests.
Zachary Turner [Fri, 10 Nov 2017 22:12:04 +0000 (22:12 +0000)]
Fix for skipped CMake configuration on debuginfo-tests.

This should have been part of the change to debuginfo-tests, but
it was left out.  This should get the buildbots green.

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

6 years ago[debuginfo-tests] Make debuginfo-tests work in a standard configuration.
Zachary Turner [Fri, 10 Nov 2017 20:57:57 +0000 (20:57 +0000)]
[debuginfo-tests] Make debuginfo-tests work in a standard configuration.

Previously, debuginfo-tests was expected to be checked out into
clang/test and then the tests would automatically run as part of
check-clang.  This is not a standard workflow for handling
external projects, and it brings with it some serious drawbacks
such as the inability to depend on things other than clang, which
we will need going forward.

The goal of this patch is to migrate towards a more standard
workflow.  To ease the transition for build bot maintainers,
this patch tries not to break the existing workflow, but instead
simply deprecate it to give maintainers a chance to update
the build infrastructure.

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

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

6 years agoAMDGPU: Add -mxnack/-mno-xnack options that set +/-xnack feature
Konstantin Zhuravlyov [Fri, 10 Nov 2017 19:28:25 +0000 (19:28 +0000)]
AMDGPU: Add -mxnack/-mno-xnack options that set +/-xnack feature

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

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

6 years agoAMDGPU/NFC: Move getAMDGPUTargetFeatures to AMDGPU toolchain
Konstantin Zhuravlyov [Fri, 10 Nov 2017 19:09:57 +0000 (19:09 +0000)]
AMDGPU/NFC: Move getAMDGPUTargetFeatures to AMDGPU toolchain

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

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

6 years ago[clang-format] Handle leading comments in using declaration
Daniel Jasper [Fri, 10 Nov 2017 17:11:18 +0000 (17:11 +0000)]
[clang-format] Handle leading comments in using declaration

This fixes clang-format internal assertion for the following code:

  /* override */ using std::string;

Patch by Igor Sugak. Thank you.

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

6 years ago[NFC] Pacify bbot for OpenMP 'teams distribute parallel for'
Carlo Bertolli [Fri, 10 Nov 2017 16:49:09 +0000 (16:49 +0000)]
[NFC] Pacify bbot for OpenMP 'teams distribute parallel for'

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

6 years ago[python] [tests] Rewrite to use standard unittest module
Michal Gorny [Fri, 10 Nov 2017 16:44:12 +0000 (16:44 +0000)]
[python] [tests] Rewrite to use standard unittest module

Rewrite the tests from using plain 'assert' mixed with some nosetests
methods to the standard unittest module layout. Improve the code
to use the most canonical assertion methods whenever possible.

This has a few major advantages:

- the code uses standard methods now, resulting in a reduced number
of WTFs whenever someone with basic Python knowledge gets to read it,

- completely unnecessary dependency on nosetests is removed since
the standard library supplies all that is necessary for the tests
to run,

- the tests can be run via any test runner, including the one built-in
in Python,

- the failure output for most of the tests is improved from 'assertion
x == y failed' to actually telling the values.

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

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

6 years ago[OpenMP] Parse+Sema for copyin clause of 'teams distribute parallel for'
Carlo Bertolli [Fri, 10 Nov 2017 16:05:00 +0000 (16:05 +0000)]
[OpenMP] Parse+Sema for copyin clause of 'teams distribute parallel for'

https://reviews.llvm.org/D39902

Simply leverage existing implementation and verify correct functioning with two regression tests.

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

6 years ago[OpenMP] diagnose assign to firstprivate const, patch by Joel E. Denny
Alexey Bataev [Fri, 10 Nov 2017 15:39:50 +0000 (15:39 +0000)]
[OpenMP] diagnose assign to firstprivate const, patch by Joel E. Denny

Summary:
[OpenMP] diagnose assign to firstprivate const

Clang does not diagnose assignments to const variables declared
firstprivate.  Furthermore, codegen is broken such that, at run time,
such assignments simply have no effect.  For example, the following
prints 0 not 1:

int main() {
  const int i = 0;
  #pragma omp parallel firstprivate(i)
  { i=1; printf("%d\n", i); }
  return 0;
}

This commit makes these assignments a compile error, which is
consistent with other OpenMP compilers I've tried (pgcc 17.4-0, gcc
6.3.0).

Reviewers: ABataev

Reviewed By: ABataev

Subscribers: cfe-commits

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

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

6 years ago[clang-format] Support python-style comments in text protos
Krasimir Georgiev [Fri, 10 Nov 2017 12:50:09 +0000 (12:50 +0000)]
[clang-format] Support python-style comments in text protos

Summary: This patch adds support for python-style comments in text protos.

Reviewers: djasper

Reviewed By: djasper

Subscribers: bkramer, cfe-commits, klimek

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

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

6 years agoRevert "[XRay][darwin] Initial XRay in Darwin Support"
Dean Michael Berris [Fri, 10 Nov 2017 07:00:55 +0000 (07:00 +0000)]
Revert "[XRay][darwin] Initial XRay in Darwin Support"

This reverts r317875.

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

6 years ago[XRay][darwin] Initial XRay in Darwin Support
Dean Michael Berris [Fri, 10 Nov 2017 05:50:13 +0000 (05:50 +0000)]
[XRay][darwin] Initial XRay in Darwin Support

Summary:
This change implements the changes required in both clang and
compiler-rt to allow building XRay-instrumented binaries in Darwin. For
now we limit this to x86_64. We also start building the XRay runtime
library in compiler-rt for osx.

A caveat to this is that we don't have the tests set up and running
yet, which we'll do in a set of follow-on changes.

This patch uses the monorepo layout for the coordinated change across
multiple projects.

Reviewers: kubamracek

Subscribers: mgorny, cfe-commits, llvm-commits

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

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

6 years ago[X86] Reduce the number of FMA builtins needed by the frontend by adding negates...
Craig Topper [Fri, 10 Nov 2017 05:20:32 +0000 (05:20 +0000)]
[X86] Reduce the number of FMA builtins needed by the frontend by adding negates to operands of the fmadd and fmaddsub builtins.

The backend should be able to combine the negates to create fmsub, fnmadd, and fnmsub. faddsub converting to fsubadd still needs work I think, but should be very doable.

This matches what we already do for the masked builtins.

This only covers the packed builtins. Scalar builtins will be done after FMA4 is fixed.

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

6 years ago[Driver] Make clang/cc conforms to UNIX standard
Steven Wu [Fri, 10 Nov 2017 01:32:47 +0000 (01:32 +0000)]
[Driver] Make clang/cc conforms to UNIX standard

Summary:
This is basically reverting r261774 with a tweak for clang-cl. UNIX
standard states:
When c99 encounters a compilation error that causes an object file not
to be created, it shall write a diagnostic to standard error and
continue to compile other source code operands, but it shall not perform
the link phase and it shall return a non-zero exit status

The same goes for c89 or cc. And they are all alias or shims pointing to
clang on Darwin.

The original commit was intended for CUDA so the error message doesn't
get emit twice for both host and device. It seems that the clang driver
has been changed to model the CUDA dependency differently. Now the
driver behaves the same without this commit.

rdar://problem/32223263

Reviewers: thakis, dexonsmith, tra

Reviewed By: tra

Subscribers: jlebar, cfe-commits

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

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Fri, 10 Nov 2017 00:59:22 +0000 (00:59 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[analyzer] [NFC] Minor ExprEngineC refactoring
George Karpenkov [Thu, 9 Nov 2017 23:33:37 +0000 (23:33 +0000)]
[analyzer] [NFC] Minor ExprEngineC refactoring

Move a repeated block of code into a function.

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

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

6 years ago[analyzer] do not crash when trying to convert an APSInt to an unexpected type
George Karpenkov [Thu, 9 Nov 2017 21:49:38 +0000 (21:49 +0000)]
[analyzer] do not crash when trying to convert an APSInt to an unexpected type

This is the issue breaking the postgresql bot, purely by chance exposed
through taint checker, somehow appearing after
https://reviews.llvm.org/D38358 got committed.

The backstory is that the taint checker requests SVal for the value of
the pointer, and analyzer has a "fast path" in the getter to return a
constant when we know that the value is constant.
Unfortunately, the getter requires a cast to get signedness correctly,
and for the pointer `void *` the cast crashes.

This is more of a band-aid patch, as I am not sure what could be done
here "correctly", but it should be applied in any case to avoid the
crash.

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

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

6 years ago[index] tag declarations should use the decl role instead of ref
Alex Lorenz [Thu, 9 Nov 2017 20:50:59 +0000 (20:50 +0000)]
[index] tag declarations should use the decl role instead of ref

The 'decl' role is more canonical than the 'ref'. This helps us establish the
'specialization-of' relation just by looking at decls or defs.

rdar://31884960

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

6 years ago[python] [tests] Update priority values in code completion test
Michal Gorny [Thu, 9 Nov 2017 20:17:41 +0000 (20:17 +0000)]
[python] [tests] Update priority values in code completion test

The priority for destructors and operators was reduced in r314019.
Adjust the values used in the test appropriately to fix the test
failure.

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

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

6 years ago[analyzer] assume bitwise arithmetic axioms
George Karpenkov [Thu, 9 Nov 2017 19:06:22 +0000 (19:06 +0000)]
[analyzer] assume bitwise arithmetic axioms

Patches the solver to assume that bitwise OR of an unsigned value with a
constant always produces a value larger-or-equal than the constant, and
bitwise AND with a constant always produces a value less-or-equal than
the constant.

This patch is especially useful in the context of using bitwise
arithmetic for error code encoding: the analyzer would be able to state
that the error code produced using a bitwise OR is non-zero.

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

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

6 years ago[OPENMP] Codegen for `#pragma omp target parallel for simd`.
Alexey Bataev [Thu, 9 Nov 2017 17:32:15 +0000 (17:32 +0000)]
[OPENMP] Codegen for `#pragma omp target parallel for simd`.

Added codegen for `#pragma omp target parallel for simd` and clauses.

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

6 years ago[OPENMP] Treat '#pragma omp target parallel for simd' as simd directive.
Alexey Bataev [Thu, 9 Nov 2017 17:01:35 +0000 (17:01 +0000)]
[OPENMP] Treat '#pragma omp target parallel for simd' as simd directive.

`#pragma omp target parallel for simd` mistakenly was not treated as a
simd directive, fixed this problem.

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

6 years ago[VirtualFileSystem] InMemoryFileSystem::addFile(): Type and Perms
Ben Hamilton [Thu, 9 Nov 2017 16:01:16 +0000 (16:01 +0000)]
[VirtualFileSystem] InMemoryFileSystem::addFile(): Type and Perms

Summary:
This implements a FIXME in InMemoryFileSystem::addFile(), allowing
clients to specify User, Group, Type, and/or Perms when creating a
file in an in-memory filesystem.

New tests included. Ran tests with:

% ninja BasicTests && ./tools/clang/unittests/Basic/BasicTests

Fixes PR#35172 (https://bugs.llvm.org/show_bug.cgi?id=35172)

Reviewers: bkramer, hokein

Reviewed By: bkramer, hokein

Subscribers: alexfh

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

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

6 years ago[clang-format] Keep Sphinx happy after r317794
Krasimir Georgiev [Thu, 9 Nov 2017 15:54:59 +0000 (15:54 +0000)]
[clang-format] Keep Sphinx happy after r317794

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

6 years ago[clang-format] Sort using declarations by splitting on '::'
Krasimir Georgiev [Thu, 9 Nov 2017 15:41:23 +0000 (15:41 +0000)]
[clang-format] Sort using declarations by splitting on '::'

Summary: This patch improves using declarations sorting.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits, klimek

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

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

6 years ago[clang-format] Apply a clang-tidy suggestion, NFC
Krasimir Georgiev [Thu, 9 Nov 2017 15:12:17 +0000 (15:12 +0000)]
[clang-format] Apply a clang-tidy suggestion, NFC

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

6 years ago[clang-format] Fix a clang-tidy finding, NFC
Krasimir Georgiev [Thu, 9 Nov 2017 13:22:03 +0000 (13:22 +0000)]
[clang-format] Fix a clang-tidy finding, NFC

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

6 years ago[clang-format] Fix argument name comment, NFC
Krasimir Georgiev [Thu, 9 Nov 2017 13:19:14 +0000 (13:19 +0000)]
[clang-format] Fix argument name comment, NFC

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

6 years ago[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.
Sam McCall [Thu, 9 Nov 2017 10:37:39 +0000 (10:37 +0000)]
[Tooling] Use FixedCompilationDatabase when `compile_flags.txt` is found.

Summary:
This is an alternative to JSONCompilationDatabase for simple projects that
don't use a build system such as CMake.
(You can also drop one in ~, to make your tools use e.g. C++11 by default)

There's no facility for varying flags per-source-file or per-machine.
Possibly this could be accommodated backwards-compatibly using cpp, but even if
not the simplicity seems worthwhile for the cases that are addressed.

Tested with clangd, works great! (requires clangd restart)

Reviewers: klimek

Subscribers: ilya-biryukov, cfe-commits

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

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

6 years agoFix a bug with the use of __builtin_bzero in a conditional expression.
John McCall [Thu, 9 Nov 2017 09:32:32 +0000 (09:32 +0000)]
Fix a bug with the use of __builtin_bzero in a conditional expression.

Patch by Bharathi Seshadri!

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

6 years ago[X86] Rename the VEX scalar fma builtins to end with a '3' to match gcc
Craig Topper [Thu, 9 Nov 2017 04:10:46 +0000 (04:10 +0000)]
[X86] Rename the VEX scalar fma builtins to end with a '3' to match gcc

I think we need to use different builtins for the FMA4 instructions since those instructions zero the upper bits and FMA3 instructions pass the bits through.

So this moves the existing builtins to be the FMA3 versions. New versions will be added for FMA4.

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

6 years ago[Coverage] Emit deferred regions in headers
Vedant Kumar [Thu, 9 Nov 2017 02:33:40 +0000 (02:33 +0000)]
[Coverage] Emit deferred regions in headers

There are some limitations with emitting regions in macro expansions
because we don't gather file IDs within the expansions. Fix the check
that prevents us from emitting deferred regions in expansions to make an
exception for headers, which is something we can handle.

rdar://35373009

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

6 years ago[Coverage] Complete top-level deferred regions before labels
Vedant Kumar [Thu, 9 Nov 2017 02:33:39 +0000 (02:33 +0000)]
[Coverage] Complete top-level deferred regions before labels

The area immediately after a terminated region in the function top-level
should have the same count as the label it precedes.

This solves another problem with wrapped segments. Consider:

  1| a:
  2|   return 0;
  3| b:
  4|   return 1;

Without a gap area starting after the first return, the wrapped segment
from line 2 would make it look like line 3 is executed, when it's not.

rdar://35373009

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

6 years ago[Coverage] Emit a gap area after if conditions
Vedant Kumar [Thu, 9 Nov 2017 02:33:38 +0000 (02:33 +0000)]
[Coverage] Emit a gap area after if conditions

The area immediately after the closing right-paren of an if condition
should have a count equal to the 'then' block's count. Use a gap region
to set this count, so that region highlighting for the 'then' block
remains precise.

This solves a problem we have with wrapped segments. Consider:

  1| if (false)
  2|   foo();

Without a gap area starting after the condition, the wrapped segment
from line 1 would make it look like line 2 is executed, when it's not.

rdar://35373009

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

6 years agoRemove redundant copy-pasted comment in test file from r317736
Alex Lorenz [Wed, 8 Nov 2017 22:47:15 +0000 (22:47 +0000)]
Remove redundant copy-pasted comment in test file from r317736

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

6 years ago[ObjC] Fix function signature handling for blocks literals with attributes
Alex Lorenz [Wed, 8 Nov 2017 22:44:34 +0000 (22:44 +0000)]
[ObjC] Fix function signature handling for blocks literals with attributes

Block literals can have a type with attributes in its signature, e.g.
ns_returns_retained. The code that inspected the type loc of the block when
declaring its parameters didn't account for this fact, and only looked through
paren type loc. This commit ensures that getAsAdjusted is used instead of
IgnoreParens to find the block's FunctionProtoTypeLoc. This ensures that
block parameters are declared correctly in the block and avoids the
'undeclared identifier' error.

rdar://35416160

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

6 years ago[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return...
Alex Lorenz [Wed, 8 Nov 2017 21:33:15 +0000 (21:33 +0000)]
[ObjC] Boxed strings should use the nullability from stringWithUTF8String's return type

Objective-C NSString has a class method stringWithUTF8String that creates a new
NSString from a C string. Objective-C box expression @(...) can be used to
create an NSString instead of invoking the stringWithUTF8String method directly
(The compiler lowers it down to the invocation though). This commit ensures that
the type of @(string-value) gets the same nullability attributes as the return
type of stringWithUTF8String to ensure that the diagnostics are consistent
between the two.

rdar://33847186

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

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

6 years ago[OPENMP] Codegen for `#pragma omp target parallel for`.
Alexey Bataev [Wed, 8 Nov 2017 20:16:14 +0000 (20:16 +0000)]
[OPENMP] Codegen for `#pragma omp target parallel for`.

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

6 years agoAdd a missing "REQUIRES: system-windows" to a Windows-only test.
David L. Jones [Wed, 8 Nov 2017 20:03:11 +0000 (20:03 +0000)]
Add a missing "REQUIRES: system-windows" to a Windows-only test.

This un-breaks builds on other platforms. Otherwise, they fail due to warnings like:

warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]

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

6 years agoAdd CoreOption flag to "-coverage" option to make it available for clang-cl
Marco Castelluccio [Wed, 8 Nov 2017 19:21:54 +0000 (19:21 +0000)]
Add CoreOption flag to "-coverage" option to make it available for clang-cl

Summary:
The -coverage option is not a CoreOption, so it is not available to clang-cl.
This patch adds the CoreOption flag to "-coverage" to allow it to be used with clang-cl.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

6 years ago[bindings] fix TLS test failure
Masud Rahman [Wed, 8 Nov 2017 19:17:27 +0000 (19:17 +0000)]
[bindings] fix TLS test failure

Since cfe commit r237337, '__declspec(thread)' and 'thread_local' have
been the same since MSVC 2015.  i.e. they are both considered to supply
a dynamic TLS kind, not a static TLS kind.

This test originally did not specify which version of MS compatibility
to assume.  As a result, the test was brittle, since changing the
default compatibility version could break the test.

This commit adds a specific version when building up the flags used to
parse the translation unit, and tests both versions.

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

6 years ago[analyzer] Fix a crash on logical operators with vectors.
Artem Dergachev [Wed, 8 Nov 2017 17:27:58 +0000 (17:27 +0000)]
[analyzer] Fix a crash on logical operators with vectors.

Do not crash when trying to compute x && y or x || y where x and y are
of a vector type.

For now we do not seem to properly model operations with vectors. In particular,
operations && and || on a pair of vectors are not short-circuit, unlike regular
logical operators, so even our CFG is incorrect.

Avoid the crash, add respective FIXME tests for later.

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

rdar://problem/34317663

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

6 years ago[clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFC
Haojian Wu [Wed, 8 Nov 2017 14:53:08 +0000 (14:53 +0000)]
[clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFC

Summary:
The OccurrencesFinder is only used in RenameOccurrences to find symbol
occurrences, there is no need to inherit RefactoringRule.

Replace it with a single utility function to avoid code misleading.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

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

6 years agoWorkaround reverse-iteration buildbot breakages. Filed PR35244.
Ilya Biryukov [Wed, 8 Nov 2017 13:05:52 +0000 (13:05 +0000)]
Workaround reverse-iteration buildbot breakages. Filed PR35244.

Clang's completion output is non-deterministic, causing test failures
with turned on LLVM_REVERSE_ITERATION.
The workaround is to use CHECK-DAGs for now, will remove them when
PR35244 gets fixed.

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

6 years agoAvoid printing some redundant name qualifiers in completion
Ilya Biryukov [Wed, 8 Nov 2017 10:39:09 +0000 (10:39 +0000)]
Avoid printing some redundant name qualifiers in completion

Summary:
Adjusted PrintingPolicy inside code completion to avoid printing some
redundant name qualifiers.

Before this change, typedefs that were written unqualified in source
code were printed with qualifiers in completion. For example, in the
following code

    struct foo {
        typedef int type;
        type method();
    };

completion item for `method` had return type of `foo::type`, even
though the original code used `type` without qualifiers.
After this change, the completion item has return type `type`, as
originally written in the source code.

Note that this change does not suppress qualifiers written by the
user. For example, in the following code

    typedef int type;
    struct foo {
        typedef int type;
        ::type method(foo::type);
    };

completion item for `method` has return type of `::type` and
parameter type of `foo::type`, as originally written in the source
code.

Reviewers: arphaman, bkramer, klimek

Reviewed By: arphaman

Subscribers: mgorny, eraman, cfe-commits

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

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

6 years agoMoved QualTypeNames.h from Tooling to AST.
Ilya Biryukov [Wed, 8 Nov 2017 10:39:03 +0000 (10:39 +0000)]
Moved QualTypeNames.h from Tooling to AST.

Summary:
For code reuse in SemaCodeComplete.
Note that the tests for QualTypeNames are still in Tooling as they use
Tooling's common testing code.

Reviewers: rsmith, saugustine, rnk, klimek, bkramer

Reviewed By: rnk

Subscribers: cfe-commits, mgorny

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

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

6 years ago[clang-refactor] Introduce a new rename rule for qualified symbols
Haojian Wu [Wed, 8 Nov 2017 08:56:56 +0000 (08:56 +0000)]
[clang-refactor] Introduce a new rename rule for qualified symbols

Summary: Prototype of a new rename rule for renaming qualified symbol.

Reviewers: arphaman, ioeric, sammccall

Reviewed By: arphaman, sammccall

Subscribers: jklaehn, cfe-commits, klimek

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

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

6 years ago[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.
Craig Topper [Wed, 8 Nov 2017 04:54:26 +0000 (04:54 +0000)]
[X86] Add masked vcvtps2ph builtins to CheckX86BuiltinFunctionCall.

This ensures that only immediates that fit in 8-bits are used. This matches what we do for the unmasked versions.

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

6 years ago[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings;...
Eugene Zelenko [Wed, 8 Nov 2017 01:03:16 +0000 (01:03 +0000)]
[Serialization] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years ago[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 8 Nov 2017 00:39:18 +0000 (00:39 +0000)]
[AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

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

6 years agoChange noplt.c to work for non-x86 targets.
Sriraman Tallam [Tue, 7 Nov 2017 22:34:55 +0000 (22:34 +0000)]
Change noplt.c to work for non-x86 targets.

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

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

6 years ago[NVPTX] Implement __nvvm_atom_add_gen_d builtin.
Justin Lebar [Tue, 7 Nov 2017 22:10:54 +0000 (22:10 +0000)]
[NVPTX] Implement __nvvm_atom_add_gen_d builtin.

Summary:
This just seems to have been an oversight.  We already supported the f64
atomic add with an explicit scope (e.g. "cta"), but not the scopeless
version.

Reviewers: tra

Subscribers: jholewinski, sanjoy, cfe-commits, llvm-commits, hiraditya

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

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

6 years ago[ObjC++] Don't warn about pessimizing move for __block variables
Alex Lorenz [Tue, 7 Nov 2017 21:40:11 +0000 (21:40 +0000)]
[ObjC++] Don't warn about pessimizing move for __block variables

rdar://33316951

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

6 years agoUpdate SanitizerSpecialCaseList to use renamed functions in base class.
Mitch Phillips [Tue, 7 Nov 2017 21:16:37 +0000 (21:16 +0000)]
Update SanitizerSpecialCaseList to use renamed functions in base class.

Note: This change has a cyclical dependency on D39485. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Subscribers: llvm-commits

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

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

6 years agoNew clang option -fno-plt which avoids the PLT and lazy binding while making external...
Sriraman Tallam [Tue, 7 Nov 2017 19:37:51 +0000 (19:37 +0000)]
New clang option -fno-plt which avoids the PLT and lazy binding while making external calls.

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

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

6 years ago[refactor] rename field references in __builtin_offsetof
Alex Lorenz [Tue, 7 Nov 2017 18:30:23 +0000 (18:30 +0000)]
[refactor] rename field references in __builtin_offsetof

rdar://33875453

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

6 years agoClang/libomptarget map interface flag renaming - NFC patch
George Rokos [Tue, 7 Nov 2017 18:27:04 +0000 (18:27 +0000)]
Clang/libomptarget map interface flag renaming - NFC patch

This patch renames some of the flag names of the clang/libomptarget map interface. The old names are slightly misleading, whereas the new ones describe in a better way what each flag is about.

Only the macros within the enumeration are renamed, there is no change in functionality therefore there are no updated regression tests.

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

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

6 years ago[index] __builtin_offset's field reference is located at the end location
Alex Lorenz [Tue, 7 Nov 2017 18:25:36 +0000 (18:25 +0000)]
[index] __builtin_offset's field reference is located at the end location

The starting location is the location of the '.'

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

6 years ago[index] index field references in __builtin_offset
Alex Lorenz [Tue, 7 Nov 2017 17:29:11 +0000 (17:29 +0000)]
[index] index field references in __builtin_offset

rdar://35109556

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

6 years agoSystemZ Swift TargetInfo: swifterror support in the backend is broken
Arnold Schwaighofer [Tue, 7 Nov 2017 16:40:51 +0000 (16:40 +0000)]
SystemZ Swift TargetInfo: swifterror support in the backend is broken

Return false for swifterror support until the backend is fixed.

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