]> granicus.if.org Git - clang/log
clang
8 years ago[index] In ObjC++ handle objc type parameters for function USRs.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:43 +0000 (07:17 +0000)]
[index] In ObjC++ handle objc type parameters for function USRs.

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

8 years ago[OpenCL] Refine pipe builtin support
Xiuli Pan [Fri, 4 Mar 2016 07:11:16 +0000 (07:11 +0000)]
[OpenCL] Refine pipe builtin support

Summary:
Refine the type builtin support as the request with
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160201/148637.html

Reviewers: pekka.jaaskelainen, Anastasia, yaxunl

Subscribers: rsmith, cfe-commits

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

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

8 years ago[MIPS] initFeatureMap() to handle empty string argument
Bhushan D. Attarde [Fri, 4 Mar 2016 06:56:29 +0000 (06:56 +0000)]
[MIPS] initFeatureMap() to handle empty string argument

    SUMMARY:
    This patch sets CPU string to its default value when it is not supplied by caller.

    Reviewers: vkalintiris, dsanders
    Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits
    Differential Revision: http://reviews.llvm.org/D16139

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

8 years ago[X86] Pass __m64 types via SSE registers for GCC compatibility
David Majnemer [Fri, 4 Mar 2016 05:26:16 +0000 (05:26 +0000)]
[X86] Pass __m64 types via SSE registers for GCC compatibility

For compatibility with GCC, classify __m64 as SSE.
However, clang is a platform compiler for certain targets; retain our
old behavior on those targets: classify __m64 as integer.

This fixes PR26832.

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

8 years ago[VFS] Switch from close to SafelyCloseFileDescriptor
David Majnemer [Fri, 4 Mar 2016 05:26:14 +0000 (05:26 +0000)]
[VFS] Switch from close to SafelyCloseFileDescriptor

The SafelyCloseFileDescriptor machinery does the right thing in the face
of signals while close will do something platform specific which results
in the FD potentially getting leaked.

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

8 years ago[index] Ignore ObjCTypeParamDecls during indexing.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 04:24:32 +0000 (04:24 +0000)]
[index] Ignore ObjCTypeParamDecls during indexing.

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

8 years ago[OPENMP] firstprivate and private clauses of teams, host codegeneration
Carlo Bertolli [Thu, 3 Mar 2016 22:09:40 +0000 (22:09 +0000)]
[OPENMP] firstprivate and private clauses of teams, host codegeneration

Add code generation support for firstprivate and private clauses of teams on the host. Add extensive regression tests including lambda functions and vla testing.

http://reviews.llvm.org/D17582

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

8 years ago[analyzer] ObjCDeallocChecker: Only check for nil-out when type is retainable.
Devin Coughlin [Thu, 3 Mar 2016 21:38:39 +0000 (21:38 +0000)]
[analyzer] ObjCDeallocChecker: Only check for nil-out when type is retainable.

This fixes a crash when setting a property of struct type in -dealloc.

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

8 years agoAdd code generation for teams directive inside target region
Carlo Bertolli [Thu, 3 Mar 2016 20:34:23 +0000 (20:34 +0000)]
Add code generation for teams directive inside target region

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

8 years ago[OpenCL] Improve diagnostics of address spaces for variables in function
Anastasia Stulova [Thu, 3 Mar 2016 18:38:40 +0000 (18:38 +0000)]
[OpenCL] Improve diagnostics of address spaces for variables in function

 - Prevent local variables to be declared in global AS
 - Diagnose AS of local variables with an extern storage class
   as if they would be in a program scope

Review: http://reviews.llvm.org/D17345

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

8 years agoclang-format: Use stable_sort when sorting #includes.
Daniel Jasper [Thu, 3 Mar 2016 17:34:14 +0000 (17:34 +0000)]
clang-format: Use stable_sort when sorting #includes.

Otherwise, clang-format can output useless replacements in the presence
of identical #includes

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

8 years ago[OpenMP] Code generation for teams - kernel launching
Samuel Antao [Thu, 3 Mar 2016 16:20:23 +0000 (16:20 +0000)]
[OpenMP] Code generation for teams - kernel launching

Summary:
This patch implements the launching of a target region in the presence of a nested teams region, i.e calls tgt_target_teams with the required arguments gathered from the enclosed teams directive.

The actual codegen of the region enclosed by the teams construct will be contributed in a separate patch.

Reviewers: hfinkel, arpith-jacob, kkwli0, carlo.bertolli, ABataev

Subscribers: cfe-commits, caomhin, fraggamuffin

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

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

8 years ago[ARM] Add Clang targeting for ARMv8-M Baseline/Mainline
Bradley Smith [Thu, 3 Mar 2016 13:52:22 +0000 (13:52 +0000)]
[ARM] Add Clang targeting for ARMv8-M Baseline/Mainline

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

8 years ago[CLANG][AVX512][BUILTIN] movddup{128|256|512}
Michael Zuckerman [Thu, 3 Mar 2016 13:43:05 +0000 (13:43 +0000)]
[CLANG][AVX512][BUILTIN] movddup{128|256|512}

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

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

