]> granicus.if.org Git - clang/log
clang
7 years ago[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2
Yaxun Liu [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2

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

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

7 years ago[CMake] Fixing typo in Info.plist generation
Chris Bieneman [Tue, 16 Aug 2016 20:49:49 +0000 (20:49 +0000)]
[CMake] Fixing typo in Info.plist generation

This is causing an error in the generation of the clang info plist.

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

7 years ago[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds
Chris Bieneman [Tue, 16 Aug 2016 20:44:58 +0000 (20:44 +0000)]
[CMake] [Apple Cache] Set CLANG_VENDOR_UTI for Apple builds

This is just a minor update to the Apple packaging configuration.

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

7 years agoTry to work around an MSVC 2013 bug around defaulted default ctors
Reid Kleckner [Tue, 16 Aug 2016 20:20:56 +0000 (20:20 +0000)]
Try to work around an MSVC 2013 bug around defaulted default ctors

An UnresolvedSetIterator() is supposed to be zeroed out, but MSVC 2013
does not do that.

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

7 years ago[ObjC] Warn on unguarded use of partial declaration
Erik Pilkington [Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)]
[ObjC] Warn on unguarded use of partial declaration

This commit adds a traversal of the AST after Sema of a function that diagnoses
unguarded references to declarations that are partially available (based on
availability attributes). This traversal is only done when we would otherwise
emit -Wpartial-availability.

This commit is part of a feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

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

7 years agoRevert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"
Reid Kleckner [Tue, 16 Aug 2016 16:04:14 +0000 (16:04 +0000)]
Revert "[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms"

This reverts commit r278783.  It breaks usage of _xgetbv on Windows.

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

7 years agoReduce the number of allocations required for AST attributes. In test cases, the...
Aaron Ballman [Tue, 16 Aug 2016 14:48:39 +0000 (14:48 +0000)]
Reduce the number of allocations required for AST attributes. In test cases, the max resident memory changed from 65760k to 64476k which is 1.9% improvement. Allocations in grow_pod changed from 8847 to 4872 according to tcmalloc heap profiler. Overall running time remained the same.

Patch by Eugene Kosov

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

7 years agoReorder stderr redirection in test command.
Samuel Antao [Tue, 16 Aug 2016 14:38:39 +0000 (14:38 +0000)]
Reorder stderr redirection in test command.

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

7 years agoAdd empty --gcc-toolchain empty to cuda-detect test.
Samuel Antao [Tue, 16 Aug 2016 14:31:39 +0000 (14:31 +0000)]
Add empty --gcc-toolchain empty to cuda-detect test.

Unless we overload the default gcc toolchain with an empty string
the system root used in the tests will be ignored if the user builds
clang  with a custom gcc toolchain.

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

7 years agoLeft shifts of negative values are defined if -fwrapv is set
James Molloy [Tue, 16 Aug 2016 09:45:36 +0000 (09:45 +0000)]
Left shifts of negative values are defined if -fwrapv is set

This means we shouldn't emit ubsan detection code or warn.
Fixes PR25552.

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

7 years ago[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms
Marina Yatsina [Tue, 16 Aug 2016 08:13:36 +0000 (08:13 +0000)]
[X86] Add xgetbv/x[X86] Add xgetbv xsetbv intrinsics to non-windows platforms

commit on behalf of guyblank

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

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

7 years ago[CUDA] Fix "declared here" note on deferred wrong-side errors.
Justin Lebar [Tue, 16 Aug 2016 00:48:21 +0000 (00:48 +0000)]
[CUDA] Fix "declared here" note on deferred wrong-side errors.

Previously we weren't deferring these "declared here" notes, which is
obviously wrong.

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

7 years agoPR28978: If we need overload resolution for the move constructor of an
Richard Smith [Tue, 16 Aug 2016 00:13:47 +0000 (00:13 +0000)]
PR28978: If we need overload resolution for the move constructor of an
anonymous union member of a class, we need overload resolution for the move
constructor of the class itself too; we can't rely on Sema to do the right
thing for us for anonymous union types.

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

7 years ago[CUDA] Raise an error if a wrong-side call is codegen'ed.
Justin Lebar [Mon, 15 Aug 2016 23:00:49 +0000 (23:00 +0000)]
[CUDA] Raise an error if a wrong-side call is codegen'ed.

Summary:
Some function calls in CUDA are allowed to appear in
semantically-correct programs but are an error if they're ever
codegen'ed.  Specifically, a host+device function may call a host
function, but it's an error if such a function is ever codegen'ed in
device mode (and vice versa).

Previously, clang made no attempt to catch these errors.  For the most
part, they would be caught by ptxas, and reported as "call to unknown
function 'foo'".

Now we catch these errors and report them the same as we report other
illegal calls (e.g. a call from a host function to a device function).

This has a small change in error-message behavior for calls that were
previously disallowed (e.g. calls from a host to a device function).
Previously, we'd catch disallowed calls fairly early, before doing
additional semantic checking e.g. of the call's arguments.  Now we catch
these illegal calls at the very end of our semantic checks, so we'll
only emit a "illegal CUDA call" error if the call is otherwise
well-formed.

Reviewers: tra, rnk

Subscribers: cfe-commits

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

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

7 years ago[ADT] Change PostOrderIterator to use NodeRef. NFC.
Tim Shen [Mon, 15 Aug 2016 21:27:56 +0000 (21:27 +0000)]
[ADT] Change PostOrderIterator to use NodeRef. NFC.

Summary: Corresponding LLVM change: D23522

Reviewers: dblaikie

Subscribers: cfe-commits

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

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

7 years agoObjective-C diagnostics: isObjCNSObjectType should check through AttributedType.
Manman Ren [Mon, 15 Aug 2016 21:05:00 +0000 (21:05 +0000)]
Objective-C diagnostics: isObjCNSObjectType should check through AttributedType.

For the following example:
typedef __attribute__((NSObject)) CGColorRef ColorAttrRef;
@property (strong, nullable) ColorAttrRef color;
The property type should be ObjC NSObject type and the compiler should not emit
error: property with 'retain (or strong)' attribute must be of object type

rdar://problem/27747154

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

7 years agoAdd the notion of deferred diagnostics.
Justin Lebar [Mon, 15 Aug 2016 20:38:56 +0000 (20:38 +0000)]
Add the notion of deferred diagnostics.

Summary:
This patch lets you create diagnostics that are emitted if and only if a
particular FunctionDecl is codegen'ed.

This is necessary for CUDA, where some constructs -- e.g. calls from
host+device functions to host functions when compiling for device -- are
allowed to appear in semantically-correct programs, but only if they're
never codegen'ed.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

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

7 years ago[CUDA] Include CUDA headers before anything else.
Justin Lebar [Mon, 15 Aug 2016 20:38:52 +0000 (20:38 +0000)]
[CUDA] Include CUDA headers before anything else.

Summary:
There's no point to --cuda-path if we then go and include /usr/include
first.  And if you install the right packages, Ubuntu will install (very
old) CUDA headers there.

Reviewers: tra

Subscribers: cfe-commits, Prazek

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

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

7 years ago[CUDA] Fix CUDA install version parsing.
Justin Lebar [Mon, 15 Aug 2016 20:38:48 +0000 (20:38 +0000)]
[CUDA] Fix CUDA install version parsing.

Summary:
getAsInteger returns true on error.  Oops.

No test because the behavior at the moment is identical with or without
this change.

Reviewers: tra

Subscribers: cfe-commits, Prazek

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

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

7 years agoStaticAnalyzer: Report found fields order in PaddingChecker
Saleem Abdulrasool [Mon, 15 Aug 2016 20:16:13 +0000 (20:16 +0000)]
StaticAnalyzer: Report found fields order in PaddingChecker

Report the found fields order in PaddingChecker.

Patch by Alexander Shaposhnikov!

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

7 years ago[CMake] Apple stage1 doesn't need to set libcxx options
Chris Bieneman [Mon, 15 Aug 2016 20:15:22 +0000 (20:15 +0000)]
[CMake] Apple stage1 doesn't need to set libcxx options

LibCXX settings are configured in stage2 so we don't need them here.

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

7 years agoReplace an obsolete company name.
Paul Robinson [Mon, 15 Aug 2016 18:45:52 +0000 (18:45 +0000)]
Replace an obsolete company name.

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

7 years ago[CodeGen] Ignore unnamed bitfields before handling vector fields
David Majnemer [Mon, 15 Aug 2016 07:20:40 +0000 (07:20 +0000)]
[CodeGen] Ignore unnamed bitfields before handling vector fields

We processed unnamed bitfields after our logic for non-vector field
elements in records larger than 128 bits.  The vector logic would
determine that the bit-field disqualifies the record from occupying a
register despite the unnamed bit-field not participating in the record
size nor its alignment.

N.B. This behavior matches GCC and ICC.

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

7 years ago[CodeGen] Correctly implement the AVX512 psABI rules
David Majnemer [Mon, 15 Aug 2016 06:39:18 +0000 (06:39 +0000)]
[CodeGen] Correctly implement the AVX512 psABI rules

An __m512 vector type wrapped in a structure should be passed in a
vector register.

Our prior implementation was based on a draft version of the psABI.

This fixes PR28975.

N.B. The update to the ABI was made here:
https://github.com/hjl-tools/x86-psABI/commit/30f9c9

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

7 years agocxx_status: update features implemented in clang 3.9 from "svn" to "Clang 3.9" now...
Richard Smith [Mon, 15 Aug 2016 02:47:23 +0000 (02:47 +0000)]
cxx_status: update features implemented in clang 3.9 from "svn" to "Clang 3.9" now that svn trunk is 4.0.

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

7 years agocxx_status: mark decomposition declarations as "partial": the implementation is
Richard Smith [Mon, 15 Aug 2016 02:37:43 +0000 (02:37 +0000)]
cxx_status: mark decomposition declarations as "partial": the implementation is
essentially complete, other than parts where design questions have been raised
(lambda capture, decomposition of arrays by copy).

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

7 years agoDisable lambda-capture of decomposition declaration bindings for now, until CWG
Richard Smith [Mon, 15 Aug 2016 02:34:23 +0000 (02:34 +0000)]
Disable lambda-capture of decomposition declaration bindings for now, until CWG
agrees on how they're supposed to work.

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

7 years agoAdd a triple to this test to make buildbots happier.
Richard Smith [Mon, 15 Aug 2016 02:24:00 +0000 (02:24 +0000)]
Add a triple to this test to make buildbots happier.

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

7 years agoP0217R3: code generation support for decomposition declarations.
Richard Smith [Mon, 15 Aug 2016 01:33:41 +0000 (01:33 +0000)]
P0217R3: code generation support for decomposition declarations.

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

7 years agoExplicitly generate a reference variable to hold the initializer for a
Richard Smith [Sun, 14 Aug 2016 23:15:52 +0000 (23:15 +0000)]
Explicitly generate a reference variable to hold the initializer for a
tuple-like decomposition declaration. This significantly simplifies the
semantics of BindingDecls for AST consumers (they can now always be evalated
at the point of use).

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

7 years agoFix build broken after llvm/ADT/DenseMap.h replacement of climits with limits.
Eugene Zelenko [Sat, 13 Aug 2016 01:05:35 +0000 (01:05 +0000)]
Fix build broken after llvm/ADT/DenseMap.h replacement of climits with limits.

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

7 years ago[CUDA] Place GPU binary into .nv_fatbin section and align it by 8.
Artem Belevich [Fri, 12 Aug 2016 18:44:01 +0000 (18:44 +0000)]
[CUDA] Place GPU binary into .nv_fatbin section and align it by 8.

This matches the way nvcc encapsulates GPU binaries into host object file.
Now cuobjdump can deal with clang-compiled object files.

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

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

7 years agoReapply [VFS] Skip non existent files from the VFS tree
Bruno Cardoso Lopes [Fri, 12 Aug 2016 18:18:24 +0000 (18:18 +0000)]
Reapply [VFS] Skip non existent files from the VFS tree

Reapply r278457 with test fixed to not abouse fs case sensitivity.

When the VFS uses a YAML file, the real file path for a
virtual file is described in the "external-contents" field. Example:

  ...
  {
     'type': 'file',
     'name': 'a.h',
     'external-contents': '/a/b/c/a.h'
  }

Currently, when parsing umbrella directories, we use
vfs::recursive_directory_iterator to gather the header files to generate the
equivalent modules for. If the external contents for a header does not exist,
we currently are unable to build a module, since the VFS
vfs::recursive_directory_iterator will fail when it finds an entry without a
reliable real path.

Since the YAML file could be prepared ahead of time and shared among
different compiler invocations, an entry might not yet have a reliable
path in 'external-contents', breaking the iteration.

Give the VFS the capability to skip such entries whenever
'ignore-non-existent-contents' property is set in the YAML file.

rdar://problem/27531549

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

7 years agoCodeGen: Replace ThinLTO backend implementation with a client of LTO/Resolution.
Teresa Johnson [Fri, 12 Aug 2016 18:12:08 +0000 (18:12 +0000)]
CodeGen: Replace ThinLTO backend implementation with a client of LTO/Resolution.

Summary:
This changes clang to use the llvm::lto::thinBackend function instead of
its own less comprehensive ThinLTO backend implementation.

Patch by Peter Collingbourne

Reviewers: tejohnson, mehdi_amini

Subscribers: cfe-commits, mehdi_amini

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

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

7 years ago[Driver] Set the default driver mode based on the executable.
Zachary Turner [Fri, 12 Aug 2016 17:47:52 +0000 (17:47 +0000)]
[Driver] Set the default driver mode based on the executable.

Currently, if --driver-mode is not passed at all, it will default
to GCC style driver.  This is never an issue for clang because
it manually constructs a --driver-mode option and passes it.

However, we should still try to do as good as we can even if no
--driver-mode is passed.  LibTooling, for example, does not pass
a --driver-mode option and while it could, it seems like we should
still fallback to the best possible default we can.

This is one of two steps necessary to get clang-tidy working on Windows.

Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D23454

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

7 years agoRevert test commit
Alexander Droste [Fri, 12 Aug 2016 17:46:23 +0000 (17:46 +0000)]
Revert test commit

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

7 years agoTest commit - first LLVM repo commit
Alexander Droste [Fri, 12 Aug 2016 17:43:58 +0000 (17:43 +0000)]
Test commit - first LLVM repo commit

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

7 years agoBugReporter: Use ilist_half_embedded_sentinel_traits, NFC
Duncan P. N. Exon Smith [Fri, 12 Aug 2016 16:46:25 +0000 (16:46 +0000)]
BugReporter: Use ilist_half_embedded_sentinel_traits, NFC

This avoids duplicated code with llvm/ADT/ilist.h.  No functionality
change.

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

7 years ago[ASTMatchers] Add templateTypeParmDecl() to Registry.cpp
Martin Bohme [Fri, 12 Aug 2016 13:51:00 +0000 (13:51 +0000)]
[ASTMatchers] Add templateTypeParmDecl() to Registry.cpp

Summary:
This appears to have been forgotten when templateTypeParmDecl() was initially
added.

Reviewers: alexfh, aaron.ballman

Subscribers: aaron.ballman, klimek, aemerson, rengolin, samparker, cfe-commits

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

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

7 years agoFix Wdocumentation unknown parameter warning
Simon Pilgrim [Fri, 12 Aug 2016 11:43:57 +0000 (11:43 +0000)]
Fix Wdocumentation unknown parameter warning

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

7 years agoFix For pr28288 - Error message in shift of vector values
Andrey Bokhanko [Fri, 12 Aug 2016 11:22:12 +0000 (11:22 +0000)]
Fix For pr28288 - Error message in shift of vector values

This fixes an error in type checking of shift of vector values.

Patch by Vladimir Yakovlev.

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

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

7 years agoFix cuda-detect.cu when CLANG_DEFAULT_CXX_STDLIB is set
Jonas Hahnfeld [Fri, 12 Aug 2016 10:36:04 +0000 (10:36 +0000)]
Fix cuda-detect.cu when CLANG_DEFAULT_CXX_STDLIB is set

Reported by Ismail Donmez!

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

7 years agoPrune unused diagnostics. NFC.
Benjamin Kramer [Fri, 12 Aug 2016 09:23:14 +0000 (09:23 +0000)]
Prune unused diagnostics. NFC.

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

7 years ago[C++1z] Fix crash when decomposing structs with anonymous members.
Benjamin Kramer [Fri, 12 Aug 2016 09:19:34 +0000 (09:19 +0000)]
[C++1z] Fix crash when decomposing structs with anonymous members.

The diagnostic format was invalid.

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

7 years agoThis patch implements PR#22821.
Roger Ferrer Ibanez [Fri, 12 Aug 2016 08:04:13 +0000 (08:04 +0000)]
This patch implements PR#22821.

Taking the address of a packed member is dangerous since the reduced
alignment of the pointee is lost. This can lead to memory alignment
faults in some architectures if the pointer value is dereferenced.

This change adds a new warning to clang emitted when taking the address
of a packed member. A packed member is either a field/data member
declared as attribute((packed)) or belonging to a struct/class
declared as such. The associated flag is -Waddress-of-packed-member.
Conversions (either implicit or via a valid casting) to pointer types
with lower or equal alignment requirements (e.g. void* or char*)
will silence the warning.

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

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

7 years ago[Sema] Fix the wording of a comment. NFC.
George Burgess IV [Fri, 12 Aug 2016 04:19:35 +0000 (04:19 +0000)]
[Sema] Fix the wording of a comment. NFC.

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

7 years ago[Sema] Fix a crash on variadic enable_if functions.
George Burgess IV [Fri, 12 Aug 2016 04:12:31 +0000 (04:12 +0000)]
[Sema] Fix a crash on variadic enable_if functions.

Currently, when trying to evaluate an enable_if condition, we try to
evaluate all arguments a user passes to a function. Given that we can't
use variadic arguments from said condition anyway, not converting them
is a reasonable thing to do. So, this patch makes us ignore any varargs
when attempting to check an enable_if condition.

We'd crash because, in order to convert an argument, we need its
ParmVarDecl. Variadic arguments don't have ParmVarDecls.

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

7 years agoP0217R3: serialization/deserialization support for c++17 decomposition declarations.
Richard Smith [Fri, 12 Aug 2016 02:21:25 +0000 (02:21 +0000)]
P0217R3: serialization/deserialization support for c++17 decomposition declarations.

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

7 years agoRevert "[VFS] Skip non existent files from the VFS tree"
Bruno Cardoso Lopes [Fri, 12 Aug 2016 02:17:26 +0000 (02:17 +0000)]
Revert "[VFS] Skip non existent files from the VFS tree"

Breaking bots:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/27281/

This reverts commit r278457.

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

7 years agoP0217R3: template instantiation support for decomposition declarations.
Richard Smith [Fri, 12 Aug 2016 01:55:21 +0000 (01:55 +0000)]
P0217R3: template instantiation support for decomposition declarations.

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

7 years ago[VFS] Skip non existent files from the VFS tree
Bruno Cardoso Lopes [Fri, 12 Aug 2016 01:51:04 +0000 (01:51 +0000)]
[VFS] Skip non existent files from the VFS tree

When the VFS uses a YAML file, the real file path for a
virtual file is described in the "external-contents" field. Example:

  ...
  {
     'type': 'file',
     'name': 'a.h',
     'external-contents': '/a/b/c/a.h'
  }

Currently, when parsing umbrella directories, we use
vfs::recursive_directory_iterator to gather the header files to generate the
equivalent modules for. If the external contents for a header does not exist,
we currently are unable to build a module, since the VFS
vfs::recursive_directory_iterator will fail when it finds an entry without a
reliable real path.

Since the YAML file could be prepared ahead of time and shared among
different compiler invocations, an entry might not yet have a reliable
path in 'external-contents', breaking the iteration.

Give the VFS the capability to skip such entries whenever
'ignore-non-existent-contents' property is set in the YAML file.

rdar://problem/27531549

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

7 years ago[VFS] Add 'ignore-non-existent-contents' field to YAML files
Bruno Cardoso Lopes [Fri, 12 Aug 2016 01:50:53 +0000 (01:50 +0000)]
[VFS] Add 'ignore-non-existent-contents' field to YAML files

Add 'ignore-non-existent-contents' to tell the VFS whether an invalid path
obtained via 'external-contents' should cause iteration on the VFS to stop.

If 'true', the VFS should ignore the entry and continue with the next. Allows
YAML files to be shared across multiple compiler invocations regardless of
prior existent paths in 'external-contents'. This global value is overridable
on a per-file basis.

This adds the parsing and write test part, but use by VFS comes next.

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

rdar://problem/27531549

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

7 years agoRemove unused and undesirable reference from BindingDecl to DecompositionDecl.
Richard Smith [Fri, 12 Aug 2016 00:53:41 +0000 (00:53 +0000)]
Remove unused and undesirable reference from BindingDecl to DecompositionDecl.

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

7 years agoP0217R3: Constant expression evaluation for decomposition declarations.
Richard Smith [Fri, 12 Aug 2016 00:39:32 +0000 (00:39 +0000)]
P0217R3: Constant expression evaluation for decomposition declarations.

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

7 years ago[Basic] Add const qualifier to SM.isInSystemMacro (NFC)
Vedant Kumar [Fri, 12 Aug 2016 00:20:39 +0000 (00:20 +0000)]
[Basic] Add const qualifier to SM.isInSystemMacro (NFC)

The member function is a predicate, and doesn't apply any changes on the
object.

Patch by Visoiu Mistrih Francis!

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

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

7 years agoP0217R3: Perform semantic checks and initialization for the bindings in a
Richard Smith [Thu, 11 Aug 2016 22:25:46 +0000 (22:25 +0000)]
P0217R3: Perform semantic checks and initialization for the bindings in a
decomposition declaration for arrays, aggregate-like structs, tuple-like
types, and (as an extension) for complex and vector types.

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

7 years agoDon't enable PIE on i686-unknown-cloudabi.
Ed Schouten [Thu, 11 Aug 2016 20:03:22 +0000 (20:03 +0000)]
Don't enable PIE on i686-unknown-cloudabi.

We're only going to provide support for using PIE on architectures that
provide PC-relative addressing. i686 is not one of those, so add the
necessary bits for only passing in -pie -zrelro conditionally.

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

7 years agoPass in frame pointer omitting compiler flags for CloudABI as well.
Ed Schouten [Thu, 11 Aug 2016 19:23:30 +0000 (19:23 +0000)]
Pass in frame pointer omitting compiler flags for CloudABI as well.

On Linux we pass in -fomit-frame-pointer flags (and similar)
automatically if optimization is enabled. Let's do the same thing on
CloudABI. Without this, Clang seems to run out of registers quite
quickly while trying to build code with inline assembly.

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

7 years ago[analyzer] Teach RetainCountChecker about CVFooRetain
Devin Coughlin [Thu, 11 Aug 2016 18:41:29 +0000 (18:41 +0000)]
[analyzer] Teach RetainCountChecker about CVFooRetain

Change the retain count checker to treat CoreFoundation-style "CV"-prefixed
reference types from CoreVideo similarly to CoreGraphics types. With this
change, we treat CVFooRetain() on a CVFooRef type as a retain. CVFooRelease()
APIs are annotated as consuming their parameter, so this change prevents false
positives about incorrect decrements of reference counts.

<rdar://problem/27116090>

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

7 years ago[Sema] Add more strict check for sizeof diagnostics for bzero
Bruno Cardoso Lopes [Thu, 11 Aug 2016 18:33:15 +0000 (18:33 +0000)]
[Sema] Add more strict check for sizeof diagnostics for bzero

Follow-up from r278264 after Joerg's feedback.

Since bzero is not standard, be more strict: also check if the first
argument is a pointer, which harden the check for when it does not come
originally from a builtin.

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

7 years agobindings: expose diagnostic formatting to Python
Saleem Abdulrasool [Thu, 11 Aug 2016 05:31:07 +0000 (05:31 +0000)]
bindings: expose diagnostic formatting to Python

This makes it easier for tools using the Python libclang bindings to display
diagnostics in a manner consistent with clang.

Patch by Omar Sandoval!

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

7 years ago[Order Files] Don't use empty order files
Chris Bieneman [Thu, 11 Aug 2016 00:19:51 +0000 (00:19 +0000)]
[Order Files] Don't use empty order files

LD64 does optimization on symbol layouts that gets disabled whenever an order file is passed (even if it is empty). This change prevents disabling that optimization, and still enables iterative generation and usage of order files.

If the order file is empty it does not setup the order file flags, instead it sets the empty order file as a configuration dependency. When the order file changes it will then trigger a re-configuration that adds the linker flag.

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

7 years agoReapply [Sema] Add sizeof diagnostics for bzero
Bruno Cardoso Lopes [Wed, 10 Aug 2016 18:34:47 +0000 (18:34 +0000)]
Reapply [Sema] Add sizeof diagnostics for bzero

Reapply r277787. For memset (and others) we can get diagnostics like:

  struct stat { int x; };
  void foo(struct stat *stamps) {
    bzero(stamps, sizeof(stamps));
    memset(stamps, 0, sizeof(stamps));
  }

  t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess]
    memset(stamps, 0, sizeof(stamps));
           ~~~~~~            ^~~~~~
  t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
    memset(stamps, 0, sizeof(stamps));
                             ^~~~~~

This patch implements the same class of warnings for bzero.

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

rdar://problem/18963514

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

7 years ago[analyzer] Fix a crash in CloneDetector when calling functions by pointers.
Artem Dergachev [Wed, 10 Aug 2016 16:25:16 +0000 (16:25 +0000)]
[analyzer] Fix a crash in CloneDetector when calling functions by pointers.

CallExpr may have a null direct callee when the callee function is not
known in compile-time. Do not try to take callee name in this case.

Patch by Raphael Isemann!

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

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

7 years ago[OpenCL] Fix typo in test that I accidentally introduced in my previous commit.
Joey Gouly [Wed, 10 Aug 2016 16:04:14 +0000 (16:04 +0000)]
[OpenCL] Fix typo in test that I accidentally introduced in my previous commit.

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

7 years ago[OpenCL] Change block descriptor address space to constant.
Joey Gouly [Wed, 10 Aug 2016 15:57:02 +0000 (15:57 +0000)]
[OpenCL] Change block descriptor address space to constant.

The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be
in the private address space.

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

7 years ago[ASTMatchers] Extend documentation for match()
Martin Bohme [Wed, 10 Aug 2016 11:22:57 +0000 (11:22 +0000)]
[ASTMatchers] Extend documentation for match()

Summary:
Adds an explanation of how to use findAll() to find all matches in a subtree.

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

7 years ago[X86][AVX512] lower __mm512_andnot_ps/__mm512_andnot_pd to IR
Lama Saba [Wed, 10 Aug 2016 10:34:45 +0000 (10:34 +0000)]
[X86][AVX512] lower __mm512_andnot_ps/__mm512_andnot_pd to IR
Differential revision: https://reviews.llvm.org/D23262

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

7 years ago[X86][AVX] Ensure we only match against 1-byte alignment
Simon Pilgrim [Wed, 10 Aug 2016 09:59:49 +0000 (09:59 +0000)]
[X86][AVX] Ensure we only match against 1-byte alignment

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

7 years agoMake clang-format remove duplicate headers when sorting #includes.
Eric Liu [Wed, 10 Aug 2016 09:32:23 +0000 (09:32 +0000)]
Make clang-format remove duplicate headers when sorting #includes.

Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[x86] Fix a really nasty bug introduced in r276417 where alignment
Chandler Carruth [Wed, 10 Aug 2016 07:32:47 +0000 (07:32 +0000)]
[x86] Fix a really nasty bug introduced in r276417 where alignment
constraints were added to _mm256_broadcast_{pd,ps} intel intrinsics.

The spec for these intrinics is ... pretty much silent on alignment.
This is especially frustrating considering the amount of discussion of
alignment in the load and store instrinsics. So I was forced to rely on
the specification for the VBROADCASTF128 instruction.

That instruction's spec is *also* completely silent on alignment.
Fortunately, when it comes to the instruction's spec, silence is enough.
There is no #GP fault option for an underaligned address so this
instruction, and by inference the intrinsic, can read any alignment.

As it happens, the old code worked exactly this way and in fact we have
plenty of code that hands pointers with less than 16-byte alignment to
these intrinsics. This code broke pretty spectacularly with this commit.

Fortunately, the fix is super simple! Change a 16 to a 1, and ta da!

Anyways, a lot of debugging for a really boring fix. =]

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

7 years ago[CUDA] Reject calls to __device__ functions from host variable global initializers.
Justin Lebar [Wed, 10 Aug 2016 01:09:21 +0000 (01:09 +0000)]
[CUDA] Reject calls to __device__ functions from host variable global initializers.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Print a "previous-decl" note when calling an illegal member fn.
Justin Lebar [Wed, 10 Aug 2016 01:09:18 +0000 (01:09 +0000)]
[CUDA] Print a "previous-decl" note when calling an illegal member fn.

Summary:
When we emit err_ref_bad_target, we should emit a "'method' declared
here" note.  We already do so in most places, just not in
BuildCallToMemberFunction.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Add __device__ overloads for placement new and delete.
Justin Lebar [Wed, 10 Aug 2016 01:09:14 +0000 (01:09 +0000)]
[CUDA] Add __device__ overloads for placement new and delete.

Summary:
Previously these sort of worked because they didn't end up resulting in
calls at the ptx layer.  But I'm adding stricter checks that break
placement new without these changes.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC
Justin Lebar [Wed, 10 Aug 2016 01:09:11 +0000 (01:09 +0000)]
[CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC

Summary:
I want to reuse "CheckCUDAFoo" in a later patch.  Also, I think
IsAllowedCUDACall gets the point across more clearly.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[Diag] Fix idiom in comment: "on the lam", not "on the lamb".
Justin Lebar [Wed, 10 Aug 2016 01:09:07 +0000 (01:09 +0000)]
[Diag] Fix idiom in comment: "on the lam", not "on the lamb".

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

7 years ago[CUDA] Fix out-of-date comment.
Justin Lebar [Wed, 10 Aug 2016 00:40:46 +0000 (00:40 +0000)]
[CUDA] Fix out-of-date comment.

LangOpts.CUDADisableTargetCallChecks no longer exists (it's effectively
always true now).

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

7 years ago[CUDA] Minor comment nits.
Justin Lebar [Wed, 10 Aug 2016 00:40:43 +0000 (00:40 +0000)]
[CUDA] Minor comment nits.

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

7 years ago[ADT] Change iterator_adaptor_base's default template arguments to forward more under...
Tim Shen [Tue, 9 Aug 2016 20:22:55 +0000 (20:22 +0000)]
[ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs

Summary:
The corresponding LLVM change: D23217.

LazyVector::iterator breaks, because int isn't an iterator type.
Since iterator_adaptor_base shouldn't be blamed to break at the call to
iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator.

The perfect solution is to model "relative pointer", but it's beyond the goal of this patch.

Reviewers: chandlerc, bkramer

Subscribers: cfe-commits

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

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

7 years ago[OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrt
Yaxun Liu [Tue, 9 Aug 2016 20:10:18 +0000 (20:10 +0000)]
[OpenCL] Handle -cl-fp32-correctly-rounded-divide-sqrt

Let the driver pass the option to frontend. Do not set precision metadata for division instructions when this option is set. Set function attribute "correctly-rounded-divide-sqrt-fp-math" based on this option.

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

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

7 years ago[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero
Yaxun Liu [Tue, 9 Aug 2016 19:43:38 +0000 (19:43 +0000)]
[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero

Adjust target features for amdgcn target when -cl-denorms-are-zero is set.

Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them.

A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option.

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

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

7 years agoAdd a missing -no-canonical-prefixes.
Benjamin Kramer [Tue, 9 Aug 2016 19:20:25 +0000 (19:20 +0000)]
Add a missing -no-canonical-prefixes.

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

7 years ago[CUDA] Regression test to make sure C++ include path are forwarded to host and device...
Samuel Antao [Tue, 9 Aug 2016 17:27:24 +0000 (17:27 +0000)]
[CUDA] Regression test to make sure C++ include path are forwarded to host and device frontends.

Summary: Add test to detect the C++ include paths are passed to both CUDA host and device frontends.

Reviewers: tra

Subscribers: cfe-commits

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

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

7 years ago[clang-cl] Make -gline-tables-only imply -gcodeview
Reid Kleckner [Tue, 9 Aug 2016 17:23:56 +0000 (17:23 +0000)]
[clang-cl] Make -gline-tables-only imply -gcodeview

It's surprising that you have to pass /Z7 in addition to -gcodeview to
get debug info. The sanitizer runtime, for example, expects that if the
compiler supports the -gline-tables-only flag, then it will emit debug
info.

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

7 years ago[ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()
Martin Bohme [Tue, 9 Aug 2016 15:07:52 +0000 (15:07 +0000)]
[ASTMatchers] Add matchers canReferToDecl() and hasUnderlyingDecl()

Summary: Required for D22220

Reviewers: sbenza, klimek, aaron.ballman, alexfh

Subscribers: alexfh, klimek, cfe-commits

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

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

7 years agoclang-format: Add SpaceAfterTemplate
Sylvestre Ledru [Tue, 9 Aug 2016 14:24:40 +0000 (14:24 +0000)]
clang-format: Add SpaceAfterTemplate

Summary:
This is required for compliance with the Mozilla style guide.

This is a rebase+minor change of Birunthan Mohanathas's patch

Reviewers: djasper

Subscribers: klimek, cfe-commits, opilarium

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

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

7 years ago[analyzer] Try to fix coverity CID 1360469.
Vassil Vassilev [Tue, 9 Aug 2016 10:00:23 +0000 (10:00 +0000)]
[analyzer] Try to fix coverity CID 1360469.

Patch by Raphael Isemann!

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

7 years agoRevert "[Attr] Add support for the `ms_hook_prologue` attribute."
Charles Davis [Mon, 8 Aug 2016 21:19:08 +0000 (21:19 +0000)]
Revert "[Attr] Add support for the `ms_hook_prologue` attribute."

This reverts commit r278050. It depends on r278048, which will be
reverted.

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

7 years ago[Driver] Enable CFI for WebAssembly
Derek Schuff [Mon, 8 Aug 2016 21:14:15 +0000 (21:14 +0000)]
[Driver] Enable CFI for WebAssembly

Since CFI support has landed in the WebAssembly backend, enable it in
the frontend driver.

Patch by Dominic Chen

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

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

7 years ago[Attr] Add support for the `ms_hook_prologue` attribute.
Charles Davis [Mon, 8 Aug 2016 21:03:39 +0000 (21:03 +0000)]
[Attr] Add support for the `ms_hook_prologue` attribute.

Summary:
Based on a patch by Michael Mueller.

This attribute specifies that a function can be hooked or patched. This
mechanism was originally devised by Microsoft for hotpatching their
binaries (which they're constantly updating to stay ahead of crackers,
script kiddies, and other ne'er-do-wells on the Internet), but it's now
commonly abused by Windows programs that want to hook API functions. It
is for this reason that this attribute was added to GCC--hence the name,
`ms_hook_prologue`.

Depends on D19908.

Reviewers: rnk, aaron.ballman

Subscribers: cfe-commits

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

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

7 years ago[analyzer] Change -analyze-function to accept qualified names.
Artem Dergachev [Mon, 8 Aug 2016 16:01:02 +0000 (16:01 +0000)]
[analyzer] Change -analyze-function to accept qualified names.

Both -analyze-function and -analyzer-display-progress now share the same
convention for naming functions, which allows discriminating between
methods with the same name in different classes, C++ overloads, and also
presents Objective-C instance and class methods in the convenient notation.

This also allows looking up the name for the particular function you're trying
to restrict analysis to in the -analyzer-display-progress output,
in case it was not instantly obvious.

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

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

7 years ago[ARM] Command-line options for embedded position-independent code
Oliver Stannard [Mon, 8 Aug 2016 15:28:40 +0000 (15:28 +0000)]
[ARM] Command-line options for embedded position-independent code

This patch (with the corresponding ARM backend patch) adds support for
some new relocation models:

* Read-only position independence (ROPI): Code and read-only data is accessed
  PC-relative. The offsets between all code and RO data sections are known at
  static link time.
* Read-write position independence (RWPI): Read-write data is accessed relative
  to a static base register. The offsets between all writeable data sections
  are known at static link time.

These two modes are independent (they specify how different objects
should be addressed), so they can be used individually or together.

These modes are intended for bare-metal systems or systems with small
real-time operating systems. They are designed to avoid the need for a
dynamic linker, the only initialisation required is setting the static
base register to an appropriate value for RWPI code.

There is one C construct not currently supported by these modes: global
variables initialised to the address of another global variable or
function, where that address is not known at static-link time. There are
a few possible ways to solve this:

* Disallow this, and require the user to write their own initialisation
  function if they need variables like this.
* Emit dynamic initialisers for these variables in the compiler, called from
  the .init_array section (as is currently done for C++ dynamic initialisers).
  We have a patch to do this, described in my original RFC email
  (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the
  feedback from that RFC thread was that this is not something that belongs in
  clang.
* Use a small dynamic loader to fix up these variables, by adding the
  difference between the load and execution address of the relevant section.
  This would require linker co-operation to generate a table of addresses that
  need fixing up.

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

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

7 years ago[analyzer] Command line option to show enabled checker list.
Gabor Horvath [Mon, 8 Aug 2016 13:41:04 +0000 (13:41 +0000)]
[analyzer] Command line option to show enabled checker list.

This patch adds a command line option to list the checkers that were enabled
by analyzer-checker and not disabled by -analyzer-disable-checker.

It can be very useful to debug long command lines when it is not immediately
apparent which checkers are turned on and which checkers are turned off.

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

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

7 years agoFixes calculateRangesAfterReplacements crash when Replacements is empty.
Eric Liu [Mon, 8 Aug 2016 13:37:39 +0000 (13:37 +0000)]
Fixes calculateRangesAfterReplacements crash when Replacements is empty.

Reviewers: klimek, djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[analyzer] Model base to derived casts more precisely.
Gabor Horvath [Mon, 8 Aug 2016 09:22:59 +0000 (09:22 +0000)]
[analyzer] Model base to derived casts more precisely.

Dynamic casts are handled relatively well by the static analyzer.
BaseToDerived casts however are treated conservatively. This can cause some
false positives with the NewDeleteLeaks checker.

This patch alters the behavior of BaseToDerived casts. In case a dynamic cast
would succeed use the same semantics. Otherwise fall back to the conservative
approach.

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

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

7 years agoFix two bugs for musl-libc on ARM
Diana Picus [Mon, 8 Aug 2016 08:27:36 +0000 (08:27 +0000)]
Fix two bugs for musl-libc on ARM

Bug 1: triples like armv7-pc-linux-musl use the wrong linker name
ld-musl-armv7.so.1; the right name should be ld-musl-arm.so.1, disregarding the
subarch field.

Bug 2: when compiler option -mhard-float is used, we should use the "hardfloat"
linker, no matter whether the triple itself mentions "hardfloat".

Patch by Lei Zhang!

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

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

7 years agoPass information in a record instead of stack. NFC
Serge Pavlov [Mon, 8 Aug 2016 04:02:15 +0000 (04:02 +0000)]
Pass information in a record instead of stack. NFC

Functions of Sema that work with building of nested name specifiers have too
many parameters (BuildCXXNestedNameSpecifier already expects 10 arguments).
With this change the information about identifier and its context is packed
into a structure, which is then passes to the semantic functions.

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

7 years ago[AVX512] integer comparisions enumeration.
Asaf Badouh [Sun, 7 Aug 2016 10:43:04 +0000 (10:43 +0000)]
[AVX512] integer comparisions enumeration.

fix Bug 28842 https://llvm.org/bugs/show_bug.cgi?id=28842

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

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

7 years agoUpdate clang tests for LLVM r277950
David Majnemer [Sun, 7 Aug 2016 08:28:58 +0000 (08:28 +0000)]
Update clang tests for LLVM r277950

We infer inbounds on GEPs of allocas leading to minor perturbations in
tests.

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

7 years agoAdd the new scan-build option (--show-description) in the 4.0 release notes
Sylvestre Ledru [Sat, 6 Aug 2016 20:23:54 +0000 (20:23 +0000)]
Add the new scan-build option (--show-description) in the 4.0 release notes

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