]> granicus.if.org Git - clang/log
clang
8 years agoReverting r266199; it causes build bot failures.
Aaron Ballman [Wed, 13 Apr 2016 14:53:52 +0000 (14:53 +0000)]
Reverting r266199; it causes build bot failures.

http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/3255
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/3517

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

8 years agoAdd functions declared in ctype.h to builtin function database. All functions are...
Aaron Ballman [Wed, 13 Apr 2016 13:55:58 +0000 (13:55 +0000)]
Add functions declared in ctype.h to builtin function database. All functions are annotated with nothrow and pure attribute, which enables better optimization.

Patch by Taewook Oh.

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

8 years ago[OPENMP 4.0] Fixed DSA analysis for taskloop directives.
Alexey Bataev [Wed, 13 Apr 2016 13:36:48 +0000 (13:36 +0000)]
[OPENMP 4.0] Fixed DSA analysis for taskloop directives.

Patch make clang to perform analysis for task-based directives also for
taskloop-based directives.

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

8 years ago[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruc...
Michael Zuckerman [Wed, 13 Apr 2016 12:58:01 +0000 (12:58 +0000)]
[Clang][AVX512][Builtin] Adding support for VBROADCAST and VPBROADCASTB/W/D/Q instruction set

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

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

8 years agoAdd AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl...
Alexander Kornienko [Wed, 13 Apr 2016 11:13:08 +0000 (11:13 +0000)]
Add AST Matchers for CXXConstructorDecl::isDelegatingConstructor and CXXMethodDecl::isUserProvided.

Summary: Added two AST matchers: isDelegatingConstructor for CXXConstructorDecl::IsDelegatingConstructor; and isUserProvided corresponding to CXXMethodDecl::isUserProvided.

Reviewers: aaron.ballman, alexfh

Subscribers: klimek, cfe-commits

Patch by Michael Miller!

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

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

8 years ago[Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256...
Michael Zuckerman [Wed, 13 Apr 2016 10:49:37 +0000 (10:49 +0000)]
[Clang][AVX512][Builtin] Adding supporting to intrinsics of cvt{b|d|q}2mask{128|256|512} and cvtmask2{b|d|q}{128|256|512} instruction set.

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

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

8 years ago[modules] Add OpenCLImageTypes.def to module map to fix the modules build.
Alexey Bader [Wed, 13 Apr 2016 09:54:47 +0000 (09:54 +0000)]
[modules] Add OpenCLImageTypes.def to module map to fix the modules build.

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

8 years agoEnable support for __float128 in Clang
Nemanja Ivanovic [Wed, 13 Apr 2016 09:49:45 +0000 (09:49 +0000)]
Enable support for __float128 in Clang

This patch corresponds to review:
http://reviews.llvm.org/D15120

It adds support for the __float128 keyword, literals and a target feature to
enable it. This support is disabled by default on all targets and any target
that has support for this type is free to add it.

Based on feedback that I've received from target maintainers, this appears to
be the right thing for most targets. I have not heard from the maintainers of
X86 which I believe supports this type. I will subsequently investigate the
impact of enabling this on X86.

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

8 years agoTry to use readability-identifier-naming check on Clang.
Alexander Kornienko [Wed, 13 Apr 2016 08:59:49 +0000 (08:59 +0000)]
Try to use readability-identifier-naming check on Clang.

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

8 years ago[clang-tidy] Disable misc-unused-parameters for clang.
Alexander Kornienko [Wed, 13 Apr 2016 08:47:42 +0000 (08:47 +0000)]
[clang-tidy] Disable misc-unused-parameters for clang.

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

8 years ago[OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.
Alexey Bader [Wed, 13 Apr 2016 08:33:41 +0000 (08:33 +0000)]
[OpenCL] Move OpenCLImageTypes.def from clangAST to clangBasic library.

Putting OpenCLImageTypes.def to clangAST library violates layering requirement: "It's not OK for a Basic/ header to include an AST/ header".
This fixes the modules build.

Differential revision: http://reviews.llvm.org/D18954
Reviewers: Richard Smith, Vassil Vassilev.

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

8 years agoconstexpr -> const to appease MSVC bots.
Richard Smith [Wed, 13 Apr 2016 07:47:38 +0000 (07:47 +0000)]
constexpr -> const to appease MSVC bots.

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

8 years agoASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. [-Wdocument...
NAKAMURA Takumi [Wed, 13 Apr 2016 07:45:10 +0000 (07:45 +0000)]
ASTWriterDecl.cpp: Prune a couple of \param(s), corresponding to r266160. [-Wdocumentation]

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

8 years ago[modules] Add some missing blockinfo records. No functionality change except to llvm...
Richard Smith [Wed, 13 Apr 2016 07:41:35 +0000 (07:41 +0000)]
[modules] Add some missing blockinfo records. No functionality change except to llvm-bcanalyzer output.

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

8 years ago[PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st intrinsics...
Chuang-Yu Cheng [Wed, 13 Apr 2016 05:16:31 +0000 (05:16 +0000)]
[PPC64][VSX] Add a couple of new data types for vec_vsx_ld and vec_vsx_st intrinsics and fix incorrect testcases with minor refactoring

New added data types:
  vector double vec_vsx_ld (int, const double *);
  vector float vec_vsx_ld (int, const float *);
  vector bool short vec_vsx_ld (int, const vector bool short *);
  vector bool int vec_vsx_ld (int, const vector bool int *);
  vector signed int vec_vsx_ld (int, const signed int *);
  vector unsigned int vec_vsx_ld (int, const unsigned int *);

  void vec_vsx_st (vector double, int, double *);
  void vec_vsx_st (vector float, int, float *);
  void vec_vsx_st (vector bool short, int, vector bool short *);
  void vec_vsx_st (vector bool short, int, signed short *);
  void vec_vsx_st (vector bool short, int, unsigned short *);
  void vec_vsx_st (vector bool int, int, vector bool int *);
  void vec_vsx_st (vector bool int, int, signed int *);
  void vec_vsx_st (vector bool int, int, unsigned int *);

Also fix testcases which use non-vector argument version of vec_vsx_ld or
vec_vsx_st, but pass incorrect parameter.

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

8 years ago[modules] Refactor handling of cases where we write an offset to a prior record into...
Richard Smith [Wed, 13 Apr 2016 02:12:03 +0000 (02:12 +0000)]
[modules] Refactor handling of cases where we write an offset to a prior record into the bitstream and simplify a little, in preparation for doing this in more cases.

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

8 years ago[analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.
Devin Coughlin [Wed, 13 Apr 2016 00:41:54 +0000 (00:41 +0000)]
[analyzer] Nullability: Treat nil _Nonnull ivar as invariant violation.

Treat a _Nonnull ivar that is nil as an invariant violation in a similar
fashion to how a nil _Nonnull parameter is treated as a precondition violation.

This avoids warning on defensive returns of nil on defensive internal
checks, such as the following common idiom:

@class InternalImplementation
@interface PublicClass {
  InternalImplementation * _Nonnull _internal;
}
-(id _Nonnull)foo;
@end

@implementation PublicClass
-(id _Nonnull)foo {
  if (!_internal)
    return nil; // no-warning

  return [_internal foo];
}
@end

rdar://problem/24485171

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

8 years agoclang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.
NAKAMURA Takumi [Wed, 13 Apr 2016 00:22:25 +0000 (00:22 +0000)]
clang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.

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

8 years ago[ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before
Akira Hatanaka [Tue, 12 Apr 2016 23:10:58 +0000 (23:10 +0000)]
[ObjC] Pop all cleanups created in EmitObjCForCollectionStmt before
exiting the for-in loop.

This commit fixes a bug where EmitObjCForCollectionStmt didn't pop
cleanups for captures.

For example, in the following for-in loop, a block which captures self
is passed to foo1:

for (id x in [self foo1:^{ use(self); }]) {
  use(x);
  break;
}

Previously, the code in EmitObjCForCollectionStmt wouldn't pop the
cleanup for the captured self before exiting the loop, which caused
code-gen to generate an IR in which objc_release was called twice on
the captured self.

This commit fixes the bug by entering a RunCleanupsScope before the
loop condition is evaluated and forcing its cleanup before exiting the
loop.

rdar://problem/16865751

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

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

8 years agoObjC class properties: add diagnostics for unimplemented class properties.
Manman Ren [Tue, 12 Apr 2016 23:01:55 +0000 (23:01 +0000)]
ObjC class properties: add diagnostics for unimplemented class properties.

rdar://24711047

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

8 years ago[AMDGPU] Add debugger related target options
Konstantin Zhuravlyov [Tue, 12 Apr 2016 21:42:15 +0000 (21:42 +0000)]
[AMDGPU] Add debugger related target options

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

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

8 years agoAdd a fixme for an old patch I had lying around that I'm not going to finish any...
David Blaikie [Tue, 12 Apr 2016 21:22:48 +0000 (21:22 +0000)]
Add a fixme for an old patch I had lying around that I'm not going to finish any time so n

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

8 years agoAlways use --eh-frame-hdr on FreeBSD, even for -static
Ed Maste [Tue, 12 Apr 2016 21:11:46 +0000 (21:11 +0000)]
Always use --eh-frame-hdr on FreeBSD, even for -static

FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and is expected to
use it more widely in the future), and it requires the EH frame segment
in static binaries.

This is the same as r203742 for NetBSD.

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

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

8 years agoAdd a couple of missing vsx load and store intrinsics.
Eric Christopher [Tue, 12 Apr 2016 21:08:54 +0000 (21:08 +0000)]
Add a couple of missing vsx load and store intrinsics.

Patch by Jing Yu!

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

8 years agoPass -backend-option to LLVM when there is no target machine.
Yaxun Liu [Tue, 12 Apr 2016 20:22:32 +0000 (20:22 +0000)]
Pass -backend-option to LLVM when there is no target machine.

Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR.

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

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

8 years ago[modules] Extend r266113 to cope with submodules.
Richard Smith [Tue, 12 Apr 2016 20:20:33 +0000 (20:20 +0000)]
[modules] Extend r266113 to cope with submodules.

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

8 years ago[modules] When an incompatible module file is explicitly provided for a module,
Richard Smith [Tue, 12 Apr 2016 19:58:30 +0000 (19:58 +0000)]
[modules] When an incompatible module file is explicitly provided for a module,
and we fall back to textual inclusion, don't require the module as a whole to
be marked available; it's OK if some other file in the same module is missing,
just as it would be if the header were explicitly marked textual.

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

8 years agoPR19957: [OpenCL] Incorrectly accepts implicit address space conversion with ternary...
Yaxun Liu [Tue, 12 Apr 2016 19:43:36 +0000 (19:43 +0000)]
PR19957: [OpenCL] Incorrectly accepts implicit address space conversion with ternary operator.

Generates addrspacecast instead of bitcast for ternary operator when necessary, and diagnose ternary operator with incompatible second and third operands.

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

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

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

8 years ago[analyzer] Nullability: Suppress return diagnostics in inlined functions.
Devin Coughlin [Tue, 12 Apr 2016 19:29:52 +0000 (19:29 +0000)]
[analyzer] Nullability: Suppress return diagnostics in inlined functions.

The nullability checker can sometimes miss detecting nullability precondition
violations in inlined functions because the binding for the parameter
that violated the precondition becomes dead before the return:

int * _Nonnull callee(int * _Nonnull p2) {
  if (!p2)
    // p2 becomes dead here, so binding removed.
    return 0; // warning here because value stored in p2 is symbolic.
  else
   return p2;
}

int *caller(int * _Nonnull p1) {
  return callee(p1);
}

The fix, which is quite blunt, is to not warn about null returns in inlined
methods/functions. This won’t lose much coverage for ObjC because the analyzer
always analyzes each ObjC method at the top level in addition to inlined. It
*will* lose coverage for C — but there aren’t that many codebases with C
nullability annotations.

rdar://problem/25615050

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

8 years agoclang-cl: Remove -isystem, add -imsvc.
Nico Weber [Tue, 12 Apr 2016 19:04:37 +0000 (19:04 +0000)]
clang-cl: Remove -isystem, add -imsvc.

r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of
the system include search path. The idea was to use this to point to a hermetic
msvc install, but as it turns out this doesn't work: -isystem then adds the
hermetic headers in front of clang's builtin headers, and clang's headers that
are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all
anymore.

So revert that, and instead expose -imsvc which works as if the passed
directory was part of %INCLUDE%: The header is treated as a system header, but
it is searched after clang's lib/Header headers.

Fixes half of PRPR26751.

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

8 years ago[OpenCL] Handle AddressSpaceConversion when target address space does not change.
Yaxun Liu [Tue, 12 Apr 2016 19:03:49 +0000 (19:03 +0000)]
[OpenCL] Handle AddressSpaceConversion when target address space does not change.

In codegen different address spaces may be mapped to the same address
space for a target, e.g. in x86/x86-64 all address spaces are mapped
to 0. Therefore AddressSpaceConversion should be translated by
CreatePointerBitCastOrAddrSpaceCast instead of CreateAddrSpaceCast.

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

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

8 years agoStricter checks in the stack-protector codegen test.
Evgeniy Stepanov [Tue, 12 Apr 2016 17:51:59 +0000 (17:51 +0000)]
Stricter checks in the stack-protector codegen test.

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

8 years agoRevert 266090, needs more testing first.
Nico Weber [Tue, 12 Apr 2016 16:52:30 +0000 (16:52 +0000)]
Revert 266090, needs more testing first.

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

8 years agoclang-cl: Expose -nostdlibinc.
Nico Weber [Tue, 12 Apr 2016 16:38:07 +0000 (16:38 +0000)]
clang-cl: Expose -nostdlibinc.

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

8 years ago[FileManager] Don't crash if reading from stdin and stat(".") fails
David Majnemer [Tue, 12 Apr 2016 16:33:53 +0000 (16:33 +0000)]
[FileManager] Don't crash if reading from stdin and stat(".") fails

addAncestorsAsVirtualDirs("<stdin>") quickly returns without doing work
because "<stdin>" has no parent_path.  This violates the expectation
that a subsequent call to getDirectoryFromFile("<stdin>") would succeed.
Instead, it fails because it uses the "." if the file has no path
component.

Fix this by keeping the behavior between addAncestorsAsVirtualDirs and
getDirectoryFromFile symmetric.

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

8 years agoVerify commit right by adding a blank line to test/CodeGenOpenCL/address-spaces-conve...
Yaxun Liu [Tue, 12 Apr 2016 15:46:24 +0000 (15:46 +0000)]
Verify commit right by adding a blank line to test/CodeGenOpenCL/address-spaces-conversions.cl.

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

8 years agoMoving clang-test-depends into the Clang tests folder and moving vtables_blacklist...
Aaron Ballman [Tue, 12 Apr 2016 15:09:17 +0000 (15:09 +0000)]
Moving clang-test-depends into the Clang tests folder and moving vtables_blacklist into the Misc folder; NFC, this simply cleans up the generated solution so that these targets don't live in the root folder of the IDE.

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

8 years agoRemove unused diagnostics. NFC.
Benjamin Kramer [Tue, 12 Apr 2016 11:49:52 +0000 (11:49 +0000)]
Remove unused diagnostics. NFC.

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

8 years ago[OPENMP 4.0] Support for 'linear' clause in 'declare simd' directive.
Alexey Bataev [Tue, 12 Apr 2016 11:02:11 +0000 (11:02 +0000)]
[OPENMP 4.0] Support for 'linear' clause in 'declare simd' directive.

The linear clause declares one or more list items to be private to a SIMD lane and to have a linear relationship with respect to the iteration space of a loop.
'linear' '(' <linear-list> [ ':' <linear-step> ] ')'
When a linear-step expression is specified in a linear clause it must be
either a constant integer expression or an integer-typed parameter that is specified in a uniform clause on the directive.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.

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

8 years ago[OPENMP 4.0] Support for 'aligned' clause in 'declare simd' directive.
Alexey Bataev [Tue, 12 Apr 2016 09:35:56 +0000 (09:35 +0000)]
[OPENMP 4.0] Support for 'aligned' clause in 'declare simd' directive.

The aligned clause declares that the object to which each list item points is aligned to the number of bytes expressed in the optional parameter of the aligned clause.
'aligned' '(' <argument-list> [ ':' <alignment> ] ')'
The optional parameter of the aligned clause, alignment, must be a constant positive integer expression. If no optional parameter is specified, implementation-defined default alignments for SIMD instructions on the target platforms are assumed.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.

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

8 years ago[Clang][BuiltIn][avx512] Adding avx512 (shuf,sqrt{ss|sd},rsqrt ) builtin to clang
Michael Zuckerman [Tue, 12 Apr 2016 07:59:39 +0000 (07:59 +0000)]
[Clang][BuiltIn][avx512] Adding avx512 (shuf,sqrt{ss|sd},rsqrt ) builtin to clang

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

8 years ago[ASTMatchers]: fix crash in hasReturnValue
Matthias Gehre [Tue, 12 Apr 2016 05:43:18 +0000 (05:43 +0000)]
[ASTMatchers]: fix crash in hasReturnValue

Summary:
The crash was reproduced by the included test case. It was initially
found through a crash of clang-tidy's misc-misplaced-widening-cast
check.

Reviewers: klimek, alexfh

Subscribers: cfe-commits, klimek

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

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

8 years ago[OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.
Alexey Bataev [Tue, 12 Apr 2016 05:28:34 +0000 (05:28 +0000)]
[OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.

OpenMP 4.0 defines clause 'uniform' in 'declare simd' directive:
'uniform' '(' <argument-list> ')'
The uniform clause declares one or more arguments to have an invariant value for all concurrent invocations of the function in the execution of a single SIMD loop.
The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses.

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

8 years agoBasic: fix profiling with GNU EABI
Saleem Abdulrasool [Tue, 12 Apr 2016 03:05:03 +0000 (03:05 +0000)]
Basic: fix profiling with GNU EABI

The GNU profiling support indicates that the interface is `_mcount` rather than
`mcount`.  Conditionalise the behaviour according to the `-meabi gnu` flag.

Resolves PR27311

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

8 years ago[analyzer] Fix assertion in ReturnVisitor for body-farm synthesized getters
Devin Coughlin [Tue, 12 Apr 2016 00:53:26 +0000 (00:53 +0000)]
[analyzer] Fix assertion in ReturnVisitor for body-farm synthesized getters
Don't emit a path note marking the return site if the return statement does not
have a valid location. This fixes an assertion failure I introduced in r265839.

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

8 years agoAllow simultaneous safestack and stackprotector attributes.
Evgeniy Stepanov [Mon, 11 Apr 2016 22:27:55 +0000 (22:27 +0000)]
Allow simultaneous safestack and stackprotector attributes.

This is the clang part of http://reviews.llvm.org/D18846.
SafeStack instrumentation pass adds stack protector canaries if both
attributes are present on a function. StackProtector pass will step
back if the function has a safestack attribute.

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

8 years agolibclang: fix two memory leaks (PR26292)
Hans Wennborg [Mon, 11 Apr 2016 20:53:59 +0000 (20:53 +0000)]
libclang: fix two memory leaks (PR26292)

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

8 years agoAdjust tests to have consistent integer sizes.
Richard Trieu [Mon, 11 Apr 2016 20:37:04 +0000 (20:37 +0000)]
Adjust tests to have consistent integer sizes.

Add a triple to the run lines so that integers will the same sizes across runs.
Also add a compile time check to ensure the assumptions about sizes are met.

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

8 years agoLit C++11 Compatibility Patch #6
Charles Li [Mon, 11 Apr 2016 19:30:25 +0000 (19:30 +0000)]
Lit C++11 Compatibility Patch #6

Updated the expected diagnostics of 17 OpenMP tests.
The changes to each test are identical.

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

8 years agoEmit the module hash by default with -flto=thin.
Mehdi Amini [Mon, 11 Apr 2016 18:45:20 +0000 (18:45 +0000)]
Emit the module hash by default with -flto=thin.

Reviewers: tejohnson

Subscribers: joker.eph, cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( psll{d|q}512,psllv{16si|8di},psra{d|q}512...
Michael Zuckerman [Mon, 11 Apr 2016 17:04:21 +0000 (17:04 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( psll{d|q}512,psllv{16si|8di},psra{d|q}512,psrav{16si|8di},pternlog{d|q}{128|256|512} ) builtin to clang

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

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

8 years agoUpdate getting started docs
Reid Kleckner [Mon, 11 Apr 2016 17:02:34 +0000 (17:02 +0000)]
Update getting started docs

compiler-rt is optional. We often get email from users with compiler-rt
build errors who don't actually need compiler-rt. Marking it optional
should help them avoid those potential problems.

While I'm here, update a reference to the build directory and remove an
obsolete reference to llvm-gcc. Nobody today is under the impression
that Clang depends on GCC.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin
Michael Zuckerman [Mon, 11 Apr 2016 15:46:39 +0000 (15:46 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( punpck{h|l}{dq|qdq}{128|256|512},rndscale...
Michael Zuckerman [Mon, 11 Apr 2016 12:32:31 +0000 (12:32 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( punpck{h|l}{dq|qdq}{128|256|512},rndscale{ss|sd}, {scalef{ss|sd|pd512|ps512} ) builtin to clang

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

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

8 years ago[clang-format] Walk backwards from end() instead of forwards from rend().
Benjamin Kramer [Mon, 11 Apr 2016 12:19:19 +0000 (12:19 +0000)]
[clang-format] Walk backwards from end() instead of forwards from rend().

This should've been forwards from rbegin(), reverse iterators are just
too confusing to be used by mere mortals. Fixes out-of-bounds walks over
the list.

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( ptest{n}m{b|w}{128|256|512} ) builtin to...
Michael Zuckerman [Mon, 11 Apr 2016 10:22:07 +0000 (10:22 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( ptest{n}m{b|w}{128|256|512} ) builtin to clang

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

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

8 years agoDon't clutter the test directory with temporary IR files.
Benjamin Kramer [Mon, 11 Apr 2016 10:16:37 +0000 (10:16 +0000)]
Don't clutter the test directory with temporary IR files.

-emit-llvm emits a file, -emit-llvm-only doesn't.

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

8 years agoclang-format: [JS] Test for parameter annotations.
Martin Probst [Mon, 11 Apr 2016 09:17:57 +0000 (09:17 +0000)]
clang-format: [JS] Test for parameter annotations.

Summary: Just to ensure no regressions, this already works fine.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years agoRemove redundant conditions of the form (A || (!A && B)) -> (A || B)
Benjamin Kramer [Mon, 11 Apr 2016 08:26:13 +0000 (08:26 +0000)]
Remove redundant conditions of the form (A || (!A && B)) -> (A || B)

Found by cppcheck! PR27286 PR27287 PR27288 PR27289

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

8 years ago[GCC] Attribute ifunc support in clang
Dmitry Polukhin [Mon, 11 Apr 2016 07:48:59 +0000 (07:48 +0000)]
[GCC] Attribute ifunc support in clang

This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. LLVM
patch http://reviews.llvm.org/D15525

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

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

8 years agoclang-format: [JS] do not insert semicolons after wrapped annotations.
Martin Probst [Mon, 11 Apr 2016 07:35:57 +0000 (07:35 +0000)]
clang-format: [JS] do not insert semicolons after wrapped annotations.

Reviewers: djasper

Subscribers: klimek

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, vpermil{var}{ps|pd}{256...
Michael Zuckerman [Mon, 11 Apr 2016 07:15:34 +0000 (07:15 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, vpermil{var}{ps|pd}{256|512} ) builtin to clang.

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clang
Michael Zuckerman [Sun, 10 Apr 2016 17:24:03 +0000 (17:24 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clang

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

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

8 years agoCorrect pg instrumentation for AArch64
Saleem Abdulrasool [Sun, 10 Apr 2016 14:29:55 +0000 (14:29 +0000)]
Correct pg instrumentation for AArch64

It seems that there was a miscommunication between Renato and I, and the
original behaviour of AArch64 was to be preserved and not to mirror the new
behaviour.  Restore the original behaviour for AArch64.  Addresses post-commit
review comments from Renato Golin.

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

8 years agoAdding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to...
Michael Zuckerman [Sun, 10 Apr 2016 12:54:23 +0000 (12:54 +0000)]
Adding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to clang

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

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

8 years ago[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang
Michael Zuckerman [Sun, 10 Apr 2016 10:51:04 +0000 (10:51 +0000)]
[Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang

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

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

8 years agotest: add additional tests for SVN r265888
Saleem Abdulrasool [Sun, 10 Apr 2016 03:31:09 +0000 (03:31 +0000)]
test: add additional tests for SVN r265888

Add test cases for AArch64 as well as that was changed as part of that change.

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

8 years agoAdd support for __gnu_mcount_nc as the pg interface
Saleem Abdulrasool [Sun, 10 Apr 2016 03:19:47 +0000 (03:19 +0000)]
Add support for __gnu_mcount_nc as the pg interface

This adds support to optionally support using `__gnu_mcount_nc` as the mcount
interface rather than `mcount` for Linux and EABI.  The other targets do not
provide an implementation for `__gnu_mcount_nc`.  This can be activated via the
`-meabi gnu` flag.

Resolves PR23969.

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

8 years agoBasic: thread TargetOptions into TargetInfo
Saleem Abdulrasool [Sat, 9 Apr 2016 19:09:25 +0000 (19:09 +0000)]
Basic: thread TargetOptions into TargetInfo

This threads TargetOptions into the TargetInfo hierarchy.  This is a rework of
the original attempt to thread additional information into the TargetInfo to
make decisions based on additional ABI related options.

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

8 years agoObjC kindof: check the context when inserting methods to global pool.
Manman Ren [Sat, 9 Apr 2016 18:59:48 +0000 (18:59 +0000)]
ObjC kindof: check the context when inserting methods to global pool.

To make kindof lookup work, we need to insert methods with different
context into the global pool, even though they have the same siganture.

Since diagnosis of availability is performed on the best candidate,
which is often the first candidate from the global pool, we prioritize
the methods that are unavaible or deprecated to the head of the list.

Since we now have more methods in the global pool, we need to watch
out for performance impact.

rdar://25635831

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

8 years ago[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS
Nathan Wilson [Sat, 9 Apr 2016 02:55:27 +0000 (02:55 +0000)]
[Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS

Summary: A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition.

Reviewers: rsmith, hubert.reinterpretcast, faisalv, aaron.ballman

Subscribers: cfe-commits

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

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

8 years ago[Perf-Training] Reworked workflow improvements for order-file generation
Chris Bieneman [Fri, 8 Apr 2016 22:48:18 +0000 (22:48 +0000)]
[Perf-Training] Reworked workflow improvements for order-file generation

This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64.

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

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

8 years agoUse NoDebug compile units to mark debug metadata used only for sample-based
Adrian Prantl [Fri, 8 Apr 2016 22:43:06 +0000 (22:43 +0000)]
Use NoDebug compile units to mark debug metadata used only for sample-based
profiling and optimization remarks and indicate that no debug info shall
be emitted for these compile units.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

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

8 years agoRemove unused functions from ASTWriter interface.
Richard Smith [Fri, 8 Apr 2016 21:54:32 +0000 (21:54 +0000)]
Remove unused functions from ASTWriter interface.

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

8 years agoPR25501: Delay loading visible updates for a declaration until after we've
Richard Smith [Fri, 8 Apr 2016 20:53:26 +0000 (20:53 +0000)]
PR25501: Delay loading visible updates for a declaration until after we've
processed update records. If an update record adds a definition, we need to
merge that with any pre-existing definition to determine which the canonical
definition is before we apply the visible update, otherwise we wouldn't know
where to apply it.

Thanks to Vassil Vassilev for help reducing this and tracking down the problem.

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

8 years agoAdd doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics...
Ekaterina Romanova [Fri, 8 Apr 2016 20:45:48 +0000 (20:45 +0000)]
Add doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson.

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

8 years ago[analyzer] Teach trackNullOrUndefValue about calls to property accessors.
Devin Coughlin [Fri, 8 Apr 2016 19:59:16 +0000 (19:59 +0000)]
[analyzer] Teach trackNullOrUndefValue about calls to property accessors.

Teach trackNullOrUndefValue() how to look through PseudoObjectExprs to find
the underlying method call for property getters. This makes over-suppression
of 'return nil' in getters consistent with the similar over-suppression for
method and function calls.

rdar://problem/24437252

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

8 years ago[modules] Handle merged fields in designated initializers.
Richard Smith [Fri, 8 Apr 2016 19:57:40 +0000 (19:57 +0000)]
[modules] Handle merged fields in designated initializers.

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

8 years agoAlways have clang pass -pie-level and -pic-level values to the code generator.
Wei Mi [Fri, 8 Apr 2016 17:42:32 +0000 (17:42 +0000)]
Always have clang pass -pie-level and -pic-level values to the code generator.

Patch by tmsriram!

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

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

8 years agoMove EABIVersion from CodeGenOptions to TargetOptions
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:05 +0000 (16:52 +0000)]
Move EABIVersion from CodeGenOptions to TargetOptions

It is possible to argue that the EABIVersion field is similar in spirit to the
ABI field in TargetOptions.  It represents the embedded ABI that the target
follows.  This will allow us to thread this information into the target
information construction.

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

8 years agorevert SVN r265702, r265640
Saleem Abdulrasool [Fri, 8 Apr 2016 16:52:00 +0000 (16:52 +0000)]
revert SVN r265702, r265640

Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

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

8 years ago[OpenCL] Complete image types support.
Alexey Bader [Fri, 8 Apr 2016 13:40:33 +0000 (13:40 +0000)]
[OpenCL] Complete image types support.

I. Current implementation of images is not conformant to spec in the following points:
  1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine:

        void write_image(write_only image2d_t img);
        kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code

     which is disallowed according to s6.13.14.

  2. It discards access qualifier on generated code, which leads to generated code for the above example:

        call void @write_image(%opencl.image2d_t* %img);

     In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images.
     Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently.

  3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names.
  4. Default access qualifier read_only is to be added if not provided explicitly.

II. This patch corrects the above points as follows:
  1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type.
  2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers).
  3. Improves testing of images in Clang.

Author: Anastasia Stulova
Reviewers: bader, mgrang.
Subscribers: pxli168, pekka.jaaskelainen, yaxunl.
Differential Revision: http://reviews.llvm.org/D17821

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

8 years agoSilencing a 32-bit shift implicit conversion warning from MSVC; NFC.
Aaron Ballman [Fri, 8 Apr 2016 12:21:58 +0000 (12:21 +0000)]
Silencing a 32-bit shift implicit conversion warning from MSVC; NFC.

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

8 years agoAdapt to LLVM API change
Sanjoy Das [Fri, 8 Apr 2016 01:31:02 +0000 (01:31 +0000)]
Adapt to LLVM API change

Replace mayBeOverridden with isInterposable

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

8 years ago[modules] Add a comment to explain why -E leaves some #includes in the preprocessed...
Richard Smith [Fri, 8 Apr 2016 01:23:59 +0000 (01:23 +0000)]
[modules] Add a comment to explain why -E leaves some #includes in the preprocessed output.

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

8 years ago[modules] Don't write @import in -E output if the current language mode doesn't
Richard Smith [Fri, 8 Apr 2016 00:09:53 +0000 (00:09 +0000)]
[modules] Don't write @import in -E output if the current language mode doesn't
support @import; use the form as written instead.

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

8 years ago[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.
Justin Lebar [Thu, 7 Apr 2016 23:55:53 +0000 (23:55 +0000)]
[CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.

Summary:
See comments in patch; we were assuming that some stdlib math functions
would be defined in namespace std, when in fact the spec says they
should be defined in the global namespace.  libstdc++4.9 became more
conforming and broke us.

This new implementation seems to cover the known knowns.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

8 years agoReplace Sema-level implementation of -fassume-sane-operator-new with a
Richard Smith [Thu, 7 Apr 2016 21:46:12 +0000 (21:46 +0000)]
Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.

This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).

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

8 years ago[modules] Allow differences in flags that only affect preprocessor predefines
Richard Smith [Thu, 7 Apr 2016 20:47:37 +0000 (20:47 +0000)]
[modules] Allow differences in flags that only affect preprocessor predefines
(and __has_feature checks) between explicitly-specified module files and the
current compilation.

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

8 years ago[ObjC kindof] Use type bound to filter out the candidate methods.
Manman Ren [Thu, 7 Apr 2016 19:32:24 +0000 (19:32 +0000)]
[ObjC kindof] Use type bound to filter out the candidate methods.

rdar://21306753

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

8 years agoNFC: simplify code in BuildInstanceMessage.
Manman Ren [Thu, 7 Apr 2016 19:30:20 +0000 (19:30 +0000)]
NFC: simplify code in BuildInstanceMessage.

Instead of searching the global pool multiple times: in
LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool,
CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool,
we now collect the method candidates in CollectMultipleMethodsInGlobalPool
only, and other functions will use the collected method set.

This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool,
and SelectBestMethod. It also changes the implementation of
CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is
found, to collect the other kind. This avoids the need to call both
LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool.

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

8 years agoBasic: move CodeGenOptions from Frontend
Saleem Abdulrasool [Thu, 7 Apr 2016 17:49:44 +0000 (17:49 +0000)]
Basic: move CodeGenOptions from Frontend

This is a mechanical move of CodeGenOptions from libFrontend to libBasic.  This
fixes the layering violation introduced earlier by threading CodeGenOptions into
TargetInfo.  It should also fix the modules based self-hosting builds.  NFC.

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

8 years agoMinor Wdocumentation fix. NFCI.
Simon Pilgrim [Thu, 7 Apr 2016 17:38:24 +0000 (17:38 +0000)]
Minor Wdocumentation fix. NFCI.

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

8 years agoFixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177
Michael Zuckerman [Thu, 7 Apr 2016 14:44:08 +0000 (14:44 +0000)]
Fixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177

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

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

8 years agomake __builtin_isfinite more efficient (PR27145)
Sanjay Patel [Thu, 7 Apr 2016 14:29:05 +0000 (14:29 +0000)]
make __builtin_isfinite more efficient (PR27145)

isinf (is infinite) and isfinite should be implemented with the same function
except we change the comparison operator.

See PR27145 for more details:
https://llvm.org/bugs/show_bug.cgi?id=27145

Ref: forked off of the discussion in D18513.

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

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

8 years ago[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
Alexey Bataev [Thu, 7 Apr 2016 12:45:37 +0000 (12:45 +0000)]
[OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
construct.

OpenMP 4.0 defines '#pragma omp declare simd' construct that may have
associated 'simdlen' clause with constant positive expression as an
argument:
simdlen(<const_expr>)
Patch adds parsin and semantic analysis for simdlen clause.

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

8 years agoMove class into an anonymous namespace. NFC.
Benjamin Kramer [Thu, 7 Apr 2016 10:14:54 +0000 (10:14 +0000)]
Move class into an anonymous namespace. NFC.

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

8 years agoBasic: thread CodeGenOptions into TargetInfo
Saleem Abdulrasool [Thu, 7 Apr 2016 05:41:11 +0000 (05:41 +0000)]
Basic: thread CodeGenOptions into TargetInfo

This threads CodeGenOptions into the TargetInfo hierarchy.  This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi).  Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful.  NFC.

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

8 years agoDon't use PATH_MAX.
Sean Silva [Thu, 7 Apr 2016 01:58:14 +0000 (01:58 +0000)]
Don't use PATH_MAX.

This is a SmallVector anyway, and so the exact size doesn't matter.

clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
        llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'

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

8 years ago[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Bruno Cardoso Lopes [Thu, 7 Apr 2016 01:12:18 +0000 (01:12 +0000)]
[CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h

Use toUppercase instead of ::toupper()

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