Commit Graph

63120 Commits

Author SHA1 Message Date
Justin Lebar 0cda764430 [CUDA] Add math forward declares to CUDA header wrapper.
Summary:
This is necessary for a future patch which will make all constexpr
functions implicitly host+device.  cmath may declare constexpr
functions, but these we do *not* want to be host+device.  The forward
declares added in this patch prevent this (because the rule will be,
constexpr functions become implicitly host+device unless they're
preceeded by a decl with __device__).

Reviewers: tra

Subscribers: cfe-commits, rnk, rsmith

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

llvm-svn: 264963
2016-03-30 23:30:14 +00:00
Matt Arsenault 3fb963389e AMDGPU: Add frexp_mant + frexp_exp builtins
llvm-svn: 264960
2016-03-30 22:57:40 +00:00
Paul Robinson 55771cd7be Update copyright year to 2016.
llvm-svn: 264946
2016-03-30 22:38:44 +00:00
Paul Robinson 1c898c9e8c Docs: keep copyright years up-to-date.
llvm-svn: 264941
2016-03-30 22:24:57 +00:00
Richard Trieu a7564d7d66 Fix Clang crash with template type diffing.
Fixes https://llvm.org/bugs/show_bug.cgi?id=27129 which is crash involving type
aliases and template type diffing.  Template arguments for type aliases and
template arguments for the underlying desugared type may not have one-to-one
relations, which could mess us the attempt to get more information from the
desugared type.  For type aliases, ignore the iterator over the desugared type.

llvm-svn: 264940
2016-03-30 22:23:00 +00:00
Vassil Vassilev 85daf65c5a Add -emit-llvm-only to the regression test for PR21547.
llvm-svn: 264939
2016-03-30 22:22:50 +00:00
Vassil Vassilev bab6f96fff Canonicalize UnaryTransformType types when they don't have a known underlying type.
Fixes https://llvm.org/bugs/show_bug.cgi?id=26014

Reviewed by Richard Smith.

llvm-svn: 264937
2016-03-30 22:18:29 +00:00
Aaron Ballman abd466ed04 Silencing warnings from MSVC 2015 Update 2. Both of these changes silence "C4334 '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)". NFC.
llvm-svn: 264932
2016-03-30 21:33:34 +00:00
Matt Arsenault edc7c6b237 AMDGPU: Remove separate r600 double data layout
This is identical to the other r600 datalayout string.

llvm-svn: 264931
2016-03-30 21:32:37 +00:00
Oleg Ranevskyy b88d2474df [Clang][ARM] __va_list declaration is not saved in ASTContext causing compilation error or crash
Summary:
When the code is compiled for arm32 and the builtin `__va_list` declaration is created by `CreateAAPCSABIBuiltinVaListDecl`, the declaration is not saved in the `ASTContext` which may lead to a compilation error or crash.

Minimal reproducer I was able to find:
**header.h**
```
#include <stdarg.h>
typedef va_list va_list_1;
```

**test.cpp**
```
typedef __builtin_va_list va_list_2;
void foo(const char* format, ...) { va_list args; va_start( args, format ); }
```

Steps to reproduce:
```
clang -x c++-header --target=armv7l-linux-eabihf header.h
clang -c -include header.h --target=armv7l-linux-eabihf test.cpp
```

Compilation error:
```
error: non-const lvalue reference to type '__builtin_va_list'
      cannot bind to a value of unrelated type 'va_list' (aka '__builtin_va_list')
```

Compiling the same code as a C source leads to a crash:
```
clang --target=armv7l-linux-eabihf header.h
clang -c -x c -include header.h --target=armv7l-linux-eabihf test.cpp
```

Reviewers: logan, rsmith

Subscribers: cfe-commits, asl, aemerson, rengolin

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

llvm-svn: 264930
2016-03-30 21:30:30 +00:00
Justin Lebar 39fd529935 [Sema] s/UseUsingDeclRules/UseMemberUsingDeclRules/
Summary:
IsOverload has a param named UseUsingDeclRules.  But as far as I can
tell, it should be called UseMemberUsingDeclRules.  That is, it only
applies to "using" declarations inside classes or structs.

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 264920
2016-03-30 20:41:05 +00:00
Vassil Vassilev 262f41e91c [modules] Write out identifiers if the ID is local, too.
In some cases a slot for an identifier is requested but it gets written to
another module, causing an assertion.

At the point when we start serializing Rtypes, we have no imported IdentifierID
for float_round_style. We start serializing stuff and allocate an ID for it.
Then, during the serialization process, we pull in the identifier info for it
from TSchemaHelper. Finally, WriteIdentifierTable decides that the identifier
has not changed since it was deserialized, so doesn't emit it.

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

Discussed on IRC with Richard Smith. Agreed on post commit review if needed.

llvm-svn: 264913
2016-03-30 20:16:03 +00:00
Vassil Vassilev a3cbf2a738 [modules] Add a regression test for PR21547.
llvm-svn: 264908
2016-03-30 20:10:07 +00:00
Vedant Kumar b64d86ff8e [c-index-test] Delete dead function, NFC
llvm-svn: 264874
2016-03-30 16:03:02 +00:00
Jonas Paulsson 3ace74a414 [SystemZ] Specify required features for builtins.
BuiltinsSystemZ.def is extended to include the required processor
features per intrinsic.

New test test/CodeGen/builtins-systemz-error2.c that checks for
expected errors when instrinsics are used with a subtarget that does
not support the required feature (e.g. vector support).

Reviewed by Ulrich Weigand.

llvm-svn: 264873
2016-03-30 15:51:24 +00:00
Teresa Johnson 0c7bb96533 Prepare tests for change to emit Module SourceFileName to LLVM assembly
Modify these tests to ignore the source file name when looking for the
expected string. It was already catching the source file name once via
the ModuleID, and will catch it another time with an impending change to
LLVM to serialize out the module's SourceFileName.

