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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 years agoHeaders: Add ARM support to intrin.h for MSVC compatibility
Saleem Abdulrasool [Sat, 6 Aug 2016 17:58:24 +0000 (17:58 +0000)]
Headers: Add ARM support to intrin.h for MSVC compatibility

This fixes compiling with headers from the Windows SDK for ARM, where the
YieldProcessor function (in winnt.h) refers to _ARM_BARRIER_ISHST.

The actual MSVC armintr.h contains a lot more definitions, but this is enough to
build code that uses the Windows SDK but doesn't use ARM intrinsics directly.

An alternative would to just keep the addition to intrin.h (to include
armintr.h), but not actually ship armintr.h, instead having clang's intrin.h
include armintr.h from MSVC's include directory. (That one works fine with
clang, at least for building code that uses the Windows SDK.)

Patch by Martin Storsjö!

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

8 years ago[ASTReader] Use real move semantics instead of emulating them in the copy ctor.
Benjamin Kramer [Sat, 6 Aug 2016 12:45:16 +0000 (12:45 +0000)]
[ASTReader] Use real move semantics instead of emulating them in the copy ctor.

No functionality change intended.

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

8 years ago[Sema] Make switch fully covered again.
Benjamin Kramer [Sat, 6 Aug 2016 11:28:20 +0000 (11:28 +0000)]
[Sema] Make switch fully covered again.

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

8 years agoMove helpers into anonymous namespaces. NFC.
Benjamin Kramer [Sat, 6 Aug 2016 11:21:04 +0000 (11:21 +0000)]
Move helpers into anonymous namespaces. NFC.

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

8 years ago[StaticAnalyzer] Remove dead code.
Benjamin Kramer [Sat, 6 Aug 2016 11:20:59 +0000 (11:20 +0000)]
[StaticAnalyzer] Remove dead code.

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

8 years ago[NFC] Silence noisy -Wreturn-type warnings
Erik Pilkington [Sat, 6 Aug 2016 01:54:50 +0000 (01:54 +0000)]
[NFC] Silence noisy -Wreturn-type warnings

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

8 years agoFix typos from r277797 and unused variable from r277889.
Richard Trieu [Sat, 6 Aug 2016 01:44:06 +0000 (01:44 +0000)]
Fix typos from r277797 and unused variable from r277889.

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

8 years agoFix two false positives in -Wreturn-stack-address
Richard Trieu [Fri, 5 Aug 2016 23:24:47 +0000 (23:24 +0000)]
Fix two false positives in -Wreturn-stack-address

If the return type is a pointer and the function returns the reference to a
pointer, don't warn since only the value is returned, not the reference.

If a reference function parameter appears in the reference chain, don't warn
since binding happens at the caller scope, so addresses returned are not
to local stack.  This includes default arguments as well.

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

8 years ago[NFC][ObjC Availability] Refactor DiagnoseAvailabilityOfDecl
Erik Pilkington [Fri, 5 Aug 2016 22:59:03 +0000 (22:59 +0000)]
[NFC][ObjC Availability] Refactor DiagnoseAvailabilityOfDecl

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

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

8 years ago[clang-tblgen] Remove unused #include (NFC)
Vedant Kumar [Fri, 5 Aug 2016 22:48:53 +0000 (22:48 +0000)]
[clang-tblgen] Remove unused #include (NFC)

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

8 years agoFix false positive in -Wunsequenced and templates.
Richard Trieu [Fri, 5 Aug 2016 21:02:34 +0000 (21:02 +0000)]
Fix false positive in -Wunsequenced and templates.

For builtin logical operators, there is a well-defined ordering of argument
evaluation.  For overloaded operator of the same type, there is no argument
evaluation order, similar to other function calls.  When both are present,
uninstantiated templates with an operator&& is treated as an unresolved
function call.  Unresolved function calls are treated as normal function calls,
and may result in false positives when the builtin logical operator is used.
Have the unsequenced checker ignore dependent expressions to avoid this
false positive.  The check also happens in template instantiations to catch
when the overloaded operator is used.

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

8 years agoPR26423: Assert on valid use of using declaration of a function with an undeduced...
David Blaikie [Fri, 5 Aug 2016 19:03:01 +0000 (19:03 +0000)]
PR26423: Assert on valid use of using declaration of a function with an undeduced auto return type

