]> granicus.if.org Git - clang/log
clang
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

7 years ago[DebugInfo] Added support for Checksum debug info feature.
Amjad Aboud [Sun, 25 Dec 2016 10:12:27 +0000 (10:12 +0000)]
[DebugInfo] Added support for Checksum debug info feature.

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

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

7 years agoFix some subtle wrong partial ordering bugs particularly with C++1z auto-typed
Richard Smith [Sun, 25 Dec 2016 08:05:23 +0000 (08:05 +0000)]
Fix some subtle wrong partial ordering bugs particularly with C++1z auto-typed
non-type template parameters.

During partial ordering, when checking the substituted deduced template
arguments match the original, check the types of non-type template arguments
match even if they're dependent. The only way we get dependent types here is if
they really represent types of the other template (which are supposed to be
modeled as being substituted for unique, non-dependent types).

In order to make this work for auto-typed non-type template arguments, we need
to be able to perform auto deduction even when the initializer and
(potentially) the auto type are dependent, support for which is the bulk of
this patch. (Note that this requires the ability to deduce only a single level
of a multi-level dependent type.)

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

7 years ago[MS ABI] Mangle unnamed enums correctly
David Majnemer [Sun, 25 Dec 2016 05:26:02 +0000 (05:26 +0000)]
[MS ABI] Mangle unnamed enums correctly

Unnamed enums take the name of the first enumerator they define.

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

7 years ago[OpenMP] Sema and parsing for 'target teams distribute' pragma
Kelvin Li [Sun, 25 Dec 2016 04:52:54 +0000 (04:52 +0000)]
[OpenMP] Sema and parsing for 'target teams distribute' pragma

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

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

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

7 years agoFix for PR15623 (corrected r290413 reverted at 290415). The patch eliminates unwanted...
Anton Yartsev [Sun, 25 Dec 2016 00:57:51 +0000 (00:57 +0000)]
Fix for PR15623 (corrected r290413 reverted at 290415). The patch eliminates unwanted ProgramState checker data propagation from an operand of the logical operation to operation result.
The patch also simplifies an assume of a constraint of the form: "(exp comparison_op expr) != 0" to true into an assume of "exp comparison_op expr" to true. (And similarly, an assume of the form "(exp comparison_op expr) == 0" to true as an assume of exp comparison_op expr to false.) which improves precision overall.
https://reviews.llvm.org/D22862

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

7 years agoFactor out duplication between partial ordering for class template partial
Richard Smith [Sat, 24 Dec 2016 16:40:51 +0000 (16:40 +0000)]
Factor out duplication between partial ordering for class template partial
specializations and variable template partial specializations.

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

7 years agoDeduplicate several GD.getDecl() calls into Decl * local variable.
Yaron Keren [Sat, 24 Dec 2016 15:32:39 +0000 (15:32 +0000)]
Deduplicate several GD.getDecl() calls into Decl * local variable.

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