llvm-svn: 264868
2016-03-30 13:59:49 +00:00
Gabor Horvath 1b654f2293 [ASTMatchers] Existing matcher hasAnyArgument fixed
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. The checker needs matcher hasAnyArgument but it ignores implicit casts and parenthesized expressions which disables checking of implicit casts for arguments in the checker. However the documentation of the matcher contains a FIXME that this should be removed once separate matchers for ignoring implicit casts and parenthesized expressions are ready. Since these matchers were already there the fix could be executed. Only one Clang checker was affected which was also fixed (ignoreParenImpCasts added) and is separately uploaded. Third party checkers (not in the Clang repository) may be affected by this fix so the fix must be emphasized in the release notes.

Reviewers: klimek, sbenza, alexfh

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

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

llvm-svn: 264855
2016-03-30 11:22:14 +00:00
Alexey Bataev 587e1de4ea [OPENMP 4.0] Initial support for '#pragma omp declare simd' directive.
Initial parsing/sema/serialization/deserialization support for '#pragma
omp declare simd' directive.
The 'declare simd' construct can be applied to a function to enable the
creation of one or more versions that can process multiple arguments
using SIMD instructions from a single invocation from a SIMD loop.
If the function has any declarations, then the declare simd construct
for any declaration that has one must be equivalent to the one specified
 for the definition. Otherwise, the result is unspecified.
This pragma can be applied many times to the same declaration.
Internally this pragma is represented as an attribute. But we need special processing for this pragma because it must be used before function declaration, this directive is applied to.
Differential Revision: http://reviews.llvm.org/D10599

llvm-svn: 264853
2016-03-30 10:43:55 +00:00
Gabor Horvath b780c44eec [analyzer] Fix an assertion fail in hash generation.
In case the (uniqueing) location of the diagnostic is in a line that only
contains whitespaces there was an assertion fail during issue hash generation.

Unfortunately I am unable to reproduce this error with the built in checkers, 
so no there is no failing test case with this patch. It would be possible to
write a debug checker for that purpuse but it does not worth the effort.

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

llvm-svn: 264851
2016-03-30 10:08:59 +00:00
Stephan Bergmann 17d7d14571 For MS ABI, emit dllexport friend functions defined inline in class
...as that is apparently what MSVC does.  This is an updated version of r263738,
which had to be reverted in r263740 due to test failures.  The original version
had erroneously emitted functions that are defined in class templates, too (see
the updated "Handle friend functions" code in EmitDeferredDecls,
lib/CodeGen/ModuleBuilder.cpp).  (The updated tests needed to be split out into
their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have
interfered with subsequent CHECK-DAGs in dllexport.cpp.)

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

llvm-svn: 264841
2016-03-30 06:27:31 +00:00
Xiuli Pan 0a1c6c2ee5 [OpenCL] Fix pipe builtin bugs
Summary:
1. Diag should be output if types are not the same.
2. Should compare using canonical type.
3. Refine the diag to be more clear.

Reviewers: yaxunl, Anastasia

Subscribers: MatsPetersson, pekka.jaaskelainen, cfe-commits

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

llvm-svn: 264825
2016-03-30 04:46:32 +00:00
Bruno Cardoso Lopes b741e10402 [Driver] Quote clang full version in dwarf producer when invoking cc1as
Convenience to allow easy copy-n-paste from clang -v output when
reproducing cc1as comandline.

rdar://problem/23959295

llvm-svn: 264813
2016-03-30 00:25:57 +00:00
Bruno Cardoso Lopes b1631d9161 [CrashReproducer] Cleanup and move functionality around in ModuleDependencyCollector. NFC
- Make ModuleDependencyCollector use the DependencyCollector interface
- Move some methods from ModuleDependencyListener to ModuleDependencyCollector
in order to share common functionality with other future possible
callbacks.

llvm-svn: 264808
2016-03-29 23:47:40 +00:00
Yunzhong Gao 333e69d70f Fixing PR26558: remove the adx target attribute requirement from adc builtins.
The addcarry and subborrow variants of the builtins do not require the adx
target attribute; only the addcarryx variants require them.

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

llvm-svn: 264801
2016-03-29 22:59:20 +00:00
Betul Buyukkurt d68bbdcc12 [PGO] Test case fix for r264783
llvm-svn: 264795
2016-03-29 22:17:52 +00:00
Bruno Cardoso Lopes 03e18d41ad [Sema] Attempt [3] to fix tests for utf-8 invalid format string specifiers
Make the tests darwin only. The bots complaining already output UTF-8
invalid specifiers, test the output as we expect on darwin systems.

llvm-svn: 264788
2016-03-29 21:30:58 +00:00
Ed Schouten fc79d2ca42 Enable the SafeStack sanitizer on CloudABI by default.
Over the last month we've been testing SafeStack extensively. As far as
we know, it works perfectly fine. That why I'd like to see us having
this enabled by default for CloudABI.

This change introduces a getDefaultSanitizers() function that toolchains
can use to specify which sanitizers are enabled by default. Once all
flags are processed, only flags that had no -fno-sanitize overrides are
enabled.

Extend the thests for CloudABI to test both the default case and the
case in which we want to explicitly disable SafeStack.

Reviewed by:	eugenis, pcc
Differential Revision:	http://reviews.llvm.org/D18505

llvm-svn: 264787
2016-03-29 21:13:53 +00:00
Bruno Cardoso Lopes 10b1c8031f [Sema] Attempt [2] to fix tests for utf-8 invalid format string specifiers
Some buildbots still complain. Followup from r264752 and 264765.

llvm-svn: 264784
2016-03-29 20:47:09 +00:00
Betul Buyukkurt cb6f5f16e6 [PGO] Move the instrumentation point closer to the value site.
For terminator instructions, the value profiling instrumentation
happens in a basic block other than where the value site resides.
This CR moves the instrumentation point prior to the value site.
Mostly NFC.

llvm-svn: 264783
2016-03-29 20:44:09 +00:00
Nico Weber 4884dcf709 clang-cl: Silently ignore /d2FastFail flag.
It's some debugging flag for cl.exe related to how it writes crash dumps.