8 years ago[OpenCL] Apply missing restrictions for Blocks in OpenCL v2.0
Anastasia Stulova [Thu, 3 Mar 2016 13:33:19 +0000 (13:33 +0000)]
[OpenCL] Apply missing restrictions for Blocks in OpenCL v2.0

Applying the following restrictions for block types in OpenCL (v2.0 s6.12.5):
 - __block storage class is disallowed
 - every block declaration must be const qualified and initialized
 - a block can't be used as a return type of a function
 - a blocks can't be used to declare a structure or union field
 - extern speficier is disallowed

Corrected image and sampler types diagnostics with struct and unions.

Review: http://reviews.llvm.org/D16928

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

8 years agoFixing a checkfile error in avx512vlbw-builtins.c
Michael Zuckerman [Thu, 3 Mar 2016 12:17:50 +0000 (12:17 +0000)]
Fixing a checkfile error in avx512vlbw-builtins.c

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

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

8 years ago[CLANG][AVX512][BUILTIN] movdqu{qi|hi} {128|256|512}
Michael Zuckerman [Thu, 3 Mar 2016 11:34:52 +0000 (11:34 +0000)]
[CLANG][AVX512][BUILTIN] movdqu{qi|hi} {128|256|512}

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

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

8 years agoTweak CMakeLists not for libclang to depend on the variable CLANG_TOOL_EXTRA_BUILD.
NAKAMURA Takumi [Thu, 3 Mar 2016 11:09:43 +0000 (11:09 +0000)]
Tweak CMakeLists not for libclang to depend on the variable CLANG_TOOL_EXTRA_BUILD.

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

8 years ago[docs] Add missing file
Alexander Kornienko [Thu, 3 Mar 2016 10:44:10 +0000 (10:44 +0000)]
[docs] Add missing file

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

8 years ago[docs] Updated doxygen files to work well with doxygen 1.8.11
Alexander Kornienko [Thu, 3 Mar 2016 10:42:46 +0000 (10:42 +0000)]
[docs] Updated doxygen files to work well with doxygen 1.8.11

Doxygen 1.8.11 doesn't seem to like files with ".intro" extension by default.

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

8 years ago[CLANG][AVX512][BUILTIN] movdqa{32|64}{load|store|}{128|256|512}
Michael Zuckerman [Thu, 3 Mar 2016 09:26:01 +0000 (09:26 +0000)]
[CLANG][AVX512][BUILTIN] movdqa{32|64}{load|store|}{128|256|512}

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

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

8 years ago[libclang] Link clang-tidy plugin into libclang if present.
Benjamin Kramer [Thu, 3 Mar 2016 08:58:18 +0000 (08:58 +0000)]
[libclang] Link clang-tidy plugin into libclang if present.

This is a sad workaround for the lack of plugin support in libclang. Depends
on D17807, a tools-extra change that also contains the test case.

This is designed to be easy to remove again if libclang ever grows proper
plugin support.

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

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

8 years ago[Clang][AVX512][BUILTIN] Adding PSRL{W|WI}{128|256|512}
Michael Zuckerman [Thu, 3 Mar 2016 08:55:20 +0000 (08:55 +0000)]
[Clang][AVX512][BUILTIN] Adding PSRL{W|WI}{128|256|512}

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

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

8 years agoSemantic analysis for the swiftcall calling convention.
John McCall [Thu, 3 Mar 2016 06:39:32 +0000 (06:39 +0000)]
Semantic analysis for the swiftcall calling convention.

I've tried to keep the infrastructure behind parameter ABI
treatments fairly general.

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

8 years ago[index] Report references of ObjC super class/protocols in interfaces and protocols.
Argyrios Kyrtzidis [Thu, 3 Mar 2016 05:33:54 +0000 (05:33 +0000)]
[index] Report references of ObjC super class/protocols in interfaces and protocols.

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

8 years ago[test] Re-enable asan on the test, stack usage should be lower.
Argyrios Kyrtzidis [Thu, 3 Mar 2016 05:33:48 +0000 (05:33 +0000)]
[test] Re-enable asan on the test, stack usage should be lower.

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

8 years ago[OPENMP 4.0] Initial support for 'omp declare reduction' construct.
Alexey Bataev [Thu, 3 Mar 2016 05:21:39 +0000 (05:21 +0000)]
[OPENMP 4.0] Initial support for 'omp declare reduction' construct.

Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct.
User-defined reductions are defined as

#pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )]
These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The
combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will
denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting
combined value after executing the combiner.
As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause
will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier
omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced.
Differential Revision: http://reviews.llvm.org/D11182

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

8 years ago[OPENMP 4.5] Initial support for data members in 'linear' clause.
Alexey Bataev [Thu, 3 Mar 2016 03:52:24 +0000 (03:52 +0000)]
[OPENMP 4.5] Initial support for data members in 'linear' clause.

