]> granicus.if.org Git - clang/log
clang
7 years agoModular Codegen: Add/use a bit in serialized function definitions to track whether...
David Blaikie [Tue, 11 Apr 2017 20:46:34 +0000 (20:46 +0000)]
Modular Codegen: Add/use a bit in serialized function definitions to track whether they are the subject of modular codegen

Some decls are created not where they are written, but in other module
files/users (implicit special members and function template implicit
specializations). To correctly identify them, use a bit next to the definition
to track the modular codegen property.

Discussed whether the module file bit could be omitted in favor of
reconstituting from the modular codegen decls list - best guess today is that
the efficiency improvement of not having to deserialize the whole list whenever
any function is queried by a module user is worth it for the small size
increase of this redundant (list + bit-on-def) representation.

Reviewers: rsmith

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

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

7 years agoAdd const children() accessors to match the existing non-const children() accessors.
Aaron Ballman [Tue, 11 Apr 2017 20:21:30 +0000 (20:21 +0000)]
Add const children() accessors to match the existing non-const children() accessors.

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

7 years ago[ExternalASTMerger] Fix the MSVC build
Sean Callanan [Tue, 11 Apr 2017 19:50:37 +0000 (19:50 +0000)]
[ExternalASTMerger] Fix the MSVC build

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

7 years ago[clang-import-test] Lookup inside contexts
Sean Callanan [Tue, 11 Apr 2017 19:33:35 +0000 (19:33 +0000)]
[clang-import-test] Lookup inside contexts

clang-import-test has until now been only able to report top-level Decls.
This is clearly insufficient; we should be able to look inside structs
and namespaces also.  This patch adds new test cases for a variety of
lookups inside existing ASTContexts, and adds the functionality necessar
to make most of these testcases work.  (One testcase is known to fail
because of ASTImporter limitations when importing templates; I'll look
into that separately.)

This patch also separates the core functionality out into
ExternalASTMerger, an interface that allows clients like LLDB to make
use of it.  clang-import-test now only has the machinery necessary to
set up the tests.

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

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

7 years ago[OpenCL] Map default address space to alloca address space
Yaxun Liu [Tue, 11 Apr 2017 17:24:23 +0000 (17:24 +0000)]
[OpenCL] Map default address space to alloca address space

For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier
is always mapped to target address space 0. As now target private address space is specified by
alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout.

This change has no impact on targets whose alloca addr space is 0.

With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung

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

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

7 years ago[ASTPrinter] Print nested name specifiers for out-of-line functions
Alex Lorenz [Tue, 11 Apr 2017 16:46:03 +0000 (16:46 +0000)]
[ASTPrinter] Print nested name specifiers for out-of-line functions

rdar://31501863

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

7 years agoRevert temporarily D29877 "Warn about unused static file scope function template...
Vassil Vassilev [Tue, 11 Apr 2017 16:05:23 +0000 (16:05 +0000)]
Revert temporarily D29877 "Warn about unused static file scope function template declarations."

We need to address cases (breaking libc++) such as

template <class _Up> static int __test(...);

template<typename _Tp>
auto v = __test<_Tp>(0);

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

7 years ago[clang-format] Recognize Java logical shift assignment operator
Nico Weber [Tue, 11 Apr 2017 15:50:04 +0000 (15:50 +0000)]
[clang-format] Recognize Java logical shift assignment operator

At present, clang-format mangles Java containing logical right shift operators
('>>>=' or '>>>'), splitting them in two, resulting in invalid code:

 public class Minimal {
   public void func(String args) {
     int i = 42;
-    i >>>= 1;
+    i >> >= 1;
     return i;
   }
 }

This adds both forms of logical right shift to the FormatTokenLexer, so
clang-format won't attempt to split them and insert bogus whitespace.

https://reviews.llvm.org/D31652
Patch from Richard Bradfield <bradfier@fstab.me>!

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

7 years agoFix PR13910: Don't warn that __builtin_unreachable() is unreachable
Alex Lorenz [Tue, 11 Apr 2017 15:36:06 +0000 (15:36 +0000)]
Fix PR13910: Don't warn that __builtin_unreachable() is unreachable

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

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