llvm-svn: 264774
2016-03-29 19:41:02 +00:00
Bruno Cardoso Lopes dc195d005f [Sema] Attempt to fix tests for utf-8 invalid format string specifiers
Followup from r264752.

Attempt to appease buildbots:
 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2882
 http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2619

llvm-svn: 264765
2016-03-29 18:38:44 +00:00
Eric Liu ff6d0d8b2e Removed class FormatStyle, which is a struct, forward declaration from Refactoring.h to avoid compilation error.
llvm-svn: 264760
2016-03-29 18:17:11 +00:00
Chris Bieneman 54e3b5ace0 [Order Files] Fix order file usage
The CMake EXISTS operator needs to have the variable expanded. Not expanding this was causing the if statement to always be false, which made it impossible to pass linker order files in.

llvm-svn: 264757
2016-03-29 17:51:08 +00:00
Bruno Cardoso Lopes 0c18d03d91 [Sema] Handle UTF-8 invalid format string specifiers
Improve invalid format string specifier handling by printing out
invalid specifiers characters with \x, \u and \U. Previously clang
would print gargabe whenever the character is unprintable.

Example, before:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier ' [-Wformat-invalid-specifier]
after:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier '\u25b9' [-Wformat-invalid-specifier]

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

rdar://problem/24672159

llvm-svn: 264752
2016-03-29 17:35:02 +00:00
Eric Liu 4c1ef97adb Added formatAndApplyAllReplacements that works on multiple files in libTooling.
Summary:
formatAndApplyAllReplacements takes a set of Replacements, applies them on a
Rewriter, and reformats the changed code.

Reviewers: klimek, djasper

Subscribers: ioeric, klimek, cfe-commits

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

llvm-svn: 264745
2016-03-29 16:31:53 +00:00
Justin Lebar 50e5f184d8 [CUDA] Add missing #undef __DEVICE__ to CUDA shim header.
llvm-svn: 264742
2016-03-29 16:24:23 +00:00
Justin Lebar 3918647a11 [CUDA] Fix order of overloading preferences in comment.
llvm-svn: 264741
2016-03-29 16:24:22 +00:00
Justin Lebar 694cd1fdf8 [CUDA] Make CUDA description strings in langopts into noun phrases. NFC
rsmith quoth in D18380:

> This should be a noun phrase -- this string appears in contexts like
> "support for %0 is enabled" -- so this should be "treating
> unattributed [...]".

llvm-svn: 264740
2016-03-29 16:24:20 +00:00
Justin Lebar 25c4a81e79 [CUDA] Remove three obsolete CUDA cc1 flags.
Summary:
* -fcuda-target-overloads

  Previously unconditionally set to true by the driver.  Necessary for
  correct functioning of the compiler -- our CUDA headers wrapper won't
  compile without this.

* -fcuda-disable-target-call-checks

  Previously unconditionally set to true by the driver.  Necessary to
  compile almost any external CUDA code -- almost all libraries assume
  that host+device code can call host or device functions.

* -fcuda-allow-host-calls-from-host-device

  No effect when target overloading is enabled.

Reviewers: tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 264739
2016-03-29 16:24:16 +00:00
Konstantin Zhuravlyov 656871124e [AMDGPU] Switch linker to amdphdrs + update test
Differential Revision: http://reviews.llvm.org/D18253

llvm-svn: 264737
2016-03-29 15:54:09 +00:00
Hrvoje Varga 14c42eec54 Add additional Hi/Lo registers to Clang MipsTargetInfoBase
Differential Revision: http://reviews.llvm.org/D17378

llvm-svn: 264727
2016-03-29 12:46:16 +00:00
Alexey Bataev 1efd166af6 [OPENMP 4.5] Allow data members in 'aligned' clause.
OpenMP 4.5 allows privatization of data members OpenMP clauses. Patch
adds support for data members in 'aligned' clause.

llvm-svn: 264715
2016-03-29 10:59:56 +00:00
Mike Spertus 1796c2e37b Visual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl
With this change, a TemplateParameterList will suggestively display in the locals window something like:
  <typename T, int i>

llvm-svn: 264714
2016-03-29 10:57:24 +00:00
Mike Spertus a9ab71c65a Visual Studio native visualizer for InjectedClassNameType
Also fixes some omissions for TemplateSpecializationType

llvm-svn: 264710
2016-03-29 09:24:45 +00:00
Alexey Bataev 5a3af13d93 [OPENMP] Remove extra code transformation.
For better support of some specific GNU extensions some extra
transformation of AST nodes were introduced. These transformations are
very hard to handle. The code is improved in handling of these
extensions by using captured expressions construct.

llvm-svn: 264709
2016-03-29 08:58:54 +00:00
Alexey Bataev 14fa1c6b60 [OPENMP] Allow runtime insert its own code inside OpenMP regions.
Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
 (required) code to support target specific codegen.

llvm-svn: 264700
2016-03-29 05:34:15 +00:00
Devin Coughlin 7646ebe6f9 [analyzer] Use BodyFarm-synthesized body even when actual body available.
Change body autosynthesis to use the BodyFarm-synthesized body even when
an actual body exists. This enables the analyzer to use the simpler,
analyzer-provided body to model the behavior of the function rather than trying
to understand the actual body. Further, this makes the analyzer robust against
changes in headers that expose the implementations of those bodies.

rdar://problem/25145950

llvm-svn: 264687
2016-03-28 23:55:58 +00:00
Adam Nemet 1e217bc25f [PGO] More comments how function pointers for indirect calls are mapped
to function names

Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: davidxl, cfe-commits

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

llvm-svn: 264681
2016-03-28 22:18:53 +00:00
Sean Callanan 8bca996651 Improvements to the ASTImporter to support LLDB top-level Clang expressions.
The testcase for this is in LLDB, adeed by r264662.

This patch adds support for a variety of new expression types to the AST
importer, mostly related to C++.  It also adds support for importing lambdas
correctly, and adds support for importing the attributes attached to any Decl.

Finally, the patch adds a new templated function to ASTNodeImporter that imports
arbitrary arrays of importable things into a bump-allocated array attached to
getToContext().  This is a pattern we see at many places in ASTNodeImporter;
rather than do it slightly differently at each point, this function does it one
way.