OpenMP 4.5 allows to privatize data members of current class in member
functions. Patch adds initial support for privatization of data members
in 'linear' clause, no codegen support.

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

8 years agoCaught and fixed a typo in r262572.
Sean Callanan [Thu, 3 Mar 2016 02:22:05 +0000 (02:22 +0000)]
Caught and fixed a typo in r262572.

I should have checked and imported D's in-class initializer.
Instead I accidentally used ToField's in-class initializer,
which is always NULL so ToField will never get one.

<rdar://problem/24943405>

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

8 years agoFixed a problem where the ASTImporter mishandled in-class initializers.
Sean Callanan [Thu, 3 Mar 2016 01:21:28 +0000 (01:21 +0000)]
Fixed a problem where the ASTImporter mishandled in-class initializers.

Previously, the ASTImporter, when copying a FieldDecl, would make the
new FieldDecl use the exact same in-class initializer as the original
FieldDecl, which is a problem since the initializer is in the wrong AST.
The initializer must be imported, just like all the other parts of the
field.

Doug Gregor reviewed this fix.

<rdar://problem/24943405>

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

8 years agoThis patch adds doxygen comments for all the intrinsincs in the header file tmmintrin.h.
Ekaterina Romanova [Thu, 3 Mar 2016 00:20:11 +0000 (00:20 +0000)]
This patch adds doxygen comments for all the intrinsincs in the header file tmmintrin.h.
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.

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

8 years agoSerialize `pragma pointers_to_members` state.
Nico Weber [Thu, 3 Mar 2016 00:17:35 +0000 (00:17 +0000)]
Serialize `pragma pointers_to_members` state.

Like r262539, but for pointers_to_members.

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

8 years agoImprove some infrastructure for extended parameter infos and
John McCall [Thu, 3 Mar 2016 00:10:03 +0000 (00:10 +0000)]
Improve some infrastructure for extended parameter infos and
fix a bug with the instantiation of ns_consumed parameter
attributes in ARC.

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

8 years agoclang-cl pch test: Instead of copying the input, use /Fp to not write into the test...
Nico Weber [Wed, 2 Mar 2016 23:29:29 +0000 (23:29 +0000)]
clang-cl pch test: Instead of copying the input, use /Fp to not write into the test directory.

Also fix a bug with /Fp and absolute paths uncovered by this.
Follow-up to r262487.

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

8 years agoSerialize `pragma ms_struct` state.
Nico Weber [Wed, 2 Mar 2016 23:22:00 +0000 (23:22 +0000)]
Serialize `pragma ms_struct` state.

pragma ms_struct has an effect on struct decls, and the effect is serialized
correctly already.  But the "is ms_struct currently on" state wasn't before
this change.

This uses the same approach as `pragma clang optimize`: When writing a module,
the state isn't serialized, only when writing a pch file.

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

8 years agoclang-format: [JS] Optionally re-quote string literals.
Daniel Jasper [Wed, 2 Mar 2016 22:44:03 +0000 (22:44 +0000)]
clang-format: [JS] Optionally re-quote string literals.

Turns "foo" into 'foo' (or vice versa, depending on configuration).
This makes it more convenient to follow the Google JavaScript style
guide:
https://google.github.io/styleguide/javascriptguide.xml?showone=Strings#Strings

This functionality is behind the option "JavaScriptQuotes", which can be:

  * "leave" (no re-quoting)
  * "single" (change to single quotes)
  * "double" (change to double quotes)

This also changes single quoted JavaScript string literals to be treated
as tok::string_literal, not tok::char_literal, which fixes two unrelated
tests.

Patch by Martin Probst. Thank you.

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

8 years ago[analyzer] Move ObjCSuperDeallocChecker out of the alpha package.
Devin Coughlin [Wed, 2 Mar 2016 22:01:03 +0000 (22:01 +0000)]
[analyzer] Move ObjCSuperDeallocChecker out of the alpha package.

It will now be on by default on Darwin.

rdar://problem/6953275

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

8 years ago[analyzer] Move ObjCDeallocChecker out of the alpha package.
Devin Coughlin [Wed, 2 Mar 2016 21:50:54 +0000 (21:50 +0000)]
[analyzer] Move ObjCDeallocChecker out of the alpha package.

It will now be on by default on Darwin.

rdar://problem/6927496

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

8 years ago[analyzer] Fix capitalization in ObjCSuperDeallocChecker diagnostic.
Devin Coughlin [Wed, 2 Mar 2016 21:22:48 +0000 (21:22 +0000)]
[analyzer] Fix capitalization in ObjCSuperDeallocChecker diagnostic.

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

8 years agoFixed test failure platforms with name mangling different from Linux.
Artem Belevich [Wed, 2 Mar 2016 21:03:20 +0000 (21:03 +0000)]
Fixed test failure platforms with name mangling different from Linux.
* Run cc with -triple x86_64-linux-gnu to make symbol mangling predictable.
* Use temporary file as a fake GPU input so its content
  does not interfere with pattern matching.

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

