]> granicus.if.org Git - clang/log
clang
7 years ago[Sema] Mark undefined ctors as deleted. NFC.
George Burgess IV [Thu, 5 Jan 2017 01:21:21 +0000 (01:21 +0000)]
[Sema] Mark undefined ctors as deleted. NFC.

Looks like these functions exist just to prevent bad implicit
conversions. Rather than waiting for the linker to complain about
undefined references to them, we can mark them as deleted.

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

7 years ago[MS] Instantiate default args during instantiation of exported default ctors
Reid Kleckner [Thu, 5 Jan 2017 01:08:22 +0000 (01:08 +0000)]
[MS] Instantiate default args during instantiation of exported default ctors

Summary:
Replace some old code that probably pre-dated the change to delay
emission of dllexported code until after the closing brace of the
outermost record type. Only uninstantiated default argument expressions
need to be handled now. It is enough to instantiate default argument
expressions when instantiating dllexported default ctors. This also
fixes some double-diagnostic issues in this area.

Fixes PR31500

Reviewers: rsmith

Subscribers: cfe-commits

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

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

7 years agoCorrect Vectorcall Register passing and HVA Behavior
Erich Keane [Thu, 5 Jan 2017 00:20:51 +0000 (00:20 +0000)]
Correct Vectorcall Register passing and HVA Behavior

Front end component (back end changes are D27392).  The vectorcall
calling convention was broken subtly in two cases.  First,
it didn't properly handle homogeneous vector aggregates (HVAs).
Second, the vectorcall specification requires that only the
first 6 parameters be eligible for register assignment.
This patch fixes both issues.

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

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

7 years ago[gtest] The way EXPECT_TEST now works after upgrading gtest triggers an
Chandler Carruth [Wed, 4 Jan 2017 23:57:25 +0000 (23:57 +0000)]
[gtest] The way EXPECT_TEST now works after upgrading gtest triggers an
ODR use. These traits don't have a definition as they're intended to be
used strictly at compile time. Change the tests to use static_assert to
move the entire thing into compile-time.

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

7 years agoOnly instantiate members of nested classes in local classes once, rather than once...
Richard Smith [Wed, 4 Jan 2017 23:45:01 +0000 (23:45 +0000)]
Only instantiate members of nested classes in local classes once, rather than once per enclosing class.

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

7 years agoBail out if we try to build a DeclRefExpr naming an invalid declaration.
Richard Smith [Wed, 4 Jan 2017 23:14:16 +0000 (23:14 +0000)]
Bail out if we try to build a DeclRefExpr naming an invalid declaration.

Most code paths would already bail out in this case, but certain paths,
particularly overload resolution and typo correction, would not. Carrying on
with an invalid declaration could in some cases result in crashes due to
downstream code relying on declaration invariants that are not necessarily
met for invalid declarations, and in other cases just resulted in undesirable
follow-on diagnostics.

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

7 years ago[Parse] Don't ignore attributes after a late-parsed attr.
George Burgess IV [Wed, 4 Jan 2017 22:43:01 +0000 (22:43 +0000)]
[Parse] Don't ignore attributes after a late-parsed attr.