<rdar://problem/22864976>

llvm-svn: 264669
2016-03-28 21:43:01 +00:00
Richard Smith 8a3e39ab67 [modules] If both a module file and a module map for the same module are
explicitly provided, and the module map lists a header that does not exist,
unmark the module as 'unavailable' when loading its .pcm file. (Use of the
module might still fail if the relevant headers aren't embedded, but this
behavior is now consistent with how we behave if the module map is not
provided, and with the desired behavior for embedding headers in modules.)

llvm-svn: 264664
2016-03-28 21:31:09 +00:00
Jacques Pienaar d964cc22d1 [lanai] Add Lanai backend to clang driver.
Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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

llvm-svn: 264655
2016-03-28 21:02:54 +00:00
Reid Kleckner 2a5d34b5ef Update the description of Clang's MSVC compatibility flags
llvm-svn: 264651
2016-03-28 20:42:41 +00:00
Devin Coughlin 77942db0b8 [analyzer] Nullability: Don't warn along paths where null returned from non-null.
Change the nullability checker to not warn along paths where null is returned from
a method with a non-null return type, even when the diagnostic for this return
has been suppressed. This prevents warning from methods with non-null return types
that inline methods that themselves return nil but that suppressed the diagnostic.

Also change the PreconditionViolated state component to be called "InvariantViolated"
because it is set when a post-condition is violated, as well.

rdar://problem/25393539

llvm-svn: 264647
2016-03-28 20:30:25 +00:00
Reid Kleckner 25955f8590 Paper over the Windows-only enum initialization test failure until the bug is fixed
llvm-svn: 264642
2016-03-28 20:13:55 +00:00
Mike Spertus 1904598fff This file was accidentally committed with bad line endings. Fixed...
llvm-svn: 264621
2016-03-28 19:08:27 +00:00
Mike Spertus e9f15b4b9f Convert to Unix line endings due to previous commit error.
llvm-svn: 264610
2016-03-28 18:24:22 +00:00
Mike Spertus 6601a4420b Use VS2015 Project Support for Natvis to eliminate the need to manually install clang native visualizer
This is the clang equivalent to llvm commit 264601. When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013).

llvm-svn: 264603
2016-03-28 18:03:37 +00:00
Nico Weber 0509ef7f93 Windows: Shrink sizeof(MacroInfo) from 256 to 248, MacroDirective 24 to 16
In the Microsoft ABI, only bitfields with identical types get packed together,
so use consistently use one of the two instead of a mix.
Saves 457kB when parsing windows.h.

No intended behavior change.

llvm-svn: 264597
2016-03-28 17:28:06 +00:00
Nico Weber f21a0c6372 Reduce size of DefinitionData from 120 to 96 bytes on Windows.
In the Microsoft ABI, only bitfields with identical types get
packed together, so use unsigned consistently instead of a
bool / unsigned mix.

No intended behavior change.

llvm-svn: 264582
2016-03-28 14:55:24 +00:00
Alexey Bataev f539faa733 Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
Reverting because of failed tests.

llvm-svn: 264577
2016-03-28 12:58:34 +00:00
Alexey Bataev 424be92831 [OPENMP] Allow runtime insert its own code inside OpenMP regions.
Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
 (required) code to support target specific codegen.

llvm-svn: 264576
2016-03-28 12:52:58 +00:00
Michael Zuckerman def78750b7 [CLANG][avx512][BUILTIN] Adding fixupimm{pd|ps|sd|ss}
getexp{sd|ss} getmant{sd|ss} kunpck{di|si} loada{pd|ps} loaddqu{di|hi|qi|si} max{sd|ss} min{sd|ss} kmov16 builtins to clang


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

llvm-svn: 264574
2016-03-28 12:23:09 +00:00
Alexey Bataev f662b5943c Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."
This reverts commit 3ee791165100607178073f14531a0dc90c622b36.

llvm-svn: 264570
2016-03-28 10:12:03 +00:00
Alexey Bataev b8c425c4f7 [OPENMP] Allow runtime insert its own code inside OpenMP regions.
Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
  (required) code to support target specific codegen.

llvm-svn: 264569
2016-03-28 09:53:43 +00:00
Richard Smith ed638864d3 P0138R2: Allow direct-list-initialization of an enumeration from an integral
value that can convert to the enum's underlying type.

llvm-svn: 264564
2016-03-28 06:08:37 +00:00
David Majnemer 2041b46b76 Fix serialization/deserialization for __uuidof
I broke this back in r264529 because I forgot to serialize the UuidAttr
member.  Fix this by replacing the UuidAttr with a StringRef which is
properly serialized and deserialized.

llvm-svn: 264562
2016-03-28 03:19:50 +00:00
Richard Smith b22a1d186f [modules] When encoding SourceLocations in bitcode, rotate the 'is macro' flag
bit from the top bit to the bottom bit, so that we don't need 6 VBR6 hunks for
each macro location. Reduces libstdc++ module size by about 1%.

llvm-svn: 264540
2016-03-27 20:13:24 +00:00
Richard Smith cb34bd3abb Encapsulate a couple of on-disk structures a little more.
llvm-svn: 264534
2016-03-27 07:28:06 +00:00
Richard Smith 34da751484 Remove unused support for replacing declarations from chained AST files.
llvm-svn: 264533
2016-03-27 05:52:25 +00:00
David Majnemer 6568760090 Use the correct alignment for uuid descriptors
The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit
builds: we should do the same if the linker picks the "wrong" COMDAT.

llvm-svn: 264530
2016-03-27 04:46:14 +00:00
David Majnemer 1dbc7a7a5a Improve the representation of CXXUuidofExpr
Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to.
This makes translating from __uuidof to the underlying constant a lot
more straightforward.

llvm-svn: 264529
2016-03-27 04:46:07 +00:00
Faisal Vali b8b04f8526 [NFC] Tweak diagnostic for template template arguments, to include template aliases.
The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias.  The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases.