7 years ago[Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are used
Alex Lorenz [Tue, 11 Apr 2017 15:01:53 +0000 (15:01 +0000)]
[Parser][ObjC++] Improve diagnostics and recovery when C++ keywords are used
as identifiers in Objective-C++

This commit improves the 'expected identifier' errors that are presented when a
C++ keyword is used as an identifier in Objective-C++ by mentioning that this is
a C++ keyword in the diagnostic message. It also improves the error recovery:
the parser will now treat the C++ keywords as identifiers to prevent unrelated
parsing errors.

rdar://20626062

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

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

7 years agoWarn about unused static file scope function template declarations.
Vassil Vassilev [Tue, 11 Apr 2017 10:13:54 +0000 (10:13 +0000)]
Warn about unused static file scope function template declarations.

Reviewed by Richard Smith (D29877)!

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

7 years ago[clang-format] Handle NSString literals by merging tokens.
Alexander Kornienko [Tue, 11 Apr 2017 09:55:00 +0000 (09:55 +0000)]
[clang-format] Handle NSString literals by merging tokens.

Summary:
This fixes a few outstanding bugs:
  * incorrect breaking of NSString literals containing double-width characters;
  * inconsistent formatting of ObjC dictionary literals containing NSString
    literals;
  * AlwaysBreakBeforeMultilineStrings ignoring implicitly-concatenated NSString
    literals.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[lsan] Enable LSan on arm Linux, clang part
Maxim Ostapenko [Tue, 11 Apr 2017 07:22:11 +0000 (07:22 +0000)]
[lsan] Enable LSan on arm Linux, clang part

This is a compiler part of https://reviews.llvm.org/D29586. Enable LSan on arm Linux.

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

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

7 years agoAdd more examples to clang-format configuration
Sylvestre Ledru [Tue, 11 Apr 2017 07:07:05 +0000 (07:07 +0000)]
Add more examples to clang-format configuration

Reviewers: djasper

Reviewed By: djasper

Subscribers: Eugene.Zelenko, klimek, cfe-commits

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

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

7 years agodocs: Use the term "whole-program devirtualization" instead of "virtual function...
Peter Collingbourne [Mon, 10 Apr 2017 23:54:28 +0000 (23:54 +0000)]
docs: Use the term "whole-program devirtualization" instead of "virtual function call optimization".

The former term is probably more familiar to users. Also add references to
the command line flags used to enable the features described in the doc.

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

7 years agoReland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"
Reid Kleckner [Mon, 10 Apr 2017 23:31:05 +0000 (23:31 +0000)]
Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"

This re-lands r299875.

I introduced a bug in Clang code responsible for replacing K&R, no
prototype declarations with a real function definition with a prototype.
The bug was here:

       // Collect any return attributes from the call.
  -    if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex))
  -      newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(),
  -                                                  oldAttrs.getRetAttributes()));
  +    newAttrs.push_back(oldAttrs.getRetAttributes());

Previously getRetAttributes() carried AttributeList::ReturnIndex in its
AttributeList. Now that we return the AttributeSetNode* directly, it no
longer carries that index, and we call this overload with a single node:
  AttributeList::get(LLVMContext&, ArrayRef<AttributeSetNode*>)

That aborted with an assertion on x86_32 targets. I added an explicit
triple to the test and added CHECKs to help find issues like this in the
future sooner.

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

7 years agoUpdate for AllocaInst construction changes
Matt Arsenault [Mon, 10 Apr 2017 22:28:02 +0000 (22:28 +0000)]
Update for AllocaInst construction changes

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

7 years agoUpdate for lifetime intrinsic signature change
Matt Arsenault [Mon, 10 Apr 2017 20:18:45 +0000 (20:18 +0000)]
Update for lifetime intrinsic signature change

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

7 years ago[OPENMP] Fix for PR32333: Crash in call of outlined Function.
Alexey Bataev [Mon, 10 Apr 2017 19:16:45 +0000 (19:16 +0000)]
[OPENMP] Fix for PR32333: Crash in call of outlined Function.

If the type of the captured variable is a pointer(s) to variably
modified type, this type was not processed correctly. Need to drill into
the type, find the innermost variably modified array type and convert it
to canonical parameter type.

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

7 years ago[cmake] Support Gentoo install for z3
Michal Gorny [Sat, 8 Apr 2017 14:38:06 +0000 (14:38 +0000)]
[cmake] Support Gentoo install for z3

Add the 'z3' subdirectory to the list of possible path suffixes for
libz3 header search. The z3 headers are installed in /usr/include/z3
on Gentoo.

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

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

7 years ago[cfi] Emit __cfi_check stub in the frontend.
Evgeniy Stepanov [Fri, 7 Apr 2017 23:00:38 +0000 (23:00 +0000)]
[cfi] Emit __cfi_check stub in the frontend.

Previously __cfi_check was created in LTO optimization pipeline, which
means LLD has no way of knowing about the existence of this symbol
without rescanning the LTO output object. As a result, LLD fails to
export __cfi_check, even when given --export-dynamic-symbol flag.

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

7 years agoToolchains: remove crtbegin on xwindows
Saleem Abdulrasool [Fri, 7 Apr 2017 20:47:06 +0000 (20:47 +0000)]
Toolchains: remove crtbegin on xwindows

crtbegin is not really a proper windows support thing.  This was
duplicated when the toolchain was initially built.  If the injection of
crtbegin is needed, it can be done via the `/include` directive.
Furthermore, since `-fPIC` doesnt make sense on PE/COFF, crtbegin and
crtbeginS dont really need to be different.

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

7 years agoAttempt to fix ms-intrinsics.c test
Hans Wennborg [Fri, 7 Apr 2017 17:01:56 +0000 (17:01 +0000)]
Attempt to fix ms-intrinsics.c test

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

7 years agoImplement _interlockedbittestandset as a builtin
Hans Wennborg [Fri, 7 Apr 2017 16:41:47 +0000 (16:41 +0000)]
Implement _interlockedbittestandset as a builtin

It's used by MS headers in VS 2017 without including intrin.h, so we
can't implement it in the header anymore.

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

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