Without this, we drop everything after the first late-parsed attribute
in a single __attribute__. (Where "drop" means "stuff everything into
LA->Toks.")

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

7 years agoFix for LLVM Bitcode API change (to use std::shared_ptr)
David Blaikie [Wed, 4 Jan 2017 22:36:43 +0000 (22:36 +0000)]
Fix for LLVM Bitcode API change (to use std::shared_ptr)

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

7 years agoRemove use of intrusive ref count ownership acquisition
David Blaikie [Wed, 4 Jan 2017 22:36:39 +0000 (22:36 +0000)]
Remove use of intrusive ref count ownership acquisition

The one use of CheckerManager (AnalysisConsumer, calling
createCheckerManager) keeps a strong reference to the AnalysisOptions
anyway, so this ownership wasn't necessary.

(I'm not even sure AnalysisOptions needs ref counting at all - but
that's more involved)

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

7 years agoFix failure to treat overloaded function in braced-init-list as a non-deduced context.
Richard Smith [Wed, 4 Jan 2017 22:03:59 +0000 (22:03 +0000)]
Fix failure to treat overloaded function in braced-init-list as a non-deduced context.

Previously, if an overloaded function in a braced-init-list was encountered in
template argument deduction, and the overload set couldn't be resolved to a
particular function, we'd immediately produce a deduction failure. That's not
correct; this situation is supposed to result in that particular P/A pair being
treated as a non-deduced context, and deduction can still succeed if the type
can be deduced from elsewhere.

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

7 years agoRevert accidentally-committed file.
Richard Smith [Wed, 4 Jan 2017 19:48:07 +0000 (19:48 +0000)]
Revert accidentally-committed file.

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

7 years agoFactor out duplicated code and simplify.
Richard Smith [Wed, 4 Jan 2017 19:47:19 +0000 (19:47 +0000)]
Factor out duplicated code and simplify.

No functionality change intended.

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

7 years ago[Sema] Replace remove_if+erase with erase_if. NFC.
George Burgess IV [Wed, 4 Jan 2017 19:16:29 +0000 (19:16 +0000)]
[Sema] Replace remove_if+erase with erase_if. NFC.

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

7 years agoSupport -fno-delayed-template-parsing in clang-cl.exe
Reid Kleckner [Wed, 4 Jan 2017 19:15:53 +0000 (19:15 +0000)]
Support -fno-delayed-template-parsing in clang-cl.exe

Summary:
This change adds support for the -fno-delayed-template-parsing option in
clang-cl.exe. This allows developers using clang-cl.exe to opt out of
emulation of MSVC's non-conformant template instantiation implementation
while continuing to use clang-cl.exe for its emulation of cl.exe
command-line options. The default behavior of clang-cl.exe
(-fdelayed-template-parsing) is unchanged.

The MSVC Standard Library implementation uses clang-cl.exe with this
switch in its tests to ensure that the library headers work on compilers
with the conformant two-phase-lookup behavior.

Reviewers: majnemer, cfe-commits, DaveBartolomeo

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

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

7 years agoReverting commit r290983 while debugging test failure on windows.
Arpith Chacko Jacob [Wed, 4 Jan 2017 19:14:43 +0000 (19:14 +0000)]
Reverting commit r290983 while debugging test failure on windows.

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

7 years agoUse -### so the mbig-obj.c test passes when there is no registered x86 target
Reid Kleckner [Wed, 4 Jan 2017 18:50:51 +0000 (18:50 +0000)]
Use -### so the mbig-obj.c test passes when there is no registered x86 target

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

7 years ago[OpenMP] Update target codegen for NVPTX device.
Arpith Chacko Jacob [Wed, 4 Jan 2017 18:44:50 +0000 (18:44 +0000)]
[OpenMP] Update target codegen for NVPTX device.

This patch includes updates for codegen of the target region for the NVPTX
device. It moves initializers from the compiler to the runtime and updates
the worker loop to assume parallel work is retrieved from the runtime. A
subsequent patch will update the codegen to retrieve the parallel work using
calls to the runtime. It includes the removal of the inline attribute
for the worker loop and disabling debug info in it.

This allows codegen for a target directive and serial execution on the
NVPTX device.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28125

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

7 years ago[CUDA] Pre-include sm_60 and sm_61 headers.
Artem Belevich [Wed, 4 Jan 2017 18:39:29 +0000 (18:39 +0000)]
[CUDA] Pre-include sm_60 and sm_61 headers.

CUDA-8.0 comes with new headers which nvcc pre-includes via cuda_runtime.h
Clang now makes them available as well.

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

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

7 years agoAccept and ignore -Wa,-mbig-obj on COFF targets for gas compatibility
Reid Kleckner [Wed, 4 Jan 2017 18:16:32 +0000 (18:16 +0000)]
Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibility

LLVM's integrated assembler will automatically switch to big objects
when there are more than 2**16 sections.

Patch by Kyra!

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

7 years agoFix a buildbot failure introduced by r290960.
Alex Lorenz [Wed, 4 Jan 2017 15:07:13 +0000 (15:07 +0000)]
Fix a buildbot failure introduced by r290960.

The commit r290960 checked the the basic block label name which isn't there
when clang is compiled in release mode.

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

7 years agoAdd -f[no-]strict-return flag that can be used to avoid undefined behaviour
Alex Lorenz [Wed, 4 Jan 2017 13:40:34 +0000 (13:40 +0000)]
Add -f[no-]strict-return flag that can be used to avoid undefined behaviour
in non-void functions that fall off at the end without returning a value when
compiling C++.

Clang uses the new compiler flag to determine when it should treat control flow
paths that fall off the end of a non-void function as unreachable. If
-fno-strict-return is on, the code generator emits the ureachable and trap
IR only when the function returns either a record type with a non-trivial
destructor or another non-trivially copyable type.

The primary goal of this flag is to avoid treating falling off the end of a
non-void function as undefined behaviour. The burden of undefined behaviour
is placed on the caller instead: if the caller ignores the returned value then
the undefined behaviour is avoided. This kind of behaviour is useful in
several cases, e.g. when compiling C code in C++ mode.

rdar://13102603

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

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

7 years agoclang-format: [JS] avoid indent after ambient function declarations.
Martin Probst [Wed, 4 Jan 2017 13:36:43 +0000 (13:36 +0000)]
clang-format: [JS] avoid indent after ambient function declarations.

Summary:
Before:
  declare function foo();
    let x = 1;

After:
  declare function foo();
  let x = 1;

The problem was that clang-format would unconditionally try to parse a child block, even though ambient function declarations do not have a body (similar to forward declarations).

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[clang] Update lit config in utils/perf-training
Alexander Shaposhnikov [Wed, 4 Jan 2017 04:33:28 +0000 (04:33 +0000)]
[clang] Update lit config in utils/perf-training

This diff replaces --driver-mode=cpp in
utils/perf-training/order-files.lit.cfg and
utils/perf-training/lit.cfg with --driver-mode=g++.
clang --driver-mode=cpp will call the preprocessor and will not
trigger compilation.

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

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

7 years agoFix deduction of pack elements after a braced-init-list.
Richard Smith [Wed, 4 Jan 2017 02:59:16 +0000 (02:59 +0000)]
Fix deduction of pack elements after a braced-init-list.

Previously, if the arguments for a parameter pack contained a braced-init-list,
we would abort deduction (keeping the pack deductions from prior arguments) at
the point when we reached the braced-init-list, resulting in wrong deductions
and rejects-valids. We now just leave a "hole" in the pack for such an argument,
which needs to be filled by another deduction of the same pack.

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

7 years agoChange clang-format's Chromium JavaScript defaults
Nico Weber [Wed, 4 Jan 2017 02:33:36 +0000 (02:33 +0000)]
Change clang-format's Chromium JavaScript defaults

Chromium is starting to use clang-format on more JavaScript.

In doing this, we discovered that our defaults were not doing a good job
differentiating between JS and C++.

This change moves some defaults to only apply to C++.
https://reviews.llvm.org/D28165

Patch from Dan Beam <dbeam@chromium.org>!

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

7 years agoRemove accidentally-added lines in r290923 test, and add another testcase.
Richard Smith [Wed, 4 Jan 2017 02:03:39 +0000 (02:03 +0000)]
Remove accidentally-added lines in r290923 test, and add another testcase.

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

7 years agoFix template argument deduction when only some of a parameter pack is a non-deduced...
Richard Smith [Wed, 4 Jan 2017 01:48:55 +0000 (01:48 +0000)]
Fix template argument deduction when only some of a parameter pack is a non-deduced context.

When a parameter pack has multiple corresponding arguments, and some subset of
them are overloaded functions, it's possible that some subset of the parameters
are non-deduced contexts. In such a case, keep deducing from the remainder of
the arguments, and resolve the incomplete pack against whatever other
deductions we've performed for the pack.

GCC, MSVC, and ICC give three different bad behaviors for this case; what we do
now (and what we did before) don't exactly match any of them, sadly :( I'm
getting a core issue opened to specify more precisely how this should be
handled.

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

7 years agoExtend -Wtautological-overlap-compare to more cases.
Richard Trieu [Wed, 4 Jan 2017 00:46:30 +0000 (00:46 +0000)]
Extend -Wtautological-overlap-compare to more cases.

Previously, -Wtautological-overlap-compare did not warn on cases where the
boolean expression was in an assignment or return statement.  This patch
should cause all boolean statements to be passed to the tautological compare
checks in the CFG analysis.

This is one of the issues from PR13101

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

7 years agoAdd -plugin-opt=sample-profile for thinLTO build.
Dehao Chen [Wed, 4 Jan 2017 00:33:23 +0000 (00:33 +0000)]
Add -plugin-opt=sample-profile for thinLTO build.

Summary: ThinLTO needs to pass down the sample profile file path to linker.

Reviewers: tejohnson, davidxl, mehdi_amini

Subscribers: bruno, cfe-commits

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

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

7 years agoRe-add objectsize function/incomplete type checks.
George Burgess IV [Tue, 3 Jan 2017 23:35:19 +0000 (23:35 +0000)]
Re-add objectsize function/incomplete type checks.

I accidentally omitted these when refactoring this code. This caused
problems when building parts of the test-suite on MacOS.

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

7 years agoRelax CHECK line from r290906
Reid Kleckner [Tue, 3 Jan 2017 21:29:51 +0000 (21:29 +0000)]
Relax CHECK line from r290906

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

7 years ago[Win64] Don't widen integer literal zero arguments to unprototyped function calls
Reid Kleckner [Tue, 3 Jan 2017 21:23:35 +0000 (21:23 +0000)]
[Win64] Don't widen integer literal zero arguments to unprototyped function calls

The special case to widen the integer literal zero when passed to
variadic function calls should only apply to variadic functions, not
unprototyped functions. This is consistent with what MSVC does. In this
test case, MSVC uses a 4-byte store to pass the 5th argument to 'kr' and
an 8-byte store to pass the zero to 'v':

  void v(int, ...);
  void kr();
  void f(void) {
    v(1, 2, 3, 4, 0);
    kr(1, 2, 3, 4, 0);
  }

Aaron Ballman discovered this issue in https://reviews.llvm.org/D28166

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

7 years ago[OpenMP] Code cleanup for NVPTX OpenMP codegen
Arpith Chacko Jacob [Tue, 3 Jan 2017 20:19:56 +0000 (20:19 +0000)]
[OpenMP] Code cleanup for NVPTX OpenMP codegen

This patch cleans up private methods for NVPTX OpenMP codegen. It converts private
members to static functions to follow the coding style of CGOpenMPRuntime.cpp and
declutter the header file.

Reviewers: ABataev
Differential Revision: https://reviews.llvm.org/D28124

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

7 years ago[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code...
Carlo Bertolli [Tue, 3 Jan 2017 18:24:42 +0000 (18:24 +0000)]
[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code generation

https://reviews.llvm.org/D17840

This patch enables private, firstprivate, and lastprivate clauses for the OpenMP distribute directive.
Regression tests differ from the similar case of the same clauses on the for directive, by removing a reference to two global variables g and g1. This is necessary because: 1. a distribute pragma is only allowed inside a target region; 2. referring a global variable (e.g. g and g1) in a target region requires the program to enclose the variable in a "declare target" region; 3. declare target pragmas, which are used to define a declare target region, are currently unavailable in clang (patch being prepared).
For this reason, I moved the global declarations into local variables.

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

7 years ago[clang-tidy] Add check name to YAML export
Alexander Kornienko [Tue, 3 Jan 2017 14:35:47 +0000 (14:35 +0000)]
[clang-tidy] Add check name to YAML export

Add a field indicating the associated check for every replacement to the YAML
report generated with the '-export-fixes' option.  Update
clang-apply-replacements to handle the new format.

Patch by Alpha Abdoulaye!

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

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

7 years agoHandle StaticAssertDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:16:02 +0000 (12:16 +0000)]
Handle StaticAssertDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle VarTemplateDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:14:59 +0000 (12:14 +0000)]
Handle VarTemplateDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle AccessSpecDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:12:36 +0000 (12:12 +0000)]
Handle AccessSpecDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle ClassTemplateSpecializationDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:11:17 +0000 (12:11 +0000)]
Handle ClassTemplateSpecializationDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle EmptyDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:09:39 +0000 (12:09 +0000)]
Handle EmptyDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle UsingDecl and UsingShadowDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:08:40 +0000 (12:08 +0000)]
Handle UsingDecl and UsingShadowDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years agoHandle FriendDecl in DeclContextPrinter
Alex Lorenz [Tue, 3 Jan 2017 12:07:20 +0000 (12:07 +0000)]
Handle FriendDecl in DeclContextPrinter