llvm-svn: 264522
2016-03-26 20:46:45 +00:00
Bob Wilson f43354f69c Check if a path is already absolute before trying to make it so.
The FileSystem::makeAbsolute function has been calculating the current
working directory unconditionally, even when it is not needed. This calls
down to llvm::sys::fs::current_path, which is relatively expensive
because it stats two directories, regardless of whether those paths are
already in the stat cache. The net effect is that when using the
VFS, every stat during header search turns into three stats. With this
change, we get back to a single stat for absolute directory paths.

llvm-svn: 264519
2016-03-26 18:55:13 +00:00
Faisal Vali a734ab9808 [Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier (and its inference) on lambda expressions
Support the constexpr specifier on lambda expressions - and support its inference from the lambda call operator's body.

i.e.
  auto L = [] () constexpr { return 5; };
  static_assert(L() == 5); // OK
  auto Implicit = [] (auto a) { return a; };
  static_assert(Implicit(5) == 5); 

We do not support evaluation of lambda's within constant expressions just yet.

Implementation Strategy:
  - teach ParseLambdaExpressionAfterIntroducer to expect a constexpr specifier and mark the invented function call operator's declarator's decl-specifier with it; Have it emit fixits for multiple decl-specifiers (mutable or constexpr) in this location.
  - for cases where constexpr is not explicitly specified, have buildLambdaExpr check whether the invented function call operator satisfies the requirements of a constexpr function, by calling CheckConstexprFunctionDecl/Body.

Much obliged to Richard Smith for his patience and his care, in ensuring the code is clang-worthy.

llvm-svn: 264513
2016-03-26 16:11:37 +00:00
Richard Smith 0e32c5283a Don't warn on "use" of undefined inline function that isn't actually an ODR
use. In order for this to fire, the function needed to be a templated function
marked 'constexpr' and declared but not defined. This weird pattern appears in
libstdc++'s alloc_traits.h.

llvm-svn: 264471
2016-03-25 22:29:27 +00:00
Richard Smith d6a04d79c7 Store list of undefined-but-used objects in a deterministic order to fix
non-deterministic diagnostics (and non-deterministic PCH files). Check these
when building a module rather than serializing it; it's not reasonable for a
module's use to be satisfied by a definition in the user of the module.

llvm-svn: 264466
2016-03-25 21:49:43 +00:00
Richard Smith 26b8f78f44 Delete dead variable.
llvm-svn: 264464
2016-03-25 21:46:44 +00:00
Devin Coughlin b8076292ab [analyzer] Add CIFIlter modeling to DeallocChecker.
The -dealloc method in CIFilter is highly unusual in that it will release
instance variables belonging to its *subclasses* if the variable name
starts with "input" or backs a property whose name starts with "input".
Subclasses should not release these ivars in their own -dealloc method --
doing so could result in an over release.

Before this commit, the DeallocChecker would warn about missing releases for
such "input" properties -- which could cause users of the analyzer to add
over releases to silence the warning.

To avoid this, DeallocChecker now treats CIFilter "input-prefixed" ivars
as MustNotReleaseDirectly and so will not require a release. Further, it
will now warn when such an ivar is directly released in -dealloc.

rdar://problem/25364901

llvm-svn: 264463
2016-03-25 21:18:22 +00:00
Samuel Benzaquen 7daec890f2 [ASTMatchers] Don't use brace-init lists.
They are not supported everywhere yet.
This fixes the MSVC build.

llvm-svn: 264453
2016-03-25 19:41:32 +00:00
Manman Ren 1c40052646 [ObjCXX] Warn undeclared identifiers.
Instantiation dependence were not being handled correctly for OpqaueValueExpr
AST nodes. As a result, if an undeclared identifier was used in a CXXNewExpr
that is assigned to a ObjC property, there would be no error during parsing, and
there would be a crash during code gen. This patch makes sure that an error
will be issued during parsing in this case.

Before the fix, if CXXNewExpr has a typo, its InstantiationDependent will be
set to true, but if it is wrapped in a OpaqueValueExpr, the OpaqueValueExpr will
not be instantiation dependent, causing the TypoExpr not be to resolved. The fix
propagates InstantiationDependent to OpaqueValueExpr from its SourceExpr. It
also propagates the other instantiation bits.

rdar://24975562

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

llvm-svn: 264444
2016-03-25 18:43:46 +00:00
Samuel Benzaquen de6b9fd48a [ASTMatchers] Fix build for VariadicFunction.
Under some conditions the implicit conversion from array to ArrayRef<>
is not working.
Fix the build by making it explicit.

llvm-svn: 264428
2016-03-25 17:46:02 +00:00
Ben Langmuir 443913f4d6 [index] Remove redundancy between symbol kind and language
Condense the ObjCKIND and CXXKIND options into just KIND, since the
language was already specified on a per-symbol basis and this
information was redundant. This only changes the internal
representation; naturally the libclang interface remains the same.

llvm-svn: 264423
2016-03-25 17:01:59 +00:00
Samuel Benzaquen c1384c138c [ASTMatchers] Add own version of VariadicFunction.
Summary:
llvm::VariadicFunction is only being used by ASTMatchers.
Having our own copy here allows us to remove the other one from llvm/ADT.
Also, we can extend the API to meet our needs without modifying the common
implementation.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 264417
2016-03-25 16:29:30 +00:00
Richard Smith e37e9f43b7 [modules] Store a local offset to DeclContext lexical and visible contents. Saves a few bytes for each primary DeclContext.
llvm-svn: 264377
2016-03-25 01:17:43 +00:00
Duncan P. N. Exon Smith f72d5b608d CGLoopInfo: Use the MD_loop metadata kind from r264371, NFC
Besides a small compile-time speedup, there should be no real
functionality change here.

llvm-svn: 264372
2016-03-25 00:38:14 +00:00
Adrian Prantl 53058380bb Debug Info: Add a testcase for the bug introduced by r259975.
In r259975 we rauw'ed the scope of enum declarations without taking into
account that DIBuilder strips out scope references that point to the
DICompileUnit to facilitate type uniquing.

This testcase guards against making the same mistake again.
<rdar://problem/25078246>

llvm-svn: 264366
2016-03-25 00:20:35 +00:00
Richard Smith 95853077c3 Fix nondeterminism in computation of builtin operator overload sets.
llvm-svn: 264363
2016-03-25 00:08:53 +00:00
Richard Smith d07268c528 [modules] Store offset to LOCAL_REDECLARATIONS record relative to the current
record rather than relative to the start of the bitcode file. Saves a couple of
bytes per LOCAL_REDECLARATIONS record (also makes diffs of llvm-bcanalyzer
output more useful when tracking down nondeterminism...).

llvm-svn: 264359
2016-03-24 23:41:14 +00:00
Easwaran Raman 8160812e26 Attach profile summary information to Module.
Differential Revision: http://reviews.llvm.org/D18289

llvm-svn: 264342
2016-03-24 21:32:25 +00:00
Reid Kleckner 00381aa142 Revert "Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)."
This reverts commit r264281.

This change breaks building Chromium for iOS. We'll upload a reproducer
to the PR soon.

llvm-svn: 264333
2016-03-24 20:38:43 +00:00
Richard Smith 6642bb3337 Change ADL to produce lookup results in a deterministic order. This fixes some
rare issues with nondeterministic diagnostic order, and some very common issues
with nondeterministic module builds.

llvm-svn: 264323
2016-03-24 19:12:22 +00:00
Etienne Bergeron e8ae26fb34 Fix a missing comma between two string literals.
Summary:
The two literals are currently appended.

I'm not sure what was broken by this. Please double check carefully.

Silly bug found by an on-going checker for clang-tidy.

Reviewers: alexfh, arsenm, rnk

Subscribers: cfe-commits

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

llvm-svn: 264315
2016-03-24 18:29:24 +00:00
Eric Liu c13ca6a950 Dsiable FormatStyle::GetStyleOfFile test case for mingw.
llvm-svn: 264289
2016-03-24 14:59:39 +00:00
Amjad Aboud abb04956b6 Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 (the fix is included in this commit).

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

llvm-svn: 264281
2016-03-24 13:30:41 +00:00
Eric Liu 547d87912a Added support for different VFSs in format::getStyle. Disable platform-related test case for MS compilers to avoid breaking buildbot.
llvm-svn: 264277
2016-03-24 13:22:42 +00:00
Eric Liu d47583232a Revert "Added support for different VFSs in format::getStyle."
This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

llvm-svn: 264276
2016-03-24 13:22:37 +00:00
Eric Liu 295915ceb7 Revert "removed redundant comment in format::getStyle."
This reverts commit r264254.

llvm-svn: 264275
2016-03-24 13:22:28 +00:00
Aaron Ballman bcf13da98e Fix Sphinx errors with documentation build.
llvm-svn: 264263
2016-03-24 12:34:44 +00:00
Eric Liu 6b47faad53 Revert "Added support for different VFSs in format::getStyle."
This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

llvm-svn: 264257
2016-03-24 11:25:28 +00:00
Eric Liu b38a9e16bb Revert "removed redundant comment in format::getStyle."
This reverts commit r264254.

llvm-svn: 264256
2016-03-24 11:24:49 +00:00
Eric Liu 883df1782e removed redundant comment in format::getStyle.
llvm-svn: 264254
2016-03-24 10:50:26 +00:00
Eric Liu b72f6098df Added support for different VFSs in format::getStyle.
Summary:
Previously, format::getStyle assumes that the given file resides in
the real file system, which prevents the use of virtual file system in testing etc.
This patch adds a parameter in format::getStyle interface so that users can specify
the right file system. By default, the file system is the real file system.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

llvm-svn: 264253
2016-03-24 10:50:17 +00:00
Eric Liu 8c6f72f790 Test commit access to clang repo.
Summary: Test commit access to clang repo.

Reviewers: cfe-commits

Subscribers: klimek

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

llvm-svn: 264252
2016-03-24 10:21:00 +00:00
Xiuli Pan 972bea8a2e [OpenCL] Add ocl and spir version for spir target
Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version. 

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits, pekka.jaaskelainen

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

llvm-svn: 264241
2016-03-24 03:57:17 +00:00
Eric Christopher 37df19ebee Add release notes for the removal of the silent include of altivec.h.
llvm-svn: 264236
2016-03-24 01:28:25 +00:00
Eric Christopher 4650272310 The time when -faltivec (or, on clang only, -maltivec) will magically
include altivec.h has come and gone.

Rationale: This causes modules, rewrite-includes, etc to be sad and
people should just include altivec.h in their source.

llvm-svn: 264235
2016-03-24 01:26:08 +00:00
Mike Spertus 8758c9ddad Display const/volatile/restrict qualifiers in Visual Studio visualizations
llvm-svn: 264229
2016-03-24 00:38:54 +00:00
Eric Christopher 0945a64767 Modules builds are necessarily compile actions, but they don't
necessarily produce object files. Turn off split dwarf if we're not
producing a file that the driver believes is an object file.

llvm-svn: 264227
2016-03-24 00:34:02 +00:00
JF Bastien f828bba5bf NFC: clarify comment on lock-free macros
Used by both libstdc++ and libc++.

llvm-svn: 264226
2016-03-24 00:20:44 +00:00
Vedant Kumar cbfe7bb72e Fix a typo, Tiles -> Files, NFC
llvm-svn: 264218
2016-03-23 23:51:36 +00:00
Nico Weber 9a95275132 clang-cl: Add a FIXME for bumping the default msc version.
llvm-svn: 264216
2016-03-23 23:26:59 +00:00
Nico Weber dde29407c4 Fix typo in test from r264210, sigh.
(The test passes both with and without this change, but it's confusing without
it.)

llvm-svn: 264211
2016-03-23 23:01:38 +00:00
Nico Weber fbe3adf10e clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
Remove tests that have neither a triple nor an explicit -fmsc-version flag,
since in the absence of an -fmsc-version flag, the implicit value of the flag
is 17 (MSVC2013) with MSVC triples but 0 (not set) for other triples, and
the default triple is platform dependent.

This relands r263974 with a test fix.

llvm-svn: 264210
2016-03-23 22:57:55 +00:00
Justin Lebar e5eed04d52 [CUDA] Merge most of CodeGenCUDA/function-overload.cu into SemaCUDA/function-overload.cu.
Summary:
Previously we were using the codegen test to ensure that we choose the
right overload.  But we can do this within sema, with a bit of
cleverness.

I left the constructor/destructor checks in CodeGen, because these
overloads (particularly on the destructors) are hard to check in Sema.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 264207
2016-03-23 22:42:30 +00:00
Justin Lebar e82caa3055 [CUDA] Simplify SemaCUDA/function-overload.cu test.
Summary:
Principally, don't hardcode the line numbers of various notes.  This
lets us make changes to the test without recomputing linenos everywhere.

Instead, just tell -verify that we may get 0 or more notes pointing to
the relevant function definitions.  Checking that we get exactly the
right note isn't so important (and anyway is checked elsewhere).

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 264206
2016-03-23 22:42:28 +00:00
Justin Lebar 334535132f [CUDA] Don't define __NVCC__.
Summary:
We decided this makes life too difficult for code authors.  For example,
people may want to detect NVCC and disable variadic templates, which
NVCC does not support, but which we do.

Since people are going to have to change compiler flags *anyway* in
order to compile with clang, if they really want the old behavior, they
can pass -D__NVCC__.

Tested with tensorflow and thrust, no apparent problems.

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 264205
2016-03-23 22:42:27 +00:00
Matt Arsenault 08087c52eb Add missing __builtin_bitreverse8
Also add documentation for bitreverse builtins

llvm-svn: 264203
2016-03-23 22:14:43 +00:00
Manman Ren 15325f80af ObjC: add getter/setter for class properties to global pool.
rdar://problem/25323072

llvm-svn: 264196
2016-03-23 21:39:31 +00:00
Richard Smith fd55fc86ed Make SemaAccess smarter about determining when a dependent class might
instantiate to match a friend class declaration. It's still pretty dumb,
though.

llvm-svn: 264189
2016-03-23 20:39:06 +00:00
Richard Smith c7649dc749 Make sure to perform dependent access checks when instantiating a
lambda-expression. We don't actually instantiate the closure type / operator()
in the template in order to produce the closure type / operator() in the
instantiation, so this isn't caught by the normal path.

llvm-svn: 264184
2016-03-23 20:07:07 +00:00
Nico Weber f54146c178 clang-cl: Fix remaining bugs in interaction of /Yc and /FI /showIncludes.
Instead of putting the /Yc header into ExtraDeps, give DependencyOutputOptions
a dedicated field for /Yc mode, and let HeaderIncludesCallback hang on to the
full DependencyOutputOptions object, not just ExtraDeps.

Reverts parts of r263352 that are now no longer needed.

llvm-svn: 264182
2016-03-23 18:46:57 +00:00
Nico Weber d1728f0e5f clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.
Most things even work; see the included FIXMEs for things that need polishing.

Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`.  The
common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h
is in the PCH, and we shouldn't warn about /FIh1.h not having an effect.
(If we wanted to get fancy, we could store the list of -include flags in the
pch and then check that it matches later on.)

llvm-svn: 264178
2016-03-23 18:17:02 +00:00
Nico Weber 149d9522fb clang-cl: Include /FI headers in /showIncludes output.
-H in gcc mode doesn't print -include headers, but they are included in
depfiles written by MMD and friends. Since /showIncludes is what's used instead
of depfiles, printing /FI there seems important (and matches cl.exe).

Instead of giving HeaderIncludeGen more options, just switch on ShowAllHeaders
in clang-cl mode and let clang::InitializePreprocessor() not put -include flags
in the <command line> block. This changes the behavior of -E slightly, and it
removes the <command line> flag from the output triggered by setting the
obscure CC_PRINT_HEADERS=1 env var to true while running clang. Both of these
seem ok to change.

http://reviews.llvm.org/D18401

llvm-svn: 264174
2016-03-23 18:00:22 +00:00
Faisal Vali 084c912499 [NFC] Delete an unused function parameter from a static function
llvm-svn: 264170
2016-03-23 17:39:51 +00:00
Mike Spertus 85a8abee8b Visualize fields of records as they were declared in Visual Studio debugger
llvm-svn: 264169
2016-03-23 17:29:42 +00:00
Manman Ren 6d93ad844a ObjC: Handle boolean fixed type for enum.
Before this commit, we assert failure in ImplicitCastExpr
"unheralded conversion to bool". This commit fixes the assertion by using
the correct cast type when the fixed type is boolean.

This commit also fixes the behavior for Microsoft mode as well, since
Obj-C and Microsoft mode share the same code path.

rdar://24999533

llvm-svn: 264167
2016-03-23 16:28:28 +00:00
Chih-Hung Hsieh d08918684e [analyzer] Fix typo s/initalize/initialize/
Differential Revision: http://reviews.llvm.org/D18363

llvm-svn: 264164
2016-03-23 16:14:12 +00:00
Nico Weber 9c3fca3698 clang-cl: Don't warn about /Oy- being unused in 64-bit builds.
http://reviews.llvm.org/D18392

llvm-svn: 264163
2016-03-23 15:37:41 +00:00
Alexander Kornienko 3a520349f1 Use an enum instead of hardcoded indices. NFC.
llvm-svn: 264158
2016-03-23 14:28:52 +00:00
Artyom Skrobov 59f43bbb20 Combine identical check-prefixes in Clang test/Preprocessor/arm-target-features.c
Reviewers: rengolin, t.p.northover

Subscribers: aemerson, cfe-commits, rengolin

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

llvm-svn: 264155
2016-03-23 13:32:33 +00:00
Andrey Turetskiy 5f1cf5fa66 [X86] Add "x87" in x86 target feature map.
Differential Revision: http://reviews.llvm.org/D13980

llvm-svn: 264149
2016-03-23 11:15:10 +00:00
George Burgess IV 6da4c20f7d [Sema] Allow implicit conversions of &overloaded_fn in C.
Also includes a minor ``enable_if`` docs update.

Currently, our address-of overload machinery will only allow implicit
conversions of overloaded functions to void* in C. For example:

```
void f(int) __attribute__((overloadable));
void f(double) __attribute__((overloadable, enable_if(0, "")));

void *fp = f; // OK. This is C and the target is void*.
void (*fp2)(void) = f; // Error. This is C, but the target isn't void*.
```

This patch makes the assignment of `fp2` select the `f(int)` overload,
rather than emitting an error (N.B. you'll still get a warning about the
`fp2` assignment if you use -Wincompatible-pointer-types).

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

llvm-svn: 264132
2016-03-23 02:33:58 +00:00
Chris Bieneman 3eaf5dc052 [Apple Clang] Expose llvm-config from stage2 builds in stage1
This exposes the stage2-llvm-config target though the stage1 build configuration.

llvm-svn: 264125
2016-03-23 01:47:05 +00:00
Justin Lebar d33adadb0e [CUDA] Don't allow templated variadic functions.
Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 264106
2016-03-22 22:06:19 +00:00
JF Bastien e3c13a8018 Update cxx-features test to C++1z
Forked from the following patch:
  http://reviews.llvm.org/D17950

llvm-svn: 264098
2016-03-22 21:12:48 +00:00
John Thompson debce24c90 D18325: Added mm_malloc module export.
llvm-svn: 264092
2016-03-22 20:57:51 +00:00
Justin Bogner 4d51190936 StaticAnalyzer: Avoid an unintentional copy
The range here isn't over references, so using `auto &` here incites a
copy. Switching to `auto *` would do, but we might as well list an
explicit type for clarity.

Found by -Wrange-loop-analysis.

llvm-svn: 264071
2016-03-22 17:50:05 +00:00
David Majnemer 7c31434ec3 Make build bots happy
BasicBlock's lose their names for some builders, don't mention such
names.

llvm-svn: 264066
2016-03-22 17:10:07 +00:00
David Majnemer af382652b2 [MS ABI] Assign an inheritance model for the dest of a member pointer upcast
While we correctly assigned an inheritance model for the source of a
member pointer upcast, we did not do so for the destination.

This fixes PR27030.

llvm-svn: 264065
2016-03-22 16:44:39 +00:00
Chris Bieneman 09804e275f [Perf-training] Using os.devnull instead of a temp file
This is based on post-commit feedback from Vedant. Totally didn't know that existed and worked on Windows.

Thanks Vedant!

llvm-svn: 264064
2016-03-22 16:33:23 +00:00
Chris Bieneman d4f094bb2b [Perf-training] Cleanup based on feedback from Sean Silvas
Sean provided feedback based on r257934 on cfe-commits. This change addresses that feedback.

llvm-svn: 264063
2016-03-22 16:27:35 +00:00
Daniel Jasper 8fc7a1e992 clang-format: [JS] do not wrap ES6 imports/exports.
"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.

Patch by Martin Probst.

llvm-svn: 264055
2016-03-22 14:32:20 +00:00
Alexander Kornienko 976921d4b4 [ASTMatchers] New matcher hasReturnValue added
Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue).

Reviewers: klimek, sbenza

Subscribers: xazax.hun, klimek, cfe-commits

Patch by Ádám Balogh!

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

llvm-svn: 264037
2016-03-22 11:03:03 +00:00
Vasileios Kalintiris e5c095923d Fix warning about extra semicolon. NFC.
llvm-svn: 264035
2016-03-22 10:41:20 +00:00
Akira Hatanaka 7e2c82da90 [Objective-c] Do not set IsExact to true when the receiver is a class.
IsExact shouldn't be set to true in WeakObjectProfileTy::getBaseInfo
when the receiver is a class because having a class as the receiver
doesn't guarantee that the Base is exact.

This is a follow-up to r263818.

rdar://problem/25208167

llvm-svn: 264025
2016-03-22 05:00:21 +00:00
Chris Bieneman b6f7efa71f [Perf-training] Fixing an issue with multi-threading PGO generation
When LIT parallelizes the profraw file generation we need to generate unique temp filenames then clean them up after the driver executes.

llvm-svn: 264021
2016-03-22 02:55:40 +00:00
Mike Spertus 32e9a32225 Visual Studio Native Visualizations for constructors and methods
With this change, the class

  struct A {
    A(int _i);
    ~A();
    int foo(double d);
    double bar(A *a) { return 1.3; }
  };

appears in the VS2015 Locals Window as

D              0x02dbb378 struct A
|- DeclKind    CXXRecord
|- Members
 |- [0]        implicit struct A
 |- [1]        Constructor {A(int _i)}
 |- [2]        Destructor {~A()}
 |- [3]        Method {int foo(double d)}
 |- [4]        Method {double bar(struct A *)}
|- [Raw View]  /* Other stuff */

Note that these changes only benefit VS2015 as
VS2013 does not have views and only displays the
struct name "A", but the change does no apparent
harm in VS2013, so is still a win.

llvm-svn: 264020
2016-03-22 02:29:22 +00:00
Arpith Chacko Jacob 5c309e475d [OpenMP] Base support for target directive codegen on NVPTX device.
Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

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

Reworked test case after buildbot failure on windows.
Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp.

llvm-svn: 264018
2016-03-22 01:48:56 +00:00
Justin Lebar 717d2b0a0d [CUDA] Implement atomicInc and atomicDec builtins
These functions cannot be implemented as atomicrmw or cmpxchg
instructions, so they are implemented as a call to the NVVM intrinsics
@llvm.nvvm.atomic.load.inc.32.p0i32 and
@llvm.nvvm.atomic.load.dec.32.p0i32.

Patch by Jason Henline.

Reviewers: jlebar

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

llvm-svn: 264009
2016-03-22 00:09:28 +00:00
Justin Lebar e6a2cc12a3 [sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.
Summary: NFC

Reviewers: tra

Subscribers: cfe-commits

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

llvm-svn: 264008
2016-03-22 00:09:25 +00:00