8 years ago[PGO] Change profile use cc1 option to handle IR level profiles
Rong Xu [Wed, 2 Mar 2016 20:59:36 +0000 (20:59 +0000)]
[PGO] Change profile use cc1 option to handle IR level profiles

This patch changes cc1 option for PGO profile use from
-fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>.
-fprofile-instr-use=<path> is now a driver only option.

In addition to decouple the cc1 option from the driver level option, this patch
also enables IR level profile use. cc1 option handling now reads the profile
header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM}
-- this is a common enum for -fprofile-instrument={}, for the profile
instrumentation), and invoke the pipeline to enable the respective PGO use pass.

Reviewers: silvas, davidxl

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

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

8 years agofix test from r262506
Nico Weber [Wed, 2 Mar 2016 19:38:24 +0000 (19:38 +0000)]
fix test from r262506

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

8 years agoSerialize `#pragma detect_mismatch`.
Nico Weber [Wed, 2 Mar 2016 19:28:54 +0000 (19:28 +0000)]
Serialize `#pragma detect_mismatch`.

This is like r262493, but for pragma detect_mismatch instead of pragma comment.
The two pragmas have similar behavior, so use the same approach for both.

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

8 years ago[libFuzzer] allow -fsanitize-coverage=0 (disables all coverage)
Kostya Serebryany [Wed, 2 Mar 2016 19:16:54 +0000 (19:16 +0000)]
[libFuzzer] allow -fsanitize-coverage=0 (disables all coverage)

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

8 years ago[CUDA] Do not generate unnecessary runtime init code.
Artem Belevich [Wed, 2 Mar 2016 18:28:53 +0000 (18:28 +0000)]
[CUDA] Do not generate unnecessary runtime init code.

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

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

8 years ago[CUDA] Emit host-side 'shadows' for device-side global variables
Artem Belevich [Wed, 2 Mar 2016 18:28:50 +0000 (18:28 +0000)]
[CUDA] Emit host-side 'shadows' for device-side global variables

... and register them with CUDA runtime.

This is needed for commonly used cudaMemcpy*() APIs that use address of
host-side shadow to access their counterparts on device side.

Fixes PR26340

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

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

8 years agoSerialize `#pragma comment`.
Nico Weber [Wed, 2 Mar 2016 17:28:48 +0000 (17:28 +0000)]
Serialize `#pragma comment`.

`#pragma comment` was handled by Sema calling a function on ASTConsumer, and
CodeGen then implementing this function and writing things to its output.

Instead, introduce a PragmaCommentDecl AST node and hang one off the
TranslationUnitDecl for every `#pragma comment` line, and then use the regular
serialization machinery. (Since PragmaCommentDecl has codegen relevance, it's
eagerly deserialized.)

http://reviews.llvm.org/D17799

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