This commit fixes a crash that occurs when -print-decl-contexts AST consumer
tries to print an unhandled declaration.

rdar://19467234

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

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

7 years ago[CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializers
Alex Lorenz [Tue, 3 Jan 2017 11:56:40 +0000 (11:56 +0000)]
[CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializers
with arguments

rdar://21014571

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

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ pragma
Kelvin Li [Tue, 3 Jan 2017 05:23:48 +0000 (05:23 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ pragma

This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma.

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

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

7 years agoAdd testcase for the regression introduced in r290808.
Richard Smith [Mon, 2 Jan 2017 23:00:32 +0000 (23:00 +0000)]
Add testcase for the regression introduced in r290808.

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

7 years agoRemove isIgnored()-test that is more expensive than the analysis behind it
Daniel Jasper [Mon, 2 Jan 2017 22:55:45 +0000 (22:55 +0000)]
Remove isIgnored()-test that is more expensive than the analysis behind it

In many translation units I have tried, the calls to isIgnored() removed
in this patch are more expensive than doing the analysis that is behind
it. The speed-up in translation units I have tried is between 10 and
20%.

Review: https://reviews.llvm.org/D28208

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

7 years ago[OpenMP] Add test cases for the proc_bind and schedule clauses with 'teams distribute...
Kelvin Li [Mon, 2 Jan 2017 16:42:11 +0000 (16:42 +0000)]
[OpenMP] Add test cases for the proc_bind and schedule clauses with 'teams distribute parallel for' pragma.

https://reviews.llvm.org/D28205

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

7 years agoRevert "DR1391: Check for implicit conversion sequences for non-dependent function...
Renato Golin [Mon, 2 Jan 2017 11:15:42 +0000 (11:15 +0000)]
Revert "DR1391: Check for implicit conversion sequences for non-dependent function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation."

This reverts commit r290808, as it broken all ARM and AArch64 test-suite
test: MultiSource/UnitTests/C++11/frame_layout

Also, please, next time, try to write a commit message in according to
our guidelines:

http://llvm.org/docs/DeveloperPolicy.html#commit-messages

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

7 years agoDR1391: Check for implicit conversion sequences for non-dependent function
Richard Smith [Mon, 2 Jan 2017 02:42:17 +0000 (02:42 +0000)]
DR1391: Check for implicit conversion sequences for non-dependent function
template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside
the immediate context is much more common during substitution than during
implicit conversion sequence formation.

This does not implement the partial ordering portion of DR1391, which so
far appears to be misguided.

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

7 years agoAddress post-commit review comments.
Richard Smith [Mon, 2 Jan 2017 02:38:22 +0000 (02:38 +0000)]
Address post-commit review comments.

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

7 years agoCodeGen: update comment about RTTI field
Saleem Abdulrasool [Sun, 1 Jan 2017 19:16:02 +0000 (19:16 +0000)]
CodeGen: update comment about RTTI field

The MS ABI RTTI has a reserved field which is used as a cache for the
demangled name.  It must be zero-initialized, which is used as a hint by
the runtime to say that the cache has not been populated.  Since this
field is populated at runtime, the RTTI structures must be placed in the
.data section rather than .rdata.  NFC

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

7 years agoFix typo in test case. NFC
Kelvin Li [Sat, 31 Dec 2016 23:36:47 +0000 (23:36 +0000)]
Fix typo in test case.  NFC

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

7 years ago[c++17] Implement P0522R0 as written. This allows a template template argument
Richard Smith [Sat, 31 Dec 2016 21:41:23 +0000 (21:41 +0000)]
[c++17] Implement P0522R0 as written. This allows a template template argument
to be specified for a template template parameter whenever the parameter is at
least as specialized as the argument (when there's an obvious and correct
mapping from uses of the parameter to uses of the argument). For example, a
template with more parameters can be passed to a template template parameter
with fewer, if those trailing parameters have default arguments.

This is disabled by default, despite being a DR resolution, as it's fairly
broken in its current state: there are no partial ordering rules to cope with
template template parameters that have different parameter lists, meaning that
code that attempts to decompose template-ids based on arity can hit unavoidable
ambiguity issues.

The diagnostics produced on a non-matching argument are also pretty bad right
now, but I aim to improve them in a subsequent commit.

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

7 years ago[clang] Fix clean build of generate-order-file
Alexander Shaposhnikov [Sat, 31 Dec 2016 05:25:52 +0000 (05:25 +0000)]
[clang] Fix clean build of generate-order-file

This diff fixes the clean build of the target generate-order-file.
In llvm/tools/clang/CMakeLists.txt
add_subdirectory(utils/perf-training) should go after the block where
the value of the variable CLANG_ORDER_FILE is set - otherwise
(tested with cmake's version 3.6.2) the arguments of perf-helper.py gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).

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

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

7 years agoRemove redundant assertion.
Richard Smith [Sat, 31 Dec 2016 03:33:42 +0000 (03:33 +0000)]
Remove redundant assertion.

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

7 years agoTypo fix in AST matcher documentation: s/aribtrary/arbitrary/
James Dennett [Sat, 31 Dec 2016 01:04:02 +0000 (01:04 +0000)]
Typo fix in AST matcher documentation: s/aribtrary/arbitrary/

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

7 years agoWdocumentation fix
Simon Pilgrim [Fri, 30 Dec 2016 22:55:33 +0000 (22:55 +0000)]
Wdocumentation fix

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

7 years ago[clang] Minor fix to libASTMatcherTutorial
Mads Ravn [Fri, 30 Dec 2016 20:49:44 +0000 (20:49 +0000)]
[clang] Minor fix to libASTMatcherTutorial

There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.

One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .

I found and fixed the error and one additional error.

Reviewers: aaron.ballman, malcolm.parsons

Subscribers: cfe-commits

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

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

7 years agoCodeGen: use a StringSwitch instead of cascasding ifs
Saleem Abdulrasool [Fri, 30 Dec 2016 18:45:03 +0000 (18:45 +0000)]
CodeGen: use a StringSwitch instead of cascasding ifs

Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

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

7 years agoAllow lexer to handle string_view literals. Patch from Anton Bikineev.
Eric Fiselier [Fri, 30 Dec 2016 04:51:10 +0000 (04:51 +0000)]
Allow lexer to handle string_view literals. Patch from Anton Bikineev.

This implements the compiler side of p0403r0. This patch was reviewed as
https://reviews.llvm.org/D26829.

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

7 years agoRemove bogus assertion and add testcase that triggers it.
Richard Smith [Fri, 30 Dec 2016 04:32:02 +0000 (04:32 +0000)]
Remove bogus assertion and add testcase that triggers it.

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma
Kelvin Li [Thu, 29 Dec 2016 22:16:30 +0000 (22:16 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragma

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

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

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

7 years ago[ADT] Delete RefCountedBaseVPTR.
Justin Lebar [Thu, 29 Dec 2016 19:59:26 +0000 (19:59 +0000)]
[ADT] Delete RefCountedBaseVPTR.

Summary:
This class is unnecessary.

Its comment indicated that it was a compile error to allocate an
instance of a class that inherits from RefCountedBaseVPTR on the stack.
This may have been true at one point, but it's not today.

Moreover you really do not want to allocate *any* refcounted object on
the stack, vptrs or not, so if we did have a way to prevent these
objects from being stack-allocated, we'd want to apply it to regular
RefCountedBase too, obviating the need for a separate RefCountedBaseVPTR
class.

It seems that the main way RefCountedBaseVPTR provides safety is by
making its subclass's destructor virtual.  This may have been helpful at
one point, but these days clang will emit an error if you define a class
with virtual functions that inherits from RefCountedBase but doesn't
have a virtual destructor.

Reviewers: compnerd, dblaikie

Subscribers: cfe-commits, klimek, llvm-commits, mgorny

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

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

7 years ago[ItaniumABI] NFC changes
Piotr Padlewski [Wed, 28 Dec 2016 18:26:08 +0000 (18:26 +0000)]
[ItaniumABI] NFC changes

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

7 years agoRevert "Mention devirtualization in release notes"
Piotr Padlewski [Wed, 28 Dec 2016 18:25:30 +0000 (18:25 +0000)]
Revert "Mention devirtualization in release notes"

Accidental commit. LLVM changes have not been pushed yet
This reverts commit 592453413690a2d16784667d1644758b9af700c1.

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

7 years agoMention devirtualization in release notes
Piotr Padlewski [Wed, 28 Dec 2016 18:23:23 +0000 (18:23 +0000)]
Mention devirtualization in release notes

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

7 years ago[ThinLTO] No need to rediscover imports in distributed backend
Teresa Johnson [Wed, 28 Dec 2016 18:00:08 +0000 (18:00 +0000)]
[ThinLTO] No need to rediscover imports in distributed backend

Summary:
We can simply import all external values with summaries included in
the individual index file created for the distributed backend job,
as only those are added to the individual index file created by the
WriteIndexesThinBackend (in addition to summaries for the original
module, which are skipped here).

While computing the cross module imports on this index would come to
the same conclusion as the original thin link import logic, it is
unnecessary work. And when tuning, it avoids the need to pass the
same function importing parameters (e.g. -import-instr-limit) to
both the thin link and the backends (otherwise they won't make the
same decisions).

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits

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

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

7 years agoFix format. NFC
Kelvin Li [Wed, 28 Dec 2016 17:57:07 +0000 (17:57 +0000)]
Fix format. NFC

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

7 years agoRevert "Driver: switch Windows to static RelocModel"
Reid Kleckner [Wed, 28 Dec 2016 17:41:36 +0000 (17:41 +0000)]
Revert "Driver: switch Windows to static RelocModel"

This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

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

7 years ago[ThinLTO] Add missing FileCheck invocation
Teresa Johnson [Wed, 28 Dec 2016 16:45:37 +0000 (16:45 +0000)]
[ThinLTO] Add missing FileCheck invocation

One of the intended checks was not being performed.

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

7 years ago[CodeGen] Unique constant CompoundLiterals.
George Burgess IV [Wed, 28 Dec 2016 07:27:40 +0000 (07:27 +0000)]
[CodeGen] Unique constant CompoundLiterals.

Our newly aggressive constant folding logic makes it possible for
CGExprConstant to see the same CompoundLiteralExpr more than once. So,
emitting a new GlobalVariable every time we see a CompoundLiteral is no
longer correct.

We had a similar issue with BlockExprs that was caught while testing
said aggressive folding, so I applied the same style of fix (see D26410)
here. If we find yet another case where this needs to happen, we should
probably refactor this so we don't have a third DenseMap+getter+setter.

As a design note: getAddrOfConstantCompoundLiteralIfEmitted is really
only intended to be called by ConstExprEmitter::EmitLValue. So,
returning a GlobalVariable* instead of a ConstantAddress costs us
effectively nothing, and saves us either a few bytes per entry in our
map or a bit of code duplication.

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

7 years agoMark 'auto' as dependent when instantiating the type of a non-type template
Richard Smith [Wed, 28 Dec 2016 06:27:18 +0000 (06:27 +0000)]
Mark 'auto' as dependent when instantiating the type of a non-type template
parameter. Fixes failed deduction for 'auto' non-type template parameters
nested within templates.

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

7 years agoDR1315: a non-type template argument in a partial specialization is permitted
Richard Smith [Wed, 28 Dec 2016 02:37:25 +0000 (02:37 +0000)]
DR1315: a non-type template argument in a partial specialization is permitted
to make reference to template parameters. This is only a partial
implementation; we retain the restriction that the argument must not be
type-dependent, since it's unclear how that would work given the existence of
other language rules requiring an exact type match in this context, even for
type-dependent cases (a question has been raised on the core reflector).

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

7 years agoUpdate test that relies on the optimizer to match new output.
Michael Kuperstein [Wed, 28 Dec 2016 00:30:43 +0000 (00:30 +0000)]
Update test that relies on the optimizer to match new output.

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

7 years agoDebugInfo: Don't include size/alignment on class declarations
David Blaikie [Tue, 27 Dec 2016 22:05:35 +0000 (22:05 +0000)]
DebugInfo: Don't include size/alignment on class declarations

This seems like it must've been a leftover by accident - no tests were
backing it up & it doesn't make much sense to include size/alignment on
class declarations (it'd only be on those declarations for which the
definition was available - otherwise the size/alignment would not be
known).

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

7 years agoAdd warning flag for "partial specialization is not more specialized than primary...
Richard Smith [Tue, 27 Dec 2016 20:03:09 +0000 (20:03 +0000)]
Add warning flag for "partial specialization is not more specialized than primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning.

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

7 years ago[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.
Ekaterina Romanova [Tue, 27 Dec 2016 18:53:29 +0000 (18:53 +0000)]
[DOXYGEN] Improved doxygen comments for xmmintrin.h intrinsics.

Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.

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

7 years agoDR1495: A partial specialization is ill-formed if it is not (strictly) more
Richard Smith [Tue, 27 Dec 2016 07:56:27 +0000 (07:56 +0000)]
DR1495: A partial specialization is ill-formed if it is not (strictly) more
specialized than the primary template. (Put another way, if we imagine there
were a partial specialization matching the primary template, we should never
select it if some other partial specialization also matches.)

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

7 years agoAdd reference/non-reference mismatch test.
Richard Smith [Tue, 27 Dec 2016 06:18:22 +0000 (06:18 +0000)]
Add reference/non-reference mismatch test.

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

7 years agoWork around a standard defect: template argument deduction for non-type
Richard Smith [Tue, 27 Dec 2016 06:14:37 +0000 (06:14 +0000)]
Work around a standard defect: template argument deduction for non-type
template parameters of reference type basically doesn't work, because we're
always deducing from an argument expression of non-reference type, so the type
of the deduced expression never matches. Instead, compare the type of an
expression naming the parameter to the type of the argument.

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

7 years agoEmit CCEDiags when evaluating a const variable.
George Burgess IV [Tue, 27 Dec 2016 05:33:20 +0000 (05:33 +0000)]
Emit CCEDiags when evaluating a const variable.

This addresses post-review feedback from r290577.

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

7 years ago[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added...
Craig Topper [Tue, 27 Dec 2016 04:04:57 +0000 (04:04 +0000)]
[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects.

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

7 years agoRevert r290574 "foo"
Craig Topper [Tue, 27 Dec 2016 04:03:29 +0000 (04:03 +0000)]
Revert r290574 "foo"

This was supposed to be merged with another commit with a real commit message. Sorry.

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

7 years agoRevert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with...
Craig Topper [Tue, 27 Dec 2016 04:03:25 +0000 (04:03 +0000)]
Revert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects."

I failed to merge this with r290574.

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

7 years agoAdd a test for `const` folding introduced by r290297. NFC.
George Burgess IV [Tue, 27 Dec 2016 04:01:22 +0000 (04:01 +0000)]
Add a test for `const` folding introduced by r290297. NFC.

AFAICT, we didn't add a test targeted at the new "const can sometimes
act as constexpr" behavior introduced by r290297.

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

7 years agoFactor out repeated code for deducing a non-type template parameter as a given
Richard Smith [Tue, 27 Dec 2016 03:59:58 +0000 (03:59 +0000)]
Factor out repeated code for deducing a non-type template parameter as a given
argument value. No functionality change intended.

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

7 years ago[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added...
Craig Topper [Tue, 27 Dec 2016 03:46:16 +0000 (03:46 +0000)]
[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly added unmasked versions and selects.

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

7 years agofoo
Craig Topper [Tue, 27 Dec 2016 03:46:13 +0000 (03:46 +0000)]
foo

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

7 years agoDriver: switch Windows to static RelocModel
Saleem Abdulrasool [Tue, 27 Dec 2016 02:20:35 +0000 (02:20 +0000)]
Driver: switch Windows to static RelocModel

Windows uses PE/COFF which is inherently position independent.  The use
of the PIC model is unnecessary.  In fact, we would generate invalid
code using the ELF PIC model when PIC was enabled previously.  Now that
we no longer accept -fPIC and -fpoc, this switches the internal
representation to the static model to permit us to make PIC modules
invalid when targeting Windows.  This should not change the code
generation, only the internal state management.

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

7 years agoCheck and build conversion sequences for non-type template arguments in
Richard Smith [Tue, 27 Dec 2016 02:02:09 +0000 (02:02 +0000)]
Check and build conversion sequences for non-type template arguments in
dependent contexts when processing the template in C++11 and C++14, just like
we do in C++98 and C++1z. This allows us to diagnose invalid templates earlier.

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

7 years ago[DOXYGEN] Improved doxygen comments for x86 intrinsics.
Ekaterina Romanova [Tue, 27 Dec 2016 00:49:38 +0000 (00:49 +0000)]
[DOXYGEN] Improved doxygen comments for x86 intrinsics.

Improved doxygen comments for the following intrinsics headers:  __wmmintrin_pclmul.h, bmiintrin.h, emmintrin.h, f16cintrin.h, immintrin.h, mmintrin.h, pmmintrin.h, tmmintrin.h

Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.

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

7 years ago[PM] The new pass manager requires a registered target for these, and
Chandler Carruth [Tue, 27 Dec 2016 00:31:34 +0000 (00:31 +0000)]
[PM] The new pass manager requires a registered target for these, and
given that they hard code specific triples that seems reasonable so add
the REQUIRES.

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

7 years ago[PH] Teach the new PM code path to support -disable-llvm-passes.
Chandler Carruth [Tue, 27 Dec 2016 00:13:09 +0000 (00:13 +0000)]
[PH] Teach the new PM code path to support -disable-llvm-passes.

This is kind of funny because I specifically did work to make this easy
and then it didn't actually get implemented.

I've also ported a set of tests that rely on this functionality to run
with the new PM as well as the old PM so that we don't mess this up in
the future.

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

7 years agoUpdate comment to match dr1770.
Richard Smith [Mon, 26 Dec 2016 22:28:29 +0000 (22:28 +0000)]
Update comment to match dr1770.

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

7 years agoWdocumentation fix
Simon Pilgrim [Mon, 26 Dec 2016 18:11:49 +0000 (18:11 +0000)]
Wdocumentation fix

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

7 years agoFix build error caused by r290539.
Marina Yatsina [Mon, 26 Dec 2016 13:16:40 +0000 (13:16 +0000)]
Fix build error caused by r290539.

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

7 years ago[inline-asm]No error for conflict between inputs\outputs and clobber list
Marina Yatsina [Mon, 26 Dec 2016 12:23:42 +0000 (12:23 +0000)]
[inline-asm]No error for conflict between inputs\outputs and clobber list

According to extended asm syntax, a case where the clobber list includes a variable from the inputs or outputs should be an error - conflict.
for example:

const long double a = 0.0;
int main()
{

char b;
double t1 = a;
__asm__ ("fucompp": "=a" (b) : "u" (t1), "t" (t1) : "cc", "st", "st(1)");

return 0;
}

This should conflict with the output - t1 which is st, and st which is st aswell.
The patch fixes it.

Commit on behald of Ziv Izhar.

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

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

7 years agotest: add explicit triples to the invocation
Saleem Abdulrasool [Mon, 26 Dec 2016 04:00:54 +0000 (04:00 +0000)]
test: add explicit triples to the invocation

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

7 years agoDriver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows
Saleem Abdulrasool [Mon, 26 Dec 2016 03:35:24 +0000 (03:35 +0000)]
Driver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows

Use of these flags would result in the use of ELF-style PIE/PIC code
which is incorrect on Windows.  Windows is inherently PIC by means of
the DLL slide that occurs at load.  This also mirrors the behaviour on
GCC for MinGW.  Currently, the Windows x86_64 forces the relocation
model to PIC (Level 2).  This is unchanged for now, though we should
remove any assumptions on that and change it to a static relocation
model.

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

7 years agoFix assertion failure when deducing an auto-typed argument against a different-width...
Richard Smith [Sun, 25 Dec 2016 20:21:12 +0000 (20:21 +0000)]
Fix assertion failure when deducing an auto-typed argument against a different-width int.

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