For now just disregard the using declaration in this case. Suboptimal,
but wiring up the ability to have declarations of functions that are
separate from their definition (we currently only do that for member
functions) and have differing return types (we don't have any support
for that) is more work than seems reasonable to at least fix this crash.

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

8 years ago[SemaOpenMP] Some miscellaneous cleanups
David Majnemer [Fri, 5 Aug 2016 17:44:54 +0000 (17:44 +0000)]
[SemaOpenMP] Some miscellaneous cleanups

Clean up some typos, follow the coding style a little more rigorously.

No functionality change is intended.

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

8 years agoRevert "[Sema] Add sizeof diagnostics for bzero"
Bruno Cardoso Lopes [Fri, 5 Aug 2016 16:41:00 +0000 (16:41 +0000)]
Revert "[Sema] Add sizeof diagnostics for bzero"

This reverts commit r277787, which caused PR28870.

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

8 years agoAMDGPU : Add Clang builtin intrinsics for compare with the full
Wei Ding [Fri, 5 Aug 2016 15:38:46 +0000 (15:38 +0000)]
AMDGPU : Add Clang builtin intrinsics for compare with the full
wavefront result.

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

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

8 years ago[OpenMP] Sema and parsing for 'teams distribute' pragma
Kelvin Li [Fri, 5 Aug 2016 14:37:37 +0000 (14:37 +0000)]
[OpenMP] Sema and parsing for 'teams distribute' pragma

This patch is to implement sema and parsing for 'teams distribute' pragma.

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

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

8 years agoReapply r276973 "Adjust Registry interface to not require plugins to export a registry"
John Brawn [Fri, 5 Aug 2016 11:01:08 +0000 (11:01 +0000)]
Reapply r276973 "Adjust Registry interface to not require plugins to export a registry"

This differs from the previous version by being more careful about template
instantiation/specialization in order to prevent errors when building with
clang -Werror. Specifically:
 * begin is not defined in the template and is instead instantiated when Head
   is. I think the warning when we don't do that is wrong (PR28815) but for now
   at least do it this way to avoid the warning.
 * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY
   instead provide a template definition then do explicit instantiation. No
   compiler I've tried has problems with doing it the other way, but strictly
   speaking it's not permitted by the C++ standard so better safe than sorry.

Original commit message:

Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.

This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.

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

8 years agoFix crash in template type diffing.
Richard Trieu [Fri, 5 Aug 2016 03:16:36 +0000 (03:16 +0000)]
Fix crash in template type diffing.

When the type being diffed is a type alias, and the orginal type is not a
templated type, then there will be no unsugared TemplateSpecializationType.
When this happens, exit early from the constructor.  Also add assertions to
the other iterator accessor to prevent the iterator from being used.

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

8 years agoAllow -1 to assign max value to unsigned bitfields.
Richard Trieu [Fri, 5 Aug 2016 02:39:30 +0000 (02:39 +0000)]
Allow -1 to assign max value to unsigned bitfields.

Silence the -Wbitfield-constant-conversion warning for when -1 or other
negative values are assigned to unsigned bitfields, provided that the bitfield
is wider than the minimum number of bits needed to encode the negative value.

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

8 years ago[Sema] Add sizeof diagnostics for bzero
Bruno Cardoso Lopes [Thu, 4 Aug 2016 23:55:22 +0000 (23:55 +0000)]
[Sema] Add sizeof diagnostics for bzero

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@277787 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Migrate DepthFirstIterator to use NodeRef
Tim Shen [Thu, 4 Aug 2016 23:03:44 +0000 (23:03 +0000)]
[ADT] Migrate DepthFirstIterator to use NodeRef

Summary: The corresponding LLVM change is D23146.

Reviewers: dblaikie, chandlerc

Subscribers: cfe-commits

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

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

8 years ago[analyzer] Make CloneDetector recognize different variable patterns.
Artem Dergachev [Thu, 4 Aug 2016 19:37:00 +0000 (19:37 +0000)]
[analyzer] Make CloneDetector recognize different variable patterns.

CloneDetector should be able to detect clones with renamed variables.
However, if variables are referenced multiple times around the code sample,
the usage patterns need to be recognized.

For example, (x < y ? y : x) and (y < x ? y : x) are no longer clones,
however (a < b ? b : a) is still a clone of the former.

Variable patterns are computed and compared during a separate filtering pass.

Patch by Raphael Isemann!

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

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