8 years agotest/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary
Daniel Jasper [Wed, 2 Mar 2016 14:26:59 +0000 (14:26 +0000)]
test/Driver/cl-pch-errorhandling.cpp: Copy input file to a temporary
location as we cannot assume the location of the input file to be
writable.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRA{W|WI}{128|256|512}.
Michael Zuckerman [Wed, 2 Mar 2016 12:06:06 +0000 (12:06 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSRA{W|WI}{128|256|512}.

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

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRAV
Michael Zuckerman [Wed, 2 Mar 2016 09:05:46 +0000 (09:05 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding PSRAV

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

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

8 years ago[Sema] PR26444 fix crash when alignment value is >= 2**16
David Majnemer [Wed, 2 Mar 2016 06:48:47 +0000 (06:48 +0000)]
[Sema] PR26444 fix crash when alignment value is >= 2**16

Sema allows max values up to 2**28, use unsigned instead of unsiged
short to hold values that large.

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

Patch by Don Hinton!

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

8 years ago[modules] addHeaderInclude() can't fail.
Davide Italiano [Wed, 2 Mar 2016 06:09:18 +0000 (06:09 +0000)]
[modules] addHeaderInclude() can't fail.

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

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

8 years ago[OPENMP 4.5] Codegen for data members in 'reduction' clause.
Alexey Bataev [Wed, 2 Mar 2016 04:57:40 +0000 (04:57 +0000)]
[OPENMP 4.5] Codegen for data members in 'reduction' clause.

OpenMP 4.5 allows to privatize non-static data members of current class
in non-static member functions. Patch supports codegen for non-static
data members in 'reduction' clauses.

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

8 years agoAdd a few dllimport/dllexport tests. NFC
Reid Kleckner [Wed, 2 Mar 2016 01:21:48 +0000 (01:21 +0000)]
Add a few dllimport/dllexport tests.  NFC

Summary:
This change just adds tests for some corner cases of dllimport/dllexport,
primarily for some static methods.

We plan to enable dllimport/dllexport support for the PS4, and these
additional tests are for points we previously were testing internally.

-Warren Ristow
SN Systems - Sony Computer Entertainment Group

Reviewers: rnk

Subscribers: silvas

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

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

8 years ago[CMake] Add convenience target clang-test-depends to build test dependencies.
Chris Bieneman [Wed, 2 Mar 2016 00:27:15 +0000 (00:27 +0000)]
[CMake] Add convenience target clang-test-depends to build test dependencies.

This is useful when paired with the distribution targets to build prerequisites for running tests.

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

8 years agoclang-cl: Implement initial limited support for precompiled headers.
Nico Weber [Tue, 1 Mar 2016 23:16:44 +0000 (23:16 +0000)]
clang-cl: Implement initial limited support for precompiled headers.

In the gcc precompiled header model, one explicitly runs clang with `-x
c++-header` on a .h file to produce a gch file, and then includes the header
with `-include foo.h` and if a .gch file exists for that header it gets used.
This is documented at
http://clang.llvm.org/docs/UsersManual.html#precompiled-headers

cl.exe's model is fairly different, and controlled by the two flags /Yc and
/Yu. A pch file is generated as a side effect of a regular compilation when
/Ycheader.h is passed. While the compilation is running, the compiler keeps
track of #include lines in the main translation unit and writes everything up
to an `#include "header.h"` line into a pch file. Conversely, /Yuheader.h tells
the compiler to skip all code in the main TU up to and including `#include
"header.h"` and instead load header.pch. (It's also possible to use /Yc and /Yu
without an argument, in that case a `#pragma hrdstop` takes the role of
controlling the point where pch ends and real code begins.)

This patch implements limited support for this in that it requires the pch
header to be passed as a /FI force include flag â€“ with this restriction,
it can be implemented almost completely in the driver with fairly small amounts
of code. For /Yu, this is trivial, and for /Yc a separate pch action is added
that runs before the actual compilation. After r261774, the first failing
command makes a compilation stop â€“ this means if the pch fails to build the
main compilation won't run, which is what we want. However, in /fallback builds
we need to run the main compilation even if the pch build fails so that the
main compilation's fallback can run. To achieve this, add a ForceSuccessCommand
that pretends that the pch build always succeeded in /fallback builds (the main
compilation will then fail to open the pch and run the fallback cl.exe
invocation).

If /Yc /Yu are used in a setup that clang-cl doesn't implement yet, clang-cl
will now emit a "not implemented yet; flag ignored" warning that can be
disabled using -Wno-clang-cl-pch.

Since clang-cl doesn't yet serialize some important things (most notably
`pragma comment(lib, ...)`, this feature is disabled by default and only
enabled by an internal driver flag. Once it's more stable, this internal flag
will disappear.

(The default stdafx.h setup passes stdafx.h as explicit argument to /Yc but not
as /FI â€“ instead every single TU has to `#include <stdafx.h>` as first thing it
does. Implementing support for this should be possible with the approach in
this patch with minimal frontend changes by passing a --stop-at / --start-at
flag from the driver to the frontend. This is left for a follow-up. I don't
think we ever want to support `#pragma hdrstop`, and supporting it with this
approach isn't easy: This approach relies on the driver knowing the pch
filename in advance, and `#pragma hdrstop(out.pch)` can set the output
filename, so the driver can't know about it in advance.)

clang-cl now also honors /Fp and puts pch files in the same spot that cl.exe
would put them, but the pch file format is of course incompatible. This has
ramifications on /fallback, so /Yc /Yu aren't passed through to cl.exe in
/fallback builds.

http://reviews.llvm.org/D17695

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

8 years agoUpdated SSE41 builtin tests to more closely match the llvm fast-isel equivalent tests
Simon Pilgrim [Tue, 1 Mar 2016 22:38:33 +0000 (22:38 +0000)]
Updated SSE41 builtin tests to more closely match the llvm fast-isel equivalent tests

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

8 years agoMangle extended qualifiers in the proper order and mangle the
John McCall [Tue, 1 Mar 2016 22:18:03 +0000 (22:18 +0000)]
Mangle extended qualifiers in the proper order and mangle the
ARC ownership-convention function type modifications.

According to the Itanium ABI, vendor extended qualifiers are
supposed to be mangled in reverse-alphabetical order before
any CVR qualifiers.  The ARC function type conventions are
plausibly order-significant (they are associated with the
function type), which permits us to ignore the need to correctly
inter-order them with any other vendor qualifiers on the parameter
and return types.

Implementing these rules correctly is technically an ABI break.
Apple is comfortable with the risk of incompatibility here for
the ARC features, and I believe that address-space qualification
is still uncommon enough to allow us to adopt the conforming
rule without serious risk.  Still, targets which make heavy
use of address space qualification may want to revert to the
non-conforming order.

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

8 years agoExplicitly select IAS on one more RUN line in new embed-bitcode.c test.
Daniel Sanders [Tue, 1 Mar 2016 21:57:22 +0000 (21:57 +0000)]
Explicitly select IAS on one more RUN line in new embed-bitcode.c test.

This should fix clang-cmake-mips builder since MIPS does not have IAS enabled
by default (yet).

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

8 years ago[clang-format] Detect constructor initializers preceded by `noexcept`.
Daniel Jasper [Tue, 1 Mar 2016 21:41:58 +0000 (21:41 +0000)]
[clang-format] Detect constructor initializers preceded by `noexcept`.

Patch by Erik Kessler, thank you.

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

8 years agoThis patch adds doxygen comments for the intrinsincs in the header file popcntintrin.h.
Ekaterina Romanova [Tue, 1 Mar 2016 20:04:57 +0000 (20:04 +0000)]
This patch adds doxygen comments for the intrinsincs in the header file popcntintrin.h.

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

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

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

8 years agoReword a misleading comment discussing landingpads and SEH
Reid Kleckner [Tue, 1 Mar 2016 19:51:48 +0000 (19:51 +0000)]
Reword a misleading comment discussing landingpads and SEH

SEH doesn't use landingpads anymore.

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

8 years ago[MSVC Compat] Correctly handle finallys nested within finallys
David Majnemer [Tue, 1 Mar 2016 19:42:53 +0000 (19:42 +0000)]
[MSVC Compat] Correctly handle finallys nested within finallys

We'd lose track of the parent CodeGenFunction, leading us to get
confused with regard to which function a nested finally belonged to.

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

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

8 years ago[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics
Kit Barton [Tue, 1 Mar 2016 18:11:28 +0000 (18:11 +0000)]
[PPC64][VSX] Add short, char, and bool data type for vec_vsx_ld and vec_vsx_st intrinsics

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

Fix compile error when building ffmpeg for PowerPC64LE because of some
vec_vsx_ld/vec_vsx_st intrinsics are not supported by current clang.

New added intrinsics:

(vector) {signed|unsigned} {short|char} vec_vsx_ld: (total: 8)
bool vec_vsx_ld: (total: 1)
(vector) {signed|unsigned} {short|char} vec_vsx_st: (total: 8)
bool vec_vsx_st: (total: 1)
Total: 18 intrinsics

Phabricator: http://reviews.llvm.org/D17637

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

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 17:49:03 +0000 (17:49 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRL{DI|QI}{128|256|512} builtin

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

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

8 years agoExplicitly select IAS in new embed-bitcode.c test.
Daniel Sanders [Tue, 1 Mar 2016 17:15:11 +0000 (17:15 +0000)]
Explicitly select IAS in new embed-bitcode.c test.

This should fix clang-cmake-mips builder since MIPS does not have IAS enabled
by default (yet).

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

8 years ago[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT
Filipe Cabecinhas [Tue, 1 Mar 2016 15:33:52 +0000 (15:33 +0000)]
[cmake] Add a few more compiler-rt check-* targets for EXTERNAL_COMPILER_RT

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

8 years ago[cmake] Try to appease the buildbots.
Filipe Cabecinhas [Tue, 1 Mar 2016 15:07:19 +0000 (15:07 +0000)]
[cmake] Try to appease the buildbots.

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

8 years ago[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:10:38 +0000 (14:10 +0000)]
[cmake] Pass through the cmake_3_2_USES_TERMINAL variable so we get progress bars on an external compiler-rt build

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

8 years ago[cmake] Use CMake's USES_TERMINAL for the test targets.
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:18 +0000 (14:08 +0000)]
[cmake] Use CMake's USES_TERMINAL for the test targets.

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

8 years ago[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT...
Filipe Cabecinhas [Tue, 1 Mar 2016 14:08:13 +0000 (14:08 +0000)]
[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.

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

8 years agoFormatTests: Update libdeps corresponding to r262323.
NAKAMURA Takumi [Tue, 1 Mar 2016 13:11:36 +0000 (13:11 +0000)]
FormatTests: Update libdeps corresponding to r262323.

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

8 years ago[CLANG][AVX512][BUILTIN] Adding PSRLV builtin
Michael Zuckerman [Tue, 1 Mar 2016 13:03:45 +0000 (13:03 +0000)]
[CLANG][AVX512][BUILTIN] Adding PSRLV builtin

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

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

8 years agoFix test breakage on windows where the default std is c++11 by forcing c++03 in the...
Manuel Klimek [Tue, 1 Mar 2016 12:53:18 +0000 (12:53 +0000)]
Fix test breakage on windows where the default std is c++11 by forcing c++03 in the test.

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

8 years agoFix DLL build by adding required dependency.
Manuel Klimek [Tue, 1 Mar 2016 12:47:30 +0000 (12:47 +0000)]
Fix DLL build by adding required dependency.

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

8 years agoAdd functions to apply replacements and reformat them.
Manuel Klimek [Tue, 1 Mar 2016 12:37:30 +0000 (12:37 +0000)]
Add functions to apply replacements and reformat them.

This is a commonly useful feature to have, and we have implemented it
multiple times with different kinds of bugs. This implementation
centralizes the idea in a set of functions that we can then use from the various
tools.

Reverts r262234, which is a revert of r262232, and puts the functions
into FOrmat.h, as they are closely coupled to clang-format, and we
otherwise introduce a cyclic dependency between libFormat and
libTooling.

Patch by Eric Liu.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding PSRA{Q|D|QI|DI}{128|256|512} builtin
Michael Zuckerman [Tue, 1 Mar 2016 11:38:16 +0000 (11:38 +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@262321 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoOptionally demote fatal errors to non-fatal errors.
Manuel Klimek [Tue, 1 Mar 2016 10:56:19 +0000 (10:56 +0000)]
Optionally demote fatal errors to non-fatal errors.

This behavior is enabled when the new CXTranslationUnit_KeepGoing
option is passed to clang_parseTranslationUnit{,2}. It is geared
towards use by IDEs and similar consumers of the clang-c API where
fatal errors may arise when parsing incomplete code mid-edit, or
when include paths are not properly configured yet. In such situations
one still wants to get as much information as possible about a TU.
Previously, the semantic analysis would not instantiate templates
or report additional fatal errors after the first fatal error was
encountered.

Fixes PR24268.

Patch by Milian Wolff.

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

8 years agoTest template instantiation of ns_consumed and ns_returns_retained.
John McCall [Tue, 1 Mar 2016 06:54:30 +0000 (06:54 +0000)]
Test template instantiation of ns_consumed and ns_returns_retained.

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

8 years agoBetter comments for ExtParameterInfo.
John McCall [Tue, 1 Mar 2016 06:27:40 +0000 (06:27 +0000)]
Better comments for ExtParameterInfo.

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

8 years ago[test] After r262290 reducing stack usage, try re-enabling asan on the related test.
Argyrios Kyrtzidis [Tue, 1 Mar 2016 04:40:20 +0000 (04:40 +0000)]
[test] After r262290 reducing stack usage, try re-enabling asan on the related test.

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

8 years agoclang-format: Correctly apply wrap before multi-line RHS rule to
Daniel Jasper [Tue, 1 Mar 2016 04:19:59 +0000 (04:19 +0000)]
clang-format: Correctly apply wrap before multi-line RHS rule to
ternary expressions.

Before:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ? aaaaa : bbbbbbbbbbbbbbb +
     cccccccccccccccc;

After:
  return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ?
     aaaaa :
     bbbbbbbbbbbbbbb + cccccccccccccccc;

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

8 years agoclang-format: Increase the penalty for breaking between array subscripts.
Daniel Jasper [Tue, 1 Mar 2016 04:19:55 +0000 (04:19 +0000)]
clang-format: Increase the penalty for breaking between array subscripts.

Before:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa]
                                    [a].aaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaa][a]
      .aaaaaaaaaaaaaaaaaaaaaa();

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

8 years agoclang-format: [JS] Support quoted object literal keys.
Daniel Jasper [Tue, 1 Mar 2016 04:19:47 +0000 (04:19 +0000)]
clang-format: [JS] Support quoted object literal keys.

Before:
  var x = {
    a: a,
    b: b, 'c': c,
  };

After:
  var x = {
    a: a,
    b: b,
    'c': c,
  };

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

8 years ago[index] Fix issue where data visitation was disabled with C++ operator call expressio...
Argyrios Kyrtzidis [Tue, 1 Mar 2016 02:46:32 +0000 (02:46 +0000)]
[index] Fix issue where data visitation was disabled with C++ operator call expressions, during indexing.

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

8 years agoFix the template instantiation of ExtParameterInfos; tests to follow.
John McCall [Tue, 1 Mar 2016 02:09:25 +0000 (02:09 +0000)]
Fix the template instantiation of ExtParameterInfos; tests to follow.

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

8 years agoAdd an llvm_unreachable back to the autogeneration of this covered switch.
John McCall [Tue, 1 Mar 2016 02:09:20 +0000 (02:09 +0000)]
Add an llvm_unreachable back to the autogeneration of this covered switch.

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

8 years agoFix the testcase in r262282
Steven Wu [Tue, 1 Mar 2016 01:24:54 +0000 (01:24 +0000)]
Fix the testcase in r262282

-bitcode_bundle is only passed to the darwin ld64 linker and it is only
implemented there. Remove the check on the linker flag.

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

8 years agoMake test more robust.
Sean Silva [Tue, 1 Mar 2016 01:20:15 +0000 (01:20 +0000)]
Make test more robust.

Really all these tests are checking is that we find a file path. The
behavior when we don't find one will have `"ps4-ld"` in it. We just need
a path separator to know that a path has been found.

The root cause of the flakiness of these tests is the same on Windows
and non-Windows: setting the PATH environment variable is not sufficient
to guarantee that a particular path is looked up first.
Driver::GetProgramPath checks some paths before deferring to PATH
(in particular, the directory containing the clang binary itself).

I initally ran into this on Windows when putting a PS4 linker in
build-dir/bin/ps4-ld for testing.
After digging for a while thinking that it was some windows path search
oddity (the Windows SearchPathW documentation indicates that its
behavior varies depending on a registry setting...).
I eventually tried reproducing the issue on Mac and to my surprise found
the same issue.
Ultimately I traced it down to the extra lookups in
Driver::GetProgramPath.

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

8 years agoIntroduce -fembed-bitcode driver option
Steven Wu [Tue, 1 Mar 2016 01:07:58 +0000 (01:07 +0000)]
Introduce -fembed-bitcode driver option

Summary:
This is the clang driver part of the change to embedded bitcode. This
includes:
1. -fembed-bitcode option which breaks down the compilation into two
stages. The first stage emits optimized bitcode and the second stage
compiles bitcode into object file.
2. -fembed-bitcode-marker option which doesn't really break down to
two stages to speedup the compilation flow.
3. pass the correct linker flag to darwin linker if tool chains supports
embedded bitcode.

Reviewers: rsmith, thakis

Subscribers: thakis, cfe-commits

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

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

8 years agoGeneralize the consumed-parameter array on FunctionProtoType
John McCall [Tue, 1 Mar 2016 00:49:02 +0000 (00:49 +0000)]
Generalize the consumed-parameter array on FunctionProtoType
to allow arbitrary data to be associated with a parameter.

Also, fix a bug where we apparently haven't been serializing
this information for the last N years.

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

8 years ago[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.
Devin Coughlin [Tue, 1 Mar 2016 00:39:04 +0000 (00:39 +0000)]
[analyzer] Update CheckObjCDealloc diagnostic for missing -dealloc.

Update the diagnostic for classes missing -dealloc to mention an instance
variable that needs to be released.

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

8 years agoInfrastructure improvements to Clang attribute TableGen.
John McCall [Tue, 1 Mar 2016 00:18:05 +0000 (00:18 +0000)]
Infrastructure improvements to Clang attribute TableGen.

This should make it easier to add new Attr subclasses.

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

8 years ago[analyzer] Teach CheckObjCDealloc about Block_release().
Devin Coughlin [Mon, 29 Feb 2016 23:57:10 +0000 (23:57 +0000)]
[analyzer] Teach CheckObjCDealloc about Block_release().

It now treats Block_release(b) as a release in addition to [b release].

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

8 years ago[analyzer] Don't treat calls to system headers as escaping in CheckObjCDealloc.
Devin Coughlin [Mon, 29 Feb 2016 21:44:08 +0000 (21:44 +0000)]
[analyzer] Don't treat calls to system headers as escaping in CheckObjCDealloc.

This prevents false negatives when a -dealloc method, for example, removes itself as
as an observer with [[NSNotificationCenter defaultCenter] removeObserver:self]. It is
unlikely that passing 'self' to a system header method will release 'self''s instance
variables, so this is unlikely to produce false positives.

A challenge here is that while CheckObjCDealloc no longer treats these calls as
escaping, the rest of the analyzer still does. In particular, this means that loads
from the same instance variable before and after a call to a system header will
result in different symbols being loaded by the region store. To account for this,
the checker now treats different ivar symbols with the same instance and ivar decl as
the same for the purpose of release checking and more eagerly removes a release
requirement when an instance variable is assumed to be nil. This was not needed before
because when an ivar escaped its release requirement was always removed -- now the
requirement is not removed for calls to system headers.

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

8 years ago[PGO] clang cc1 option change to enable IR level instrumentation
Rong Xu [Mon, 29 Feb 2016 18:54:59 +0000 (18:54 +0000)]
[PGO] clang cc1 option change to enable IR level instrumentation

This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm
which enables IR level PGO instrumentation.

Reviewers: davidxl, silvas

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

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

8 years agoRevert "Implement new interfaces for code-formatting when applying replacements."
Manuel Klimek [Mon, 29 Feb 2016 16:44:16 +0000 (16:44 +0000)]
Revert "Implement new interfaces for code-formatting when applying replacements."

This reverts commit r262232.

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

8 years agoImplement new interfaces for code-formatting when applying replacements.
Manuel Klimek [Mon, 29 Feb 2016 16:27:41 +0000 (16:27 +0000)]
Implement new interfaces for code-formatting when applying replacements.

Patch by Eric Liu.

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

8 years agoAMDGPU: Add missing Volcanic Islands targets
Tom Stellard [Mon, 29 Feb 2016 15:08:56 +0000 (15:08 +0000)]
AMDGPU: Add missing Volcanic Islands targets

Reviewers: arsenm

Subscribers: cfe-commits

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

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

8 years agoclang-format: Don't format unrelated nested blocks.
Daniel Jasper [Mon, 29 Feb 2016 12:26:20 +0000 (12:26 +0000)]
clang-format: Don't format unrelated nested blocks.

With this change:

  SomeFunction(
      [] {
int i;
 return i;  // Format this line.
      },
      [] {
 return 2;  // Don't "fix" this.
      });

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