7 years ago[ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.
Malcolm Parsons [Sat, 24 Dec 2016 13:35:14 +0000 (13:35 +0000)]
[ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.

Summary:
I needed to know whether a FieldDecl had an in-class
initializer for D26453. I used a narrowing matcher there, but a
traversal matcher might be generally useful.

Reviewers: sbenza, bkramer, klimek, aaron.ballman

Subscribers: aaron.ballman, Prazek, cfe-commits

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

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

7 years ago[ASTMatchers] Fix doc for hasBitWidth
Malcolm Parsons [Sat, 24 Dec 2016 13:22:26 +0000 (13:22 +0000)]
[ASTMatchers] Fix doc for hasBitWidth

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

7 years agoRemove accidentally-left-behind commented out code.
Richard Smith [Sat, 24 Dec 2016 04:22:52 +0000 (04:22 +0000)]
Remove accidentally-left-behind commented out code.

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

7 years agoFix crash if substitution fails during deduction of variable template partial special...
Richard Smith [Sat, 24 Dec 2016 04:20:31 +0000 (04:20 +0000)]
Fix crash if substitution fails during deduction of variable template partial specialization arguments.

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

7 years agoWhen producing a name of a partial specialization in a diagnostic, use the
Richard Smith [Sat, 24 Dec 2016 04:09:05 +0000 (04:09 +0000)]
When producing a name of a partial specialization in a diagnostic, use the
template arguments as written rather than the canonical template arguments,
so we print more user-friendly names for template parameters.

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

7 years agoclangCodeGen: Add LLVMPasses to libdeps. r290450 introduced it.
NAKAMURA Takumi [Sat, 24 Dec 2016 01:55:12 +0000 (01:55 +0000)]
clangCodeGen: Add LLVMPasses to libdeps. r290450 introduced it.

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

7 years agoArrayRefize lists of TemplateArguments in template argument deduction.
Richard Smith [Fri, 23 Dec 2016 23:46:56 +0000 (23:46 +0000)]
ArrayRefize lists of TemplateArguments in template argument deduction.

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

7 years ago[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.
Ekaterina Romanova [Fri, 23 Dec 2016 23:36:26 +0000 (23:36 +0000)]
[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.

Added \n commands to insert a line breaks where necessary to make the documentation more readable.
Formatted comments to fit into 80 chars.

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

7 years ago[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.
Ekaterina Romanova [Fri, 23 Dec 2016 22:47:16 +0000 (22:47 +0000)]
[DOXYGEN] Improved doxygen comments for tmmintrin.h intrinsics.

Tagged parameter names with \a doxygen command to display parameters in italics.
Added \n commands to insert a line break to make the documentation more readable.
Formatted comments to fit into 80 chars.

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

7 years ago[PM] Fix up from r290449 to start requiring the x86 target to be
Chandler Carruth [Fri, 23 Dec 2016 21:19:16 +0000 (21:19 +0000)]
[PM] Fix up from r290449 to start requiring the x86 target to be
available.

It doesn't seem terribly important to test this with a specific target
triple but without that target available.

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

7 years ago[PM] Introduce options to enable the (still experimental) new pass
Chandler Carruth [Fri, 23 Dec 2016 20:44:01 +0000 (20:44 +0000)]
[PM] Introduce options to enable the (still experimental) new pass
manager, and a code path to use it.

The option is actually a top-level option but does contain
'experimental' in the name. This is the compromise suggested by Richard
in discussions. We expect this option will be around long enough and
have enough users towards the end that it merits not being relegated to
CC1, but it still needs to be clear that this option will go away at
some point.

The backend code is a fresh codepath dedicated to handling the flow with
the new pass manager. This was also Richard's suggested code structuring
to essentially leave a clean path for development rather than carrying
complexity or idiosyncracies of how we do things just to share code with
the parts of this in common with the legacy pass manager. And it turns
out, not much is really in common even though we use the legacy pass
manager for codegen at this point.

I've switched a couple of tests to run with the new pass manager, and
they appear to work. There are still plenty of bugs that need squashing
(just with basic experiments I've found two already!) but they aren't in
this code, and the whole point is to expose the necessary hooks to start
experimenting with the pass manager in more realistic scenarios.

That said, I want to *strongly caution* anyone itching to play with
this: it is still *very shaky*. Several large components have not yet
been shaken down. For example I have bugs in both the always inliner and
inliner that I have already spotted and will be fixing independently.

Still, this is a fun milestone. =D

One thing not in this patch (but that might be very reasonable to add)
is some level of support for raw textual pass pipelines such as what
Sean had a patch for some time ago. I'm mostly interested in the more
traditional flow of getting the IR out of Clang and then running it
through opt, but I can see other use cases so someone may want to add
it.

And of course, *many* features are not yet supported!
- O1 is currently more like O2
- None of the sanitizers are wired up
- ObjC ARC optimizer isn't wired up
- ...

So plenty of stuff still lef to do!

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

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

7 years agoExtend the tests for -Wmissing-variable-declarations.
Ed Schouten [Fri, 23 Dec 2016 19:20:07 +0000 (19:20 +0000)]
Extend the tests for -Wmissing-variable-declarations.

We shouldn't throw a warning when the static keyword is not present in
an anonymous namespace, just like we do for -Wmissing-prototypes.

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

7 years ago[OpenCL] Align fake address space map with the SPIR target maps.
Egor Churaev [Fri, 23 Dec 2016 16:11:25 +0000 (16:11 +0000)]
[OpenCL] Align fake address space map with the SPIR target maps.

Summary:
We compile user opencl kernel code with spir triple. But built-ins are written in OpenCL and we compile it with triple x86_64 to be able to use x86 intrinsics. And we need address spaces to match in both cases. So, we change fake address space map in OpenCL for matching with spir.

On CPU address spaces are not really important but we'd like to preserve address space information in order to perform optimizations relying on this info like enhanced alias analysis.

Reviewers: pekka.jaaskelainen, Anastasia

Subscribers: pekka.jaaskelainen, yaxunl, bader, cfe-commits

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

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