7 years agoSema: prevent __declspec(naked) use on x64
Saleem Abdulrasool [Fri, 7 Apr 2017 15:13:47 +0000 (15:13 +0000)]
Sema: prevent __declspec(naked) use on x64

MSDN (https://msdn.microsoft.com/en-us/library/h5w10wxs.aspx) indicates
that `__declspec(naked)` is only permitted on x86 and ARM targets.
Testing with cl does confirm this behaviour.  Provide a warning for use
of `__declspec(naked)` on x64.

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

7 years agoCloneDetection.h: Fix warnings. [-Wdocumentation]
NAKAMURA Takumi [Fri, 7 Apr 2017 11:06:31 +0000 (11:06 +0000)]
CloneDetection.h: Fix warnings. [-Wdocumentation]

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

7 years ago[scan-build-py] merge runner module to analyzer
Laszlo Nagy [Fri, 7 Apr 2017 11:04:49 +0000 (11:04 +0000)]
[scan-build-py] merge runner module to analyzer

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

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

7 years agoSkip Unicode character expansion in assembly files
Sanne Wouda [Fri, 7 Apr 2017 10:13:00 +0000 (10:13 +0000)]
Skip Unicode character expansion in assembly files

Summary: When using the C preprocessor with assembly files, either with a
capital `S` file extension, or with `-xassembler-with-cpp`, the Unicode escape
sequence `\u` is ignored. The `\u` pattern can be used for expanding a macro
argument that starts with `u`.

Author: Salman Arif <salman.arif@arm.com>

Reviewers: rengolin, olista01

Reviewed By: olista01

Subscribers: cfe-commits

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

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

7 years ago[AMDGPU] Temporarily change constant address space from 4 to 2 for the new address...
Yaxun Liu [Thu, 6 Apr 2017 19:18:36 +0000 (19:18 +0000)]
[AMDGPU] Temporarily change constant address space from 4 to 2 for the new address space mapping

Change constant address space from 4 to 2 for the new address space mapping in Clang.

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

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

7 years ago[Basic] getColumnNumber returns location of CR+LF on Windows
Chih-Hung Hsieh [Thu, 6 Apr 2017 18:36:50 +0000 (18:36 +0000)]
[Basic] getColumnNumber returns location of CR+LF on Windows

When fixing a Clang-Tidy bug in D31406,
reuse of FileID enabled the missing highlightRange function.
Assertion in highlightRange failed because the end-of-range column
number was 2 + the last column of a line on Windows.
This fix is required to enable D31406.

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

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

7 years ago[AMDGPU] Translate reqd_work_group_size into amdgpu_flat_work_group_size
Stanislav Mekhanoshin [Thu, 6 Apr 2017 18:15:44 +0000 (18:15 +0000)]
[AMDGPU] Translate reqd_work_group_size into amdgpu_flat_work_group_size

These two attributes specify the same info in a different way.
AMGPU BE only checks the latter as a target specific attribute
as opposed to language specific reqd_work_group_size.

This change produces amdgpu_flat_work_group_size out of
reqd_work_group_size if specified.

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

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

7 years agoFix unused lambda capture. Follow up to r299653.
Ivan Krasin [Thu, 6 Apr 2017 17:42:05 +0000 (17:42 +0000)]
Fix unused lambda capture. Follow up to r299653.

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

7 years ago[analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector"
Artem Dergachev [Thu, 6 Apr 2017 14:34:07 +0000 (14:34 +0000)]
[analyzer] Reland r299544 "Add a modular constraint system to the CloneDetector"

Hopefully fix crashes by unshadowing the variable.

Original commit message:

A big part of the clone detection code is functionality for filtering clones and
clone groups based on different criteria. So far this filtering process was
hardcoded into the CloneDetector class, which made it hard to understand and,
ultimately, to extend.

This patch splits the CloneDetector's logic into a sequence of reusable
constraints that are used for filtering clone groups. These constraints
can be turned on and off and reodreder at will, and new constraints are easy
to implement if necessary.

Unit tests are added for the new constraint interface.

This is a refactoring patch - no functional change intended.

Patch by Raphael Isemann!

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

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

7 years agoAvoid the -Wdocumentation-unknown-command warning in Clang's C API docs
Alex Lorenz [Thu, 6 Apr 2017 14:03:25 +0000 (14:03 +0000)]
Avoid the -Wdocumentation-unknown-command warning in Clang's C API docs

rdar://20441985

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

7 years ago[ObjC++] Conversions from specialized to non-specialized Objective-C generic
Alex Lorenz [Thu, 6 Apr 2017 13:06:34 +0000 (13:06 +0000)]
[ObjC++] Conversions from specialized to non-specialized Objective-C generic
object types should be preferred over conversions to other object pointers

This change ensures that Clang will select the correct overload for the
following code sample:

  void overload(Base *b);
  void overload(Derived *d);
  void test(Base<Base *> b) {
    overload(b); // Select overload(Base *), not overload(Derived *)
  }

rdar://20124827

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

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

7 years agoFix lambda to block conversion in C++17 by avoiding copy elision for the
Alex Lorenz [Thu, 6 Apr 2017 12:53:43 +0000 (12:53 +0000)]
Fix lambda to block conversion in C++17 by avoiding copy elision for the
lambda capture used by the created block

The commit r288866 introduced guaranteed copy elision to C++ 17. This
unfortunately broke the lambda to block conversion in C++17 (the compiler
crashes when performing IRGen). This commit fixes the conversion by avoiding
copy elision for the capture that captures the lambda that's used in the block
created by the lambda to block conversion process.

rdar://31385153

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

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

7 years ago[Sema] Retarget test to a specific platform for consistent datasizes
Simon Dardis [Thu, 6 Apr 2017 11:12:14 +0000 (11:12 +0000)]
[Sema] Retarget test to a specific platform for consistent datasizes

Attempt to satisfy llvm-clang-x86_64-expensive-checks-win by targeting
x86_64-apple-darwin10 for Sema/vector-ops.c. The underlying failure is
due to datatype differences between platforms.

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

7 years ago[Sema] Extend GetSignedVectorType to deal with non ExtVector types
Simon Dardis [Thu, 6 Apr 2017 10:38:03 +0000 (10:38 +0000)]
[Sema] Extend GetSignedVectorType to deal with non ExtVector types

This improves some error messages which would otherwise refer to
ext_vector_type types in contexts where there are no such types.

Factored out from D25866 at reviewer's request.

Reviewers: bruno

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

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

7 years agoPR16106: Correct the docs to reflect the actual behavior of the interface.
Vassil Vassilev [Thu, 6 Apr 2017 10:05:46 +0000 (10:05 +0000)]
PR16106: Correct the docs to reflect the actual behavior of the interface.

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

7 years ago[Sema] Update CheckOverload docs
George Burgess IV [Thu, 6 Apr 2017 00:23:31 +0000 (00:23 +0000)]
[Sema] Update CheckOverload docs

- Replace documented return values (true/false) with what's actually
  returned
- Doxygenify the comment
- Reflow said comment to 80 cols

Not overly familiar with Doxygen, so nits are welcome. :)

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

7 years agoSimplify. NFC.
George Burgess IV [Thu, 6 Apr 2017 00:08:35 +0000 (00:08 +0000)]
Simplify. NFC.

Two simplifications:
- We check `!Previous.empty()` above and only use `Previous` in const
  contexts after that check, so the `!Previous.empty()` check seems
  redundant.
- The null check looks pointless, as well: AFAICT, `LookupResults`
  should never contain null entries, and `OldDecl` should always be
  non-null if `Redeclaration` is true.

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

7 years ago[Driver] Print a newline when invoking `-print-resource-dir`
Meador Inge [Wed, 5 Apr 2017 22:27:20 +0000 (22:27 +0000)]
[Driver] Print a newline when invoking `-print-resource-dir`

The commit yesterday (r299473) to add the `-print-resource-dir`
option was supposed to emit a newline after the resource dir.

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

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

7 years ago[lit] Fix Analysis test format pickling error
Reid Kleckner [Wed, 5 Apr 2017 18:56:48 +0000 (18:56 +0000)]
[lit] Fix Analysis test format pickling error

Move the test format into a standalone .py file and add it to the site
module search path. This allows us to run the test on Windows, and it
makes it compatible with the multiprocessing.Pool lit test execution
strategy.

I think this test was only passing everywhere else because
multiprocessing uses 'fork' to spawn workers, so the test format never
needs to be pickled.

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

7 years agoclang-format: Support formatting utf-8 character literals in C++11+ mode.
Nico Weber [Wed, 5 Apr 2017 18:10:42 +0000 (18:10 +0000)]
clang-format: Support formatting utf-8 character literals in C++11+ mode.

clang-format <<END
auto c1 = u8'a';
auto c2 = u'a';
END

Before:
  auto c1 = u8 'a';
  auto c2 = u'a';

Now:
  auto c1 = u8'a';
  auto c2 = u'a';

Patch from Denis Gladkikh <llvm@denis.gladkikh.email>!

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

7 years agoRevert "[analyzer] Add a modular constraint system to the CloneDetector"
Artem Dergachev [Wed, 5 Apr 2017 15:06:17 +0000 (15:06 +0000)]
Revert "[analyzer] Add a modular constraint system to the CloneDetector"

This reverts commit r299544.

Crashes on tests on some buildbots.

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

7 years ago[analyzer] Add a modular constraint system to the CloneDetector
Artem Dergachev [Wed, 5 Apr 2017 14:17:36 +0000 (14:17 +0000)]
[analyzer] Add a modular constraint system to the CloneDetector

A big part of the clone detection code is functionality for filtering clones and
clone groups based on different criteria. So far this filtering process was
hardcoded into the CloneDetector class, which made it hard to understand and,
ultimately, to extend.

This patch splits the CloneDetector's logic into a sequence of reusable
constraints that are used for filtering clone groups. These constraints
can be turned on and off and reodreder at will, and new constraints are easy
to implement if necessary.

Unit tests are added for the new constraint interface.

This is a refactoring patch - no functional change intended.

Patch by Raphael Isemann!

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

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

7 years agoclang-format-vsix: Add "Format on Save" feature
Antonio Maiorano [Wed, 5 Apr 2017 14:13:45 +0000 (14:13 +0000)]
clang-format-vsix: Add "Format on Save" feature

This change adds a feature to the clang-format VS extension that optionally
enables the automatic formatting of documents when saving. Since developers
always need to save their files, this eases the workflow of making sure source
files are properly formatted.

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

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

7 years ago-Wunreachable-code: 'true' and 'false' should not be treated as configuration
Alex Lorenz [Wed, 5 Apr 2017 14:07:21 +0000 (14:07 +0000)]
-Wunreachable-code: 'true' and 'false' should not be treated as configuration
macros

Clang should emit -Wunreachable-code warnings in C mode for code that's
unreachable because of a 'false' or '!true' condition.

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

7 years ago[OpenCL] Extended diagnostics for atomic initialization
Egor Churaev [Wed, 5 Apr 2017 12:47:10 +0000 (12:47 +0000)]
[OpenCL] Extended diagnostics for atomic initialization

Summary:
I saw the same changes in the following review: https://reviews.llvm.org/D17438

I don't know in that way I could determine that atomic variable was initialized by macro ATOMIC_VAR_INIT. Anyway I added check that atomic variables can be initialize only in global scope.
I think that we can discuss this change.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years agoclang-format: [JS] fix whitespace around "of" operator.
Martin Probst [Wed, 5 Apr 2017 10:56:07 +0000 (10:56 +0000)]
clang-format: [JS] fix whitespace around "of" operator.

Summary:
Previously:
    import {of } from 'x';
    of (null);

Now:
    import {of} from 'x';
    of(null);

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[OpenCL] Enables passing sampler initializer to function argument
Egor Churaev [Wed, 5 Apr 2017 09:02:56 +0000 (09:02 +0000)]
[OpenCL] Enables passing sampler initializer to function argument

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: yaxunl, bader

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

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

7 years ago[analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression...
Daniel Marjamaki [Wed, 5 Apr 2017 08:57:04 +0000 (08:57 +0000)]
[analyzer] alpha.core.Conversion - Fix false positive for 'U32 += S16;' expression, that is not unsafe

Summary:
The alpha.core.Conversion was too strict about compound assignments and could warn even though there is no problem.

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

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

7 years agoDon't issue a warning if the shadowing declaration is in a class
Stephan Bergmann [Wed, 5 Apr 2017 08:36:58 +0000 (08:36 +0000)]
Don't issue a warning if the shadowing declaration is in a class

Follow-up to r299363 "Enhance -Wshadow to warn when shadowing typedefs or type
aliases".

Patch by Ahmed Asadi.

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

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

7 years ago[coroutines] Add coro.end handling
Gor Nishanov [Wed, 5 Apr 2017 04:55:03 +0000 (04:55 +0000)]
[coroutines] Add coro.end handling

Summary:
For WinEH, We add a funclet bundle to a coro.end call, so that CoroSplit in LLVM can replace it with cleanup ret and cut the rest out.
For landing pad, we add a branch to resume block if coro.end returns true.

LLVM Part: https://reviews.llvm.org/D25445

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: EricWF, cfe-commits, rsmith, mehdi_amini

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

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

7 years agoAnother attempt to fix the sphinx warning from r299470
Adam Nemet [Tue, 4 Apr 2017 23:46:34 +0000 (23:46 +0000)]
Another attempt to fix the sphinx warning from r299470

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

7 years agoFix sphinx warning from r299470
Adam Nemet [Tue, 4 Apr 2017 22:45:20 +0000 (22:45 +0000)]
Fix sphinx warning from r299470

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

7 years ago[Driver] Add option to print the resource directory
Meador Inge [Tue, 4 Apr 2017 21:46:50 +0000 (21:46 +0000)]
[Driver] Add option to print the resource directory

This patch adds the option -print-resource-dir. It simply
prints the resource directory. This information will eventually
be used in compiler-rt to setup COMPILER_RT_LIBRARY_INSTALL_DIR.

Patch by Catherine Moore!

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

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

7 years agoAdd #pragma clang fp
Adam Nemet [Tue, 4 Apr 2017 21:18:36 +0000 (21:18 +0000)]
Add #pragma clang fp

This adds the new pragma and the first variant, contract(on/off/fast).

The pragma has the same block scope rules as STDC FP_CONTRACT, i.e. it can be
placed at the beginning of a compound statement or at file scope.

Similarly to STDC FP_CONTRACT there is no need to use attributes.  First an
annotate token is inserted with the parsed details of the pragma.  Then the
annotate token is parsed in the proper contexts and the Sema is updated with
the corresponding FPOptions using the shared ActOn function with STDC
FP_CONTRACT.

After this the FPOptions from the Sema is propagated into the AST expression
nodes.  There is no change here.

I was going to add a 'default' option besides 'on/off/fast' similar to STDC
FP_CONTRACT but then decided against it. I think that we'd have to make option
uppercase then to avoid using 'default' the keyword.  Also because of the
scoped activation of pragma I am not sure there is really a need a for this.

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

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

7 years agoSet FMF for -ffp-contract=fast
Adam Nemet [Tue, 4 Apr 2017 21:18:30 +0000 (21:18 +0000)]
Set FMF for -ffp-contract=fast

With this, FMF(contract) becomes an alternative way to express the request to
contract.

These are currently only propagated for FMul, FAdd and FSub.  The rest will be
added as more FMFs are hooked up for this.

This is toward fixing PR25721.

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

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

7 years ago[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)
Matthias Gehre [Tue, 4 Apr 2017 20:11:13 +0000 (20:11 +0000)]
[clang-format] fix crash in NamespaceEndCommentsFixer (PR32438)

Summary:
The new test case was crashing before. Now it passes
as expected.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[analyzer] Add new Z3 constraint manager backend
Dominic Chen [Tue, 4 Apr 2017 19:52:25 +0000 (19:52 +0000)]
[analyzer] Add new Z3 constraint manager backend

Summary: Implement new Z3 constraint manager backend.

Reviewers: zaks.anna, dcoughlin, NoQ, xazax.hun

Subscribers: mgorny, cfe-commits

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

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

7 years ago[fixup][X86][inline-asm] Add support for MS 'EVEN' directive
Coby Tayree [Tue, 4 Apr 2017 19:20:21 +0000 (19:20 +0000)]
[fixup][X86][inline-asm] Add support for MS 'EVEN' directive

refining tested targets resolution, to amend failures caused by rL299454

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

7 years ago[X86][inline-asm] Add support for MS 'EVEN' directive
Coby Tayree [Tue, 4 Apr 2017 17:58:28 +0000 (17:58 +0000)]
[X86][inline-asm] Add support for MS 'EVEN' directive

MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'.
This patch include the (small, simple) changes need to allow it.

llvm-side:
https://reviews.llvm.org/D27417

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

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

7 years ago[Bug 25404] Fix crash on typedef in OpenCL 2.0
Anastasia Stulova [Tue, 4 Apr 2017 16:50:46 +0000 (16:50 +0000)]
[Bug 25404] Fix crash on typedef in OpenCL 2.0

Fixed the assertion due to absence of source location for
implicitly defined types (using addImplicitTypedef()).
During Sema checks the source location is being expected
and therefore an assertion is triggered.

The change is not specific to OpenCL. But it is particularly
common for OpenCL types to be declared implicitly in Clang
to support the mode without the standard header.

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

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

7 years agoPreserve vec3 type.
Jin-Gu Kang [Tue, 4 Apr 2017 16:40:25 +0000 (16:40 +0000)]
Preserve vec3 type.

Summary: Preserve vec3 type with CodeGen option.

Reviewers: Anastasia, bruno

Reviewed By: Anastasia

Subscribers: bruno, ahatanak, cfe-commits

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

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

7 years agoFix problem with test.
Michael Zuckerman [Tue, 4 Apr 2017 15:44:06 +0000 (15:44 +0000)]
Fix problem with test.

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

7 years ago[X86][Clang] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into generic...
Michael Zuckerman [Tue, 4 Apr 2017 13:29:53 +0000 (13:29 +0000)]
[X86][Clang] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into generic intrinsics.

This patch is a part two of two reviews, one for the clang and the other for LLVM.
In this patch, I covered the clang side, by introducing the intrinsic to the front end.
This is done by creating a generic replacement.

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

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

7 years ago[X86] Remove some code that tries to disable HLE feature. This feature flag was remov...
Craig Topper [Tue, 4 Apr 2017 06:38:44 +0000 (06:38 +0000)]
[X86] Remove some code that tries to disable HLE feature. This feature flag was removed from the backend.

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

7 years agoModules/builtins.m requires shell.
Galina Kistanova [Tue, 4 Apr 2017 02:50:40 +0000 (02:50 +0000)]
Modules/builtins.m requires shell.

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

7 years agoRecommit r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnin...
Craig Topper [Mon, 3 Apr 2017 22:59:30 +0000 (22:59 +0000)]
Recommit r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.'

The bot didn't recover after the revert. So it looks like this wasn't the issue.

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

7 years agoRevert r299355 "[ASTImporter] Fix for importing unnamed structs"
Gabor Horvath [Mon, 3 Apr 2017 21:06:45 +0000 (21:06 +0000)]
Revert r299355 "[ASTImporter] Fix for importing unnamed structs"

It breaks windows bots.

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

7 years agoRevert r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings...
Craig Topper [Mon, 3 Apr 2017 19:43:47 +0000 (19:43 +0000)]
Revert r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.' to see if recovers a fuzzer bot.

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

7 years ago[coroutines] Fix rebuilding of implicit and dependent coroutine statements.
Eric Fiselier [Mon, 3 Apr 2017 19:21:00 +0000 (19:21 +0000)]
[coroutines] Fix rebuilding of implicit and dependent coroutine statements.

Summary:
Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed.

This patch fixes an issue where these statements would never be built for coroutine templates.

It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed.

Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

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

7 years ago[TargetInfo] Use llvm::alignOf() instead of rewriting it. NFCI.
Davide Italiano [Mon, 3 Apr 2017 16:51:39 +0000 (16:51 +0000)]
[TargetInfo] Use llvm::alignOf() instead of rewriting it. NFCI.

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

7 years agoEnhance -Wshadow to warn when shadowing typedefs or type aliases
Alex Lorenz [Mon, 3 Apr 2017 16:43:21 +0000 (16:43 +0000)]
Enhance -Wshadow to warn when shadowing typedefs or type aliases

Enhance -Wshadow to emit a warning when typedefs or type aliases are shadowed.

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

Patch by Ahmed Asadi.

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

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

7 years ago[ASTImporter] Fix for importing unnamed structs
Gabor Horvath [Mon, 3 Apr 2017 11:57:11 +0000 (11:57 +0000)]
[ASTImporter] Fix for importing unnamed structs

Patch by Peter Szecsi!

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

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

7 years ago[ASTImporter] Lookup SearchName instead of Name
Gabor Horvath [Mon, 3 Apr 2017 09:30:20 +0000 (09:30 +0000)]
[ASTImporter] Lookup SearchName instead of Name

When the SearchName is already calculated we should use that for the lookup.

Patch by Peter Szecsi!

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

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

7 years ago[AVX-512] Fix a couple more intrinsic macros I missed in r299346.
Craig Topper [Mon, 3 Apr 2017 03:51:57 +0000 (03:51 +0000)]
[AVX-512] Fix a couple more intrinsic macros I missed in r299346.

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

7 years ago[AVX-512] Fix some intrinsic macros that use the wrong macro parameter names and...
Craig Topper [Mon, 3 Apr 2017 03:41:29 +0000 (03:41 +0000)]
[AVX-512] Fix some intrinsic macros that use the wrong macro parameter names and don't have parentheses around them.

Thanks to Matthew Barr for reporting this issue.

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

7 years ago[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound...
Craig Topper [Sun, 2 Apr 2017 03:02:53 +0000 (03:02 +0000)]
[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.

Fixes PR32491.

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

7 years ago[NFC, Scoped Enum] Convert Sema::ExpressionEvaluationContext into a scoped Enum
Faisal Vali [Sat, 1 Apr 2017 21:30:49 +0000 (21:30 +0000)]
[NFC, Scoped Enum] Convert Sema::ExpressionEvaluationContext into a scoped Enum

- also replace direct equality checks against the ConstantEvaluated enumerator  with isConstantEvaluted(), in anticipation of adding finer granularity to the various ConstantEvaluated contexts and reinstating certain restrictions on where lambda expressions can occur in C++17.

- update the clang tablegen backend that uses these Enumerators, and add the relevant scope where needed.

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

7 years ago[Driver] Don't crash on invalid values of -mrelocation-model=.
Davide Italiano [Sat, 1 Apr 2017 21:07:07 +0000 (21:07 +0000)]
[Driver] Don't crash on invalid values of -mrelocation-model=.

This is handled in a similar way we handle invalid -mcode-model.

PR: 31840

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

7 years ago[ObjC++] Use the correct EH personality in GNU mode
Benjamin Kramer [Sat, 1 Apr 2017 17:59:01 +0000 (17:59 +0000)]
[ObjC++] Use the correct EH personality in GNU mode

Previously, it would just always use the ObjC DWARF personality, even with SjLj
or SEH exceptions.

Patch by Jonathan Schleifer, test case by me.

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

7 years ago[coroutines] Add cleanup for compiler injected objects/allocations in coroutine body
Gor Nishanov [Sat, 1 Apr 2017 00:22:47 +0000 (00:22 +0000)]
[coroutines] Add cleanup for compiler injected objects/allocations in coroutine body

Summary:
* Use pushCleanup to emit freeing coroutine memory on normal and EH exits.
* Surround emitted code with CodeGenFunction::RunCleanupsScope.

Reviewers: rsmith, rnk, EricWF

Reviewed By: rnk

Subscribers: cfe-commits

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

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

7 years ago[ThinLTO] Handle -emit-llvm* in ThinLTO backends
Teresa Johnson [Fri, 31 Mar 2017 22:35:47 +0000 (22:35 +0000)]
[ThinLTO] Handle -emit-llvm* in ThinLTO backends

Summary:
Use PreCodeGenModuleHook to invoke the correct writer when emitting LLVM
IR, returning false to skip codegen from within thinBackend.

Reviewers: pcc, mehdi_amini

Subscribers: Prazek, cfe-commits

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

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

7 years agoAdd/update PIE defaults for OpenBSD.
Brad Smith [Fri, 31 Mar 2017 22:13:17 +0000 (22:13 +0000)]
Add/update PIE defaults for OpenBSD.

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

7 years ago[Sema][X86] Update immediate check for gather/scatter prefetch instructions to match...
Craig Topper [Fri, 31 Mar 2017 17:22:30 +0000 (17:22 +0000)]
[Sema][X86] Update immediate check for gather/scatter prefetch instructions to match the _MM_HINT_T0/T1 constant definitions

Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too.

Fixes PR32411.

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

7 years ago[mips][msa] Range adjustment for ldi_b builtin function operand
Petar Jovanovic [Fri, 31 Mar 2017 16:16:43 +0000 (16:16 +0000)]
[mips][msa] Range adjustment for ldi_b builtin function operand

Reasoning behind this change was allowing the function to accept all values
from range [-128, 255] since all of them can be encoded in an 8bit wide
value.
This differs from the prior state where only range [-128, 127] was accepted,
where values were assumed to be signed, whereas now the actual
interpretation of the immediate is deferred to the consumer as required.

Patch by Stefan Maksimovic.

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

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

7 years ago[Modules][PCH] Serialize #pragma pack
Alex Lorenz [Fri, 31 Mar 2017 15:36:21 +0000 (15:36 +0000)]
[Modules][PCH] Serialize #pragma pack

This patch serializes the state of #pragma pack. It preserves the state of the
pragma from a PCH/from modules in a file that uses that PCH/those modules.

rdar://21359084

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

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

7 years agoAdd back test for r299152
Teresa Johnson [Fri, 31 Mar 2017 13:48:18 +0000 (13:48 +0000)]
Add back test for r299152

I am hoping the bot failures are addressed by using cc1 for the ThinLTO
backend invocations as well.

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

7 years agoclang-format: Fix post-commit review comment of r299204, use Style.isCpp().
Daniel Jasper [Fri, 31 Mar 2017 13:30:24 +0000 (13:30 +0000)]
clang-format: Fix post-commit review comment of r299204, use Style.isCpp().

Also, while at it, s/IsCpp/isCpp/ so that it follows LLVM style.

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

7 years agoclang-format vs plugin support for Visual Studio 2017
Hans Wennborg [Fri, 31 Mar 2017 12:50:42 +0000 (12:50 +0000)]
clang-format vs plugin support for Visual Studio 2017

With the release of Visual Studio 2017, we need to at the very least
claim support for it in the current manifest file. With the changes
introducted in this patch we can install the extension again, but a
warning message will be shown stating that it's not supported
(https://twitter.com/parsley72/status/846558416751411200).

To get the rid of the warning more work is necessary, as VS 2017 changed
some things about extensions, see more here:
https://docs.microsoft.com/en-us/visualstudio/extensibility/how-to-migrate-extensibility-projects-to-visual-studio-2017.
While working on those changes, it has been suggested in the
mail list that this first patch is integrated in the meantime.

Patch by Hugo Puhlmann!

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

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

7 years agoclang-format: [JavaScript] Ignore QT keywords.
Daniel Jasper [Fri, 31 Mar 2017 12:04:37 +0000 (12:04 +0000)]
clang-format: [JavaScript] Ignore QT keywords.

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

7 years agoSpelling mistakes in comments. NFCI.
Simon Pilgrim [Fri, 31 Mar 2017 11:00:53 +0000 (11:00 +0000)]
Spelling mistakes in comments. NFCI.

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

7 years agoStrip trailing whitespace
Simon Pilgrim [Fri, 31 Mar 2017 10:40:56 +0000 (10:40 +0000)]
Strip trailing whitespace

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

7 years ago[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args
Egor Churaev [Fri, 31 Mar 2017 10:14:52 +0000 (10:14 +0000)]
[OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args

Summary:
"kernel_arg_type_qual" metadata should contain const/volatile/restrict
tags only for pointer types to match the corresponding requirement of
the OpenCL specification.

OpenCL 2.0 spec 5.9.3 Kernel Object Queries:

CL_KERNEL_ARG_TYPE_VOLATILE is returned if the argument is a pointer
and the referenced type is declared with the volatile qualifier.
[...]
Similarly, CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a
pointer and the referenced type is declared with the restrict or const
qualifier.
[...]
CL_KERNEL_ARG_TYPE_RESTRICT will be returned if the pointer type is
marked restrict.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

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

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

7 years ago[msan] Turn off lifetime markers even when use after scope checking is on.
Benjamin Kramer [Fri, 31 Mar 2017 09:19:25 +0000 (09:19 +0000)]
[msan] Turn off lifetime markers even when use after scope checking is on.

Since r299174 use after scope checking is on by default. Even though
msan doesn't check for use after scope it gets confused by the lifetime
markers emitted for it, making unit tests fail. This is covered by
ninja check-msan.

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

7 years agoRevert test added in r299152
Teresa Johnson [Fri, 31 Mar 2017 04:29:07 +0000 (04:29 +0000)]
Revert test added in r299152

Removing the test until I can figure out how to get the ThinLTO backend
invocation of clang to use the correct target.

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

7 years agoAdd target-cpu
Teresa Johnson [Fri, 31 Mar 2017 03:49:52 +0000 (03:49 +0000)]
Add target-cpu

Sigh, another follow-on fix needed for test in r299152 causing bot
failures. We also need the target-cpu for the ThinLTO BE clang
invocation.

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

7 years agoAdd more target triples to test
Teresa Johnson [Fri, 31 Mar 2017 03:27:47 +0000 (03:27 +0000)]
Add more target triples to test

Third and hopefully final fix to test for r299152 that is causing bot
failures: make sure the target triple specified for the ThinLTO backend
clang invocations as well.

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