Commit Graph

66907 Commits

Author SHA1 Message Date
Alexander Shaposhnikov be16876e89 [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

llvm-svn: 290936
2017-01-04 04:33:28 +00:00
Richard Smith b576c17417 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.

llvm-svn: 290933
2017-01-04 02:59:16 +00:00
Nico Weber ea64969763 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>!

llvm-svn: 290930
2017-01-04 02:33:36 +00:00
Richard Smith 6298b44448 Remove accidentally-added lines in r290923 test, and add another testcase.
llvm-svn: 290926
2017-01-04 02:03:39 +00:00
Richard Smith 539e8e3703 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.

llvm-svn: 290923
2017-01-04 01:48:55 +00:00
Richard Trieu 6a6af52ba6 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

llvm-svn: 290920
2017-01-04 00:46:30 +00:00
Dehao Chen 287d949667 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

llvm-svn: 290919
2017-01-04 00:33:23 +00:00
George Burgess IV 7fb7e361bf 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.

llvm-svn: 290916
2017-01-03 23:35:19 +00:00
Reid Kleckner 9bb64de0de Relax CHECK line from r290906
llvm-svn: 290907
2017-01-03 21:29:51 +00:00
Reid Kleckner d2ad9dfdb9 [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

llvm-svn: 290906
2017-01-03 21:23:35 +00:00
Arpith Chacko Jacob ccf2f7352f [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

llvm-svn: 290904
2017-01-03 20:19:56 +00:00
Carlo Bertolli 962bb807ec [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.

llvm-svn: 290898
2017-01-03 18:24:42 +00:00
Alexander Kornienko 9bab199146 [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

llvm-svn: 290892
2017-01-03 14:35:47 +00:00
Alex Lorenz b44b4cbae8 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

llvm-svn: 290887
2017-01-03 12:16:02 +00:00
Alex Lorenz a186417796 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

llvm-svn: 290886
2017-01-03 12:14:59 +00:00
Alex Lorenz 21c3293b42 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

llvm-svn: 290885
2017-01-03 12:12:36 +00:00
Alex Lorenz eebc494a57 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

llvm-svn: 290884
2017-01-03 12:11:17 +00:00
Alex Lorenz 009978b4d7 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

llvm-svn: 290882
2017-01-03 12:09:39 +00:00
Alex Lorenz 1d86ab4d36 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

llvm-svn: 290881
2017-01-03 12:08:40 +00:00
Alex Lorenz 14abc7f007 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

llvm-svn: 290880
2017-01-03 12:07:20 +00:00
Alex Lorenz 847fda1419 [CodeCompletion] Autocomplete NS_DESIGNATED_INITIALIZER in initializers
with arguments

rdar://21014571

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

llvm-svn: 290879
2017-01-03 11:56:40 +00:00
Kelvin Li 1851df563d [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

llvm-svn: 290862
2017-01-03 05:23:48 +00:00
Richard Smith dadcc18276 Add testcase for the regression introduced in r290808.
llvm-svn: 290843
2017-01-02 23:00:32 +00:00
Daniel Jasper 5cad6856a3 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
llvm-svn: 290842
2017-01-02 22:55:45 +00:00
Kelvin Li acd0742bc6 [OpenMP] Add test cases for the proc_bind and schedule clauses with 'teams distribute parallel for' pragma.
https://reviews.llvm.org/D28205

llvm-svn: 290813
2017-01-02 16:42:11 +00:00
Renato Golin dad96d6751 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

llvm-svn: 290811
2017-01-02 11:15:42 +00:00
Richard Smith efcfe86072 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.

llvm-svn: 290808
2017-01-02 02:42:17 +00:00
Richard Smith aac13a7f2b Address post-commit review comments.
llvm-svn: 290807
2017-01-02 02:38:22 +00:00
Saleem Abdulrasool a9e1450b07 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

llvm-svn: 290799
2017-01-01 19:16:02 +00:00
Kelvin Li 74af88e63d Fix typo in test case. NFC
llvm-svn: 290795
2016-12-31 23:36:47 +00:00
Richard Smith 26b86ea8b1 [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.

llvm-svn: 290792
2016-12-31 21:41:23 +00:00
Alexander Shaposhnikov fd7afa73b6 [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

llvm-svn: 290781
2016-12-31 05:25:52 +00:00
Richard Smith e8a94565d2 Remove redundant assertion.
llvm-svn: 290780
2016-12-31 03:33:42 +00:00
James Dennett f947f39148 Typo fix in AST matcher documentation: s/aribtrary/arbitrary/
llvm-svn: 290777
2016-12-31 01:04:02 +00:00
Simon Pilgrim 6905d22dc2 Wdocumentation fix
llvm-svn: 290773
2016-12-30 22:55:33 +00:00
Mads Ravn 8ab17a30a2 [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

llvm-svn: 290766
2016-12-30 20:49:44 +00:00
Saleem Abdulrasool 20dfba0d70 CodeGen: use a StringSwitch instead of cascasding ifs
Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

llvm-svn: 290762
2016-12-30 18:45:03 +00:00
Eric Fiselier cb2f326a75 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.

llvm-svn: 290744
2016-12-30 04:51:10 +00:00
Richard Smith cf82486c90 Remove bogus assertion and add testcase that triggers it.
llvm-svn: 290743
2016-12-30 04:32:02 +00:00
Kelvin Li 80e8f56284 [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

llvm-svn: 290725
2016-12-29 22:16:30 +00:00
Justin Lebar 175ab74dc5 [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

llvm-svn: 290717
2016-12-29 19:59:26 +00:00
Piotr Padlewski a587ca51d5 [ItaniumABI] NFC changes
llvm-svn: 290677
2016-12-28 18:26:08 +00:00
Piotr Padlewski 25bb130628 Revert "Mention devirtualization in release notes"
Accidental commit. LLVM changes have not been pushed yet
This reverts commit 592453413690a2d16784667d1644758b9af700c1.

llvm-svn: 290676
2016-12-28 18:25:30 +00:00
Piotr Padlewski a280f674b5 Mention devirtualization in release notes
llvm-svn: 290675
2016-12-28 18:23:23 +00:00
Teresa Johnson f9b17d4878 [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

llvm-svn: 290674
2016-12-28 18:00:08 +00:00
Kelvin Li 26fd21ab80 Fix format. NFC
llvm-svn: 290673
2016-12-28 17:57:07 +00:00
Reid Kleckner 8c19083f76 Revert "Driver: switch Windows to static RelocModel"
This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

llvm-svn: 290672
2016-12-28 17:41:36 +00:00
Teresa Johnson 3f4c87d0b5 [ThinLTO] Add missing FileCheck invocation
One of the intended checks was not being performed.

llvm-svn: 290671
2016-12-28 16:45:37 +00:00
George Burgess IV 1a39b86d0f [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.

llvm-svn: 290661
2016-12-28 07:27:40 +00:00
Richard Smith 15361a21e0 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.

llvm-svn: 290660
2016-12-28 06:27:18 +00:00