8 years ago[OpenCL] Add the lit test for image size which was omitted by r277647.
Yaxun Liu [Thu, 4 Aug 2016 19:35:17 +0000 (19:35 +0000)]
[OpenCL] Add the lit test for image size which was omitted by r277647.

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

8 years ago[OpenCL] Remove extra native_ functions from opencl-c.h
Yaxun Liu [Thu, 4 Aug 2016 19:30:54 +0000 (19:30 +0000)]
[OpenCL] Remove extra native_ functions from opencl-c.h

There should be no native_ builtin functions with double type arguments.

Patch by Aaron En Ye Shi.

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

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

8 years ago[OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.
Alexey Bader [Thu, 4 Aug 2016 18:06:27 +0000 (18:06 +0000)]
[OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.

Summary:
In order to re-define OpenCL built-in functions
'to_{private,local,global}' in OpenCL run-time library LLVM names must
be different from the clang built-in function names.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits

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

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

8 years agoMake isExternC work on VarDecls too.
Benjamin Kramer [Thu, 4 Aug 2016 10:02:03 +0000 (10:02 +0000)]
Make isExternC work on VarDecls too.

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

8 years agoAfter PR28761 use -Wall with -Werror in builtins tests to identify
Eric Christopher [Thu, 4 Aug 2016 06:02:50 +0000 (06:02 +0000)]
After PR28761 use -Wall with -Werror in builtins tests to identify
possible problems in headers.

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

8 years ago[Concepts] remove default argument for RequiresClause; NFC
Hubert Tong [Wed, 3 Aug 2016 22:07:50 +0000 (22:07 +0000)]
[Concepts] remove default argument for RequiresClause; NFC

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

8 years ago[OpenCL] Fix size of image type
Yaxun Liu [Wed, 3 Aug 2016 20:38:06 +0000 (20:38 +0000)]
[OpenCL] Fix size of image type

The size of image type is reported incorrectly as size of a pointer to address space 0, which causes error when casting image type to pointers by __builtin_astype.

The fix is to get image address space from TargetInfo then report the size accordingly.

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

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

8 years agoFix bug in conflict check for Replacements::add().
Manuel Klimek [Wed, 3 Aug 2016 15:12:00 +0000 (15:12 +0000)]
Fix bug in conflict check for Replacements::add().

We would not detect conflicts when inserting insertions at the same
offset as previously contained replacements.

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

8 years agoFix quadratic runtime when adding items to tooling::Replacements.
Manuel Klimek [Wed, 3 Aug 2016 14:12:17 +0000 (14:12 +0000)]
Fix quadratic runtime when adding items to tooling::Replacements.

Previously, we would search through all replacements when inserting a
new one to check for overlaps. Instead, make use of the fact that we
already have a set of replacments without overlaps to find the potential
overlap with lower_bound.

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

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

8 years ago[clang/test] Fix a flaky unittest on windows
Etienne Bergeron [Wed, 3 Aug 2016 06:10:15 +0000 (06:10 +0000)]
[clang/test] Fix a flaky unittest on windows

Summary:
The append operator on a shell command for quick command-line is
causing trouble on windows. [NFC]
The easiest way to fix them is to avoid using them.

This patch is an attempt to fix this broken build bot:
  clang-x86-win2008-selfhost

http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/9523

Reviewers: rnk

Subscribers: cfe-commits, chrisha

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

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

8 years ago[index] Fix crash with indexing designated init expressions inside templates.
Argyrios Kyrtzidis [Wed, 3 Aug 2016 05:38:53 +0000 (05:38 +0000)]
[index] Fix crash with indexing designated init expressions inside templates.

rdar://27452869

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

8 years ago[CUDA] Updated CUDA tests that must run w/o CUDA installation.
Artem Belevich [Tue, 2 Aug 2016 23:43:04 +0000 (23:43 +0000)]
[CUDA] Updated CUDA tests that must run w/o CUDA installation.

Fixes test failures after r277542 on systems that don't have
CUDA installed.

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

8 years ago[analyzer] Update two comments in MPI-Checker. NFC.
Devin Coughlin [Tue, 2 Aug 2016 23:24:40 +0000 (23:24 +0000)]
[analyzer] Update two comments in MPI-Checker. NFC.

Correct two comments that do not match the current behavior of the checker.

A patch by Alexander Droste!

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

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

8 years ago[CUDA] Fix libdevice selection.
Artem Belevich [Tue, 2 Aug 2016 23:12:51 +0000 (23:12 +0000)]
[CUDA] Fix libdevice selection.

This makes clang's libdevice selection match that of NVCC as described in
http://docs.nvidia.com/cuda/libdevice-users-guide/basic-usage.html#version-selection

If required libdevice variant is not found, driver now fails with an error.

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

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

8 years ago[CUDA] Do not allow using NVPTX target for host compilation.
Artem Belevich [Tue, 2 Aug 2016 22:37:47 +0000 (22:37 +0000)]
[CUDA] Do not allow using NVPTX target for host compilation.

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

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

8 years ago[CFG] Fix crash finding destructor of lifetime-extended temporary.
Devin Coughlin [Tue, 2 Aug 2016 21:07:23 +0000 (21:07 +0000)]
[CFG] Fix crash finding destructor of lifetime-extended temporary.

Fix a crash under -Wthread-safety when finding the destructor for a
lifetime-extending reference.

A patch by Nandor Licker!

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

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

8 years agoRevert "[Order Files] Remove dtrace predicate"
Chris Bieneman [Tue, 2 Aug 2016 18:23:56 +0000 (18:23 +0000)]
Revert "[Order Files] Remove dtrace predicate"

This reverts commit r277487.

Removing the probe predicate was a red herring. It results in more symbols being placed in the final order file, but they are symbols from outside the clang image.

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

8 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Tue, 2 Aug 2016 17:58:14 +0000 (17:58 +0000)]
Update Clang Parser test error message to match new parser errors

Update clang tests in light of r277489.

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

8 years agoUpdated documentation
Vitaly Buka [Tue, 2 Aug 2016 17:51:48 +0000 (17:51 +0000)]
Updated documentation

Reviewers: kcc, eugenis

Subscribers: llvm-commits

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

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

8 years ago[Order Files] Remove dtrace predicate
Chris Bieneman [Tue, 2 Aug 2016 17:50:53 +0000 (17:50 +0000)]
[Order Files] Remove dtrace predicate

Having the dtrace predicate setup to only show probes in clang filters out static initializers executed by dyld, which we do want included in the order files.

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

8 years ago[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449
Artem Dergachev [Tue, 2 Aug 2016 15:16:06 +0000 (15:16 +0000)]
[analyzer] Hotfix for buildbot failure due to unspecified triple in r277449

If a target triple is not specified, the default host triple is used,
which is not good for compiling inline assembler code.

Patch by Raphael Isemann!

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

8 years ago[clang-cl] Fix PCH tests to use x86_64 as target
Diana Picus [Tue, 2 Aug 2016 13:53:00 +0000 (13:53 +0000)]
[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

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

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

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

8 years ago[analyzer] Respect statement-specific data in CloneDetection.
Artem Dergachev [Tue, 2 Aug 2016 12:21:09 +0000 (12:21 +0000)]
[analyzer] Respect statement-specific data in CloneDetection.

So far the CloneDetector only respected the kind of each statement when
searching for clones. This patch refines the way the CloneDetector collects data
from each statement by providing methods for each statement kind,
that will read the kind-specific attributes.

For example, statements 'a < b' and 'a > b' are no longer considered to be
clones, because they are different in operation code, which is an attribute
specific to the BinaryOperator statement kind.

Patch by Raphael Isemann!

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

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

8 years agoRevert r276896 "Update Clang Parser test error message to match new parser errors"
Hans Wennborg [Mon, 1 Aug 2016 23:34:42 +0000 (23:34 +0000)]
Revert r276896 "Update Clang Parser test error message to match new parser errors"

This depended on r276895, which was reverted in r277402.

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

8 years ago[Order Files] Fixing an error in the perf-helper script
Chris Bieneman [Mon, 1 Aug 2016 22:54:00 +0000 (22:54 +0000)]
[Order Files] Fixing an error in the perf-helper script

Dtrace probemod needs to be based on the first argument of the command, not the first argument of the args. This error was introduced a while back when I added support for skipping the driver and invoking cc1 directly.

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

8 years agoAdd FIXMEs for MSVC 2013 hacks in r277211. NFC.
Paul Robinson [Mon, 1 Aug 2016 22:12:46 +0000 (22:12 +0000)]
Add FIXMEs for MSVC 2013 hacks in r277211. NFC.

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