]> granicus.if.org Git - clang/log
clang
6 years ago[analyzer] Temporary disabling svalbuilder-rearrange-comparisons test
George Karpenkov [Sat, 15 Sep 2018 02:35:06 +0000 (02:35 +0000)]
[analyzer] Temporary disabling svalbuilder-rearrange-comparisons test

As debug printing has changed, and format was not guaranteed to be
stable.
Artem is currently working on a better solution.

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

6 years ago[analyzer] Further printing improvements: use declarations,
George Karpenkov [Sat, 15 Sep 2018 02:34:45 +0000 (02:34 +0000)]
[analyzer] Further printing improvements: use declarations,

skip pointers whenever redundant, use unique prefixes.

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

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

6 years agoGenerate unique identifiers for Decl objects
George Karpenkov [Sat, 15 Sep 2018 02:03:58 +0000 (02:03 +0000)]
Generate unique identifiers for Decl objects

The generated identifier is stable across multiple runs,
and can be a great visualization or debugging aide.

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

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

6 years ago[analyzer] Generate and use stable identifiers for LocationContext
George Karpenkov [Sat, 15 Sep 2018 02:03:36 +0000 (02:03 +0000)]
[analyzer] Generate and use stable identifiers for LocationContext

Those are not created in the allocator.
Since they are created fairly rarely, a counter overhead should not
affect the memory consumption.

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

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

6 years ago[analyzer] Dump reproducible identifiers for statements in exploded graph in store
George Karpenkov [Sat, 15 Sep 2018 02:03:17 +0000 (02:03 +0000)]
[analyzer] Dump reproducible identifiers for statements in exploded graph in store

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

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

6 years ago[analyzer] Use correct end-of-line character when printing statements for exploded...
George Karpenkov [Sat, 15 Sep 2018 02:02:56 +0000 (02:02 +0000)]
[analyzer] Use correct end-of-line character when printing statements for exploded graph

Prevents bad centering.

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

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

6 years agoStmtPrinter: allow customizing the end-of-line character
George Karpenkov [Sat, 15 Sep 2018 02:02:31 +0000 (02:02 +0000)]
StmtPrinter: allow customizing the end-of-line character

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

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

6 years ago[analyzer] Dump unique identifiers for statements in exploded graph
George Karpenkov [Sat, 15 Sep 2018 02:02:09 +0000 (02:02 +0000)]
[analyzer] Dump unique identifiers for statements in exploded graph

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

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

6 years agoSupport generating unique identifiers for Stmt objects
George Karpenkov [Sat, 15 Sep 2018 02:01:47 +0000 (02:01 +0000)]
Support generating unique identifiers for Stmt objects

The generated identifiers are stable across multiple runs, and can be a
great debug or visualization aid.

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

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

6 years ago[analyzer] Skip printing duplicate nodes, even if nodes have multiple predecessors...
George Karpenkov [Sat, 15 Sep 2018 02:01:26 +0000 (02:01 +0000)]
[analyzer] Skip printing duplicate nodes, even if nodes have multiple predecessors/successors

Still generate a node, but leave the redundant field empty.

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

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

6 years ago[modules] Don't bother creating a global module fragment when building a
Richard Smith [Sat, 15 Sep 2018 01:59:39 +0000 (01:59 +0000)]
[modules] Don't bother creating a global module fragment when building a
header module.

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

6 years ago[modules] Support use of -E on modules built from the command line.
Richard Smith [Sat, 15 Sep 2018 01:21:18 +0000 (01:21 +0000)]
[modules] Support use of -E on modules built from the command line.

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

6 years ago[modules] Driver support for precompiling a collection of files as a single
Richard Smith [Sat, 15 Sep 2018 01:21:16 +0000 (01:21 +0000)]
[modules] Driver support for precompiling a collection of files as a single
action.

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

6 years ago[modules] Frontend support for building a header module from a list of
Richard Smith [Sat, 15 Sep 2018 01:21:15 +0000 (01:21 +0000)]
[modules] Frontend support for building a header module from a list of
headaer files.

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

6 years agotest/Driver/output-file-cleanup.c: delete non-readable temporary file
Fangrui Song [Fri, 14 Sep 2018 21:36:35 +0000 (21:36 +0000)]
test/Driver/output-file-cleanup.c: delete non-readable temporary file

%t-dir/2.c made tools (rsync, ripgrep, ...) sad (EACCES warning).

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

6 years agoRelax assumption about default method calling convention in new test
Reid Kleckner [Fri, 14 Sep 2018 20:50:39 +0000 (20:50 +0000)]
Relax assumption about default method calling convention in new test

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

6 years ago[analyzer] Handle forwarding reference better in ExprMutationAnalyzer.
Shuai Wang [Fri, 14 Sep 2018 20:07:18 +0000 (20:07 +0000)]
[analyzer] Handle forwarding reference better in ExprMutationAnalyzer.

Summary:
We used to treat an `Expr` mutated whenever it's passed as non-const
reference argument to a function. This results in false positives in
cases like this:
```
int x;
std::vector<int> v;
v.emplace_back(x); // `x` is passed as non-const reference to `emplace_back`
```
In theory the false positives can be suppressed with
`v.emplace_back(std::as_const(x))` but that's considered overly verbose,
inconsistent with existing code and spammy as diags.

This diff handles such cases by following into the function definition
and see whether the argument is mutated inside.

Reviewers: lebedev.ri, JonasToth, george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits

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

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

6 years agoRemove PseudoConstantAnalysis
Shuai Wang [Fri, 14 Sep 2018 17:27:27 +0000 (17:27 +0000)]
Remove PseudoConstantAnalysis

Summary: It's not used anywhere for years. The last usage is removed in https://reviews.llvm.org/rL198476 in 2014.

Subscribers: mgorny, cfe-commits

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

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

6 years ago[clang-cl] Fix PR38934: failing to dllexport class template member w/ explicit instan...
Hans Wennborg [Fri, 14 Sep 2018 15:18:30 +0000 (15:18 +0000)]
[clang-cl] Fix PR38934: failing to dllexport class template member w/ explicit instantiation and PCH

The code in ASTContext::DeclMustBeEmitted was supposed to handle this,
but didn't take into account that synthesized members such as operator=
might not get marked as template specializations, because they're
synthesized on the instantiation directly when handling the class-level
dllexport attribute.

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

6 years ago[clang] Make sure attributes on member classes are applied properly
Louis Dionne [Fri, 14 Sep 2018 14:07:16 +0000 (14:07 +0000)]
[clang] Make sure attributes on member classes are applied properly

Summary:
Attributes on member classes of class templates and member class templates
of class templates are not currently instantiated. This was discovered by
Richard Smith here:

  http://lists.llvm.org/pipermail/cfe-dev/2018-September/059291.html

This commit makes sure that attributes are instantiated properly. This
commit does not fix the broken behavior for member partial and explicit
specializations of class templates.

PR38913

Reviewers: rsmith

Subscribers: dexonsmith, cfe-commits

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

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

6 years ago[VFS] vfs::directory_iterator yields path and file type instead of full Status
Sam McCall [Fri, 14 Sep 2018 12:47:38 +0000 (12:47 +0000)]
[VFS] vfs::directory_iterator yields path and file type instead of full Status

Summary:
Most callers I can find are using only `getName()`. Type is used by the
recursive iterator.

Now we don't have to call stat() on every listed file (on most platforms).
Exceptions are e.g. Solaris where readdir() doesn't include type information.
On those platforms we'll still stat() - see D51918.

The result is significantly faster (stat() can be slow).
My motivation: this may allow us to improve clang IO on large TUs with long
include search paths. Caching readdir() results may allow us to skip many stat()
and open() operations on nonexistent files.

Reviewers: bkramer

Subscribers: fedor.sergeev, cfe-commits

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

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

6 years ago[Driver] Fix missing MultiArch include dir on powerpcspe
Kristina Brooks [Fri, 14 Sep 2018 12:42:13 +0000 (12:42 +0000)]
[Driver] Fix missing MultiArch include dir on powerpcspe

On powerpc-linux-gnuspe, the header files are located in their
own include directory named /usr/lib/powerpc-linux-gnuspe,
so add this directory to PPCMultiarchIncludeDirs.

Patch by glaubitz (John Paul Adrian Glaubitz)

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

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

6 years ago[Tooling] JSONCompilationDatabasePlugin infers compile commands for missing files
Sam McCall [Fri, 14 Sep 2018 12:24:09 +0000 (12:24 +0000)]
[Tooling] JSONCompilationDatabasePlugin infers compile commands for missing files

Summary:
See the existing InterpolatingCompilationDatabase for details on how this works.
We've been using this in clangd for a while, the heuristics seem to work well.

Reviewers: bkramer

Subscribers: ilya-biryukov, ioeric, kadircet, cfe-commits

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

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

6 years ago[analyzer] Restore final on NeedsCastLocField. NFC
Ilya Biryukov [Fri, 14 Sep 2018 11:28:48 +0000 (11:28 +0000)]
[analyzer] Restore final on NeedsCastLocField. NFC

To fix compiler warning about non-virtual dtor introduced in r342221.

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

6 years ago[analyzer] Attempt to make a windows buildbot happy.
Kristof Umann [Fri, 14 Sep 2018 11:20:16 +0000 (11:20 +0000)]
[analyzer] Attempt to make a windows buildbot happy.

Got an error that a cast is happening from a pointer type to long, which is
smaller.

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

6 years ago[analyzer][UninitializedObjectChecker] Support for nonloc::LocAsInteger
Kristof Umann [Fri, 14 Sep 2018 10:18:26 +0000 (10:18 +0000)]
[analyzer][UninitializedObjectChecker] Support for nonloc::LocAsInteger

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

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

6 years ago[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields
Kristof Umann [Fri, 14 Sep 2018 10:10:09 +0000 (10:10 +0000)]
[analyzer][UninitializedObjectChecker] New flag to ignore records based on it's fields

Based on a suggestion from @george.karpenkov.

In some cases, structs are used as unions with a help of a tag/kind field.
This patch adds a new string flag (a pattern), that is matched against the
fields of a record, and should a match be found, the entire record is ignored.

For more info refer to http://lists.llvm.org/pipermail/cfe-dev/2018-August/058906.html
and to the responses to that, especially http://lists.llvm.org/pipermail/cfe-dev/2018-August/059215.html.

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

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

6 years ago[analyzer][UninitializedObjectChecker] Refactored checker options
Kristof Umann [Fri, 14 Sep 2018 09:39:26 +0000 (09:39 +0000)]
[analyzer][UninitializedObjectChecker] Refactored checker options

Since I plan to add a number of new flags, it made sense to encapsulate
them in a new struct, in order not to pollute FindUninitializedFields's
constructor with new boolean options with super long names.

This revision practically reverts D50508, since FindUninitializedFields
now accesses the pedantic flag anyways.

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

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

6 years ago[analyzer][UninitializedObjectChecker] Correct dynamic type is acquired for record...
Kristof Umann [Fri, 14 Sep 2018 09:13:36 +0000 (09:13 +0000)]
[analyzer][UninitializedObjectChecker] Correct dynamic type is acquired for record pointees

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

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

6 years agoUse Chrome and Firefox as example of success for clang
Sylvestre Ledru [Fri, 14 Sep 2018 09:08:21 +0000 (09:08 +0000)]
Use Chrome and Firefox as example of success for clang

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

6 years ago[analyzer][UninitializedObjectChecker] Updated comments
Kristof Umann [Fri, 14 Sep 2018 09:07:40 +0000 (09:07 +0000)]
[analyzer][UninitializedObjectChecker] Updated comments

Some of the comments are incorrect, imprecise, or simply nonexistent.
Since I have a better grasp on how the analyzer works, it makes sense
to update most of them in a single swoop.

I tried not to flood the code with comments too much, this amount
feels just right to me.

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

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

6 years agoremove 11 years old videos from the homepage. if you have a suggestion, please drop...
Sylvestre Ledru [Fri, 14 Sep 2018 09:00:48 +0000 (09:00 +0000)]
remove 11 years old videos from the homepage. if you have a suggestion, please drop me an email

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

6 years ago[analyzer][UninitializedObjectChecker] Fixed dereferencing
Kristof Umann [Fri, 14 Sep 2018 08:58:21 +0000 (08:58 +0000)]
[analyzer][UninitializedObjectChecker] Fixed dereferencing

iThis patch aims to fix derefencing, which has been debated for months now.

Instead of working with SVals, the function now relies on TypedValueRegion.

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

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

6 years agoupdate the doc to compare with gcc 4.9 instead of 4.2
Sylvestre Ledru [Fri, 14 Sep 2018 08:55:09 +0000 (08:55 +0000)]
update the doc to compare with gcc 4.9 instead of 4.2

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

6 years agogcc is now returning the same output on this example, removing this example
Sylvestre Ledru [Fri, 14 Sep 2018 08:52:18 +0000 (08:52 +0000)]
gcc is now returning the same output on this example, removing this example

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

6 years ago[XRay][clang] Emit "never-instrument" attribute
Dean Michael Berris [Fri, 14 Sep 2018 01:59:12 +0000 (01:59 +0000)]
[XRay][clang] Emit "never-instrument" attribute

Summary:
Before this change, we only emit the XRay attributes in LLVM IR when the
-fxray-instrument flag is provided. This may cause issues with thinlto
when the final binary is being built/linked with -fxray-instrument, and
the constitutent LLVM IR gets re-lowered with xray instrumentation.

With this change, we can honour the "never-instrument "attributes
provided in the source code and preserve those in the IR. This way, even
in thinlto builds, we retain the attributes which say whether functions
should never be XRay instrumented.

This change addresses llvm.org/PR38922.

Reviewers: mboerger, eizan

Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits

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

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

6 years ago[ODRHash] Fix early exit that skipped code.
Richard Trieu [Fri, 14 Sep 2018 01:15:28 +0000 (01:15 +0000)]
[ODRHash] Fix early exit that skipped code.

There is a bit of code at the end of AddDeclaration that should be run on
every exit of the function.  However, there was an early exit beforehand
that could be triggered, which causes a small amount of data to skip the
hashing, leading to false positive mismatch.  Use a separate function so
that this code is always run.

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

6 years agoRelax alignment assumptions in a test after r342194
Vedant Kumar [Fri, 14 Sep 2018 00:16:37 +0000 (00:16 +0000)]
Relax alignment assumptions in a test after r342194

Don't hardcode align 8.

Fixes a bot failure:
http://lab.llvm.org:8011/builders/clang-cmake-armv8-full/builds/6373

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

6 years ago[Sema] Remove location from implicit capture init expr
Vedant Kumar [Thu, 13 Sep 2018 23:28:25 +0000 (23:28 +0000)]
[Sema] Remove location from implicit capture init expr

A lambda's closure is initialized when the lambda is declared. For
implicit captures, the initialization code emitted from EmitLambdaExpr
references source locations *within the lambda body* in the function
containing the lambda. This results in a poor debugging experience: we
step to the line containing the lambda, then into lambda, out again,
over and over, until every capture's field is initialized.

To improve stepping behavior, assign the starting location of the lambda
to expressions which initialize an implicit capture within it.

rdar://39807527

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

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

6 years agoFix crash on call to __builtin_memcpy with a null pointer to an
Richard Smith [Thu, 13 Sep 2018 22:47:33 +0000 (22:47 +0000)]
Fix crash on call to __builtin_memcpy with a null pointer to an
incomplete type.

Also improve the diagnostics for similar situations.

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

6 years agoDiagnose likely typos in #include directives.
Richard Smith [Thu, 13 Sep 2018 21:10:08 +0000 (21:10 +0000)]
Diagnose likely typos in #include directives.

Summary:
When someone writes

  #include "<some_file>"

or

  #include " some_file "

the compiler returns "file not fuond..." with fonts and quotes that may
make it hard to see there are excess quotes or surprising bytes in the
filename.  Assuming that files are usually logically named and start and
end with an alphanumeric character, we can check for the file's
existence by stripping the non-alphanumeric leading or trailing
characters.  If the file is found, emit a non-fatal error with a
FixItHint.

Patch by Christy Lee!

Reviewers: aaron.ballman, erikjv, rsmith

Reviewed By: rsmith

Subscribers: lebedev.ri, xbolva00, sammccall, modocache, erikjv, aaron.ballman, cfe-commits

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

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

6 years agoSupport -fno-omit-frame-pointer with -pg.
Stephen Hines [Thu, 13 Sep 2018 19:50:02 +0000 (19:50 +0000)]
Support -fno-omit-frame-pointer with -pg.

Summary:
Previously, any instance of -fomit-frame-pointer would make it such that
-pg was an invalid flag combination. If -fno-omit-frame-pointer is
passed later on the command line (such that it actually takes effect),
-pg should be allowed.

Reviewers: nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: manojgupta, nickdesaulniers, cfe-commits, kongyi, chh, pirama

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

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

6 years ago[NFC]Refactor MultiVersion Resolver Emission to combine types
Erich Keane [Thu, 13 Sep 2018 16:58:24 +0000 (16:58 +0000)]
[NFC]Refactor MultiVersion Resolver Emission to combine types

Previously, both types (plus the future target-clones) of
multiversioning had a separate ResolverOption structure and emission
function.  This patch combines the two, at the expense of a slightly
more expensive sorting function.

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

6 years ago[OPENMP] Fix PR38903: Crash on instantiation of the non-dependent
Alexey Bataev [Thu, 13 Sep 2018 16:54:05 +0000 (16:54 +0000)]
[OPENMP] Fix PR38903: Crash on instantiation of the non-dependent
declare reduction.

If the declare reduction construct with the non-dependent type is
defined in the template construct, the compiler might crash on the
template instantition. Reworked the whole instantiation scheme for the
declare reduction constructs to fix this problem correctly.

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

6 years agoPrint correctly dependency paths on Windows
David Bolvansky [Thu, 13 Sep 2018 14:27:32 +0000 (14:27 +0000)]
Print correctly dependency paths on Windows

Summary:
Before:
main.o: main.c ../include/lib\test.h

After:
main.o: main.c ../include/lib/test.h

Fixes PR38877

Reviewers: zturner

Subscribers: xbolva00, cfe-commits

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

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

6 years ago[AArch64] Enable return address signing for static ctors
Oliver Stannard [Thu, 13 Sep 2018 10:25:36 +0000 (10:25 +0000)]
[AArch64] Enable return address signing for static ctors

Functions generated by clang and included in the .init_array section (such as
static constructors) do not follow the usual code path for adding
target-specific function attributes, so we have to add the return address
signing attribute here too, as is currently done for the sanitisers.

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

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

6 years agoFix MSVC "illegal conversion; more than one user-defined conversion has been implicit...
Simon Pilgrim [Thu, 13 Sep 2018 10:10:18 +0000 (10:10 +0000)]
Fix MSVC "illegal conversion; more than one user-defined conversion has been implicitly applied" warning. NFCI.

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

6 years ago[clang-format] Wrapped block after case label should not be merged into one line
Owen Pan [Thu, 13 Sep 2018 07:27:15 +0000 (07:27 +0000)]
[clang-format] Wrapped block after case label should not be merged into one line

PR38854

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

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

6 years ago[AArch64] Support reserving x1-7 registers.
Tri Vo [Wed, 12 Sep 2018 23:45:04 +0000 (23:45 +0000)]
[AArch64] Support reserving x1-7 registers.

Summary: Reserving registers x1-7 is used to support CONFIG_ARM64_LSE_ATOMICS in Linux kernel. This change adds support for reserving registers x1 through x7.

Reviewers: javed.absar, efriedma, nickdesaulniers, srhines, phosek

Reviewed By: nickdesaulniers

Subscribers: manojgupta, jfb, cfe-commits, kristof.beyls

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

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

6 years agoRemove dead code made unnecessary by r342018.
Richard Smith [Wed, 12 Sep 2018 23:37:58 +0000 (23:37 +0000)]
Remove dead code made unnecessary by r342018.

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

6 years agoTrack definition merging on the canonical declaration even when local
Richard Smith [Wed, 12 Sep 2018 23:37:00 +0000 (23:37 +0000)]
Track definition merging on the canonical declaration even when local
submodule visibility is disabled.

Attempting to pick a specific declaration to make visible when the
module containing the merged declaration becomes visible is error-prone,
as we don't yet know which declaration we'll choose to be the definition
when we are informed of the merging.

This reinstates r342019, reverted in r342020. The regression previously
observed after this commit was fixed in r342096.

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

6 years agoWhen we leave a module header, make that header visible in its
Richard Smith [Wed, 12 Sep 2018 23:09:23 +0000 (23:09 +0000)]
When we leave a module header, make that header visible in its
includer's context, even if its overall module is unavailable.

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

6 years ago[Hexagon] Remove fp-contract=fast setting for at O3
Brendon Cahoon [Wed, 12 Sep 2018 20:35:56 +0000 (20:35 +0000)]
[Hexagon] Remove fp-contract=fast setting for at O3

Change Hexagon so that the setting for fp-contract is the default setting.
This makes Hexagon consistent with all other targets.

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

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

6 years ago[Diagnostic] Fix a warning typo. NFC.
Matt Davis [Wed, 12 Sep 2018 18:27:21 +0000 (18:27 +0000)]
[Diagnostic] Fix a warning typo. NFC.

s/aligment/alignment/

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

6 years ago[OPENMP] Fix PR38902: support ADL for declare reduction constructs.
Alexey Bataev [Wed, 12 Sep 2018 16:31:59 +0000 (16:31 +0000)]
[OPENMP] Fix PR38902: support ADL for declare reduction constructs.

Added support for argument-dependent lookup when trying to find the
required declare reduction decl.

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

6 years ago[RISCV] Explicitly set an empty --sysroot in the test
Roger Ferrer Ibanez [Wed, 12 Sep 2018 15:55:14 +0000 (15:55 +0000)]
[RISCV] Explicitly set an empty --sysroot in the test

In rL341655 we added additional behaviour to the Driver for riscv32-unknown-elf
when the sysroot is empty.

The new tests that check the new behaviour expect that the absence of --sysroot
in the command-line implies that the sysroot empty. This doesn't hold if clang
is built with a non-empty DEFAULT_SYSROOT in cmake. When this is the case, this
test fails.

Since the new behaviour is triggered when the sysroot is empty, pass an empty
--sysroot to avoid using the default (if any).

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

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

6 years ago[CodeGen] Align rtti and vtable data
David Green [Wed, 12 Sep 2018 14:09:06 +0000 (14:09 +0000)]
[CodeGen] Align rtti and vtable data

Previously the alignment on the newly created rtti/typeinfo data was largely
not set, meaning that DataLayout::getPreferredAlignment was free to overalign
it to 16 bytes. This causes unnecessary code bloat.

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

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

6 years ago[CodeGen][ARM] Coerce FP16 vectors to integer vectors when needed
Mikhail Maltsev [Wed, 12 Sep 2018 09:19:19 +0000 (09:19 +0000)]
[CodeGen][ARM] Coerce FP16 vectors to integer vectors when needed

Summary:
On targets that do not support FP16 natively LLVM currently legalizes
vectors of FP16 values by scalarizing them and promoting to FP32. This
causes problems for the following code:

  void foo(int, ...);

  typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t;
  void bar(float16x4_t x) {
    foo(42, x);
  }

According to the AAPCS (appendix A.2) float16x4_t is a containerized
vector fundamental type, so 'foo' expects that the 4 16-bit FP values
are packed into 2 32-bit registers, but instead bar promotes them to
4 single precision values.

Since we already handle scalar FP16 values in the frontend by
bitcasting them to/from integers, this patch adds similar handling for
vector types and homogeneous FP16 vector aggregates.

One existing test required some adjustments because we now generate
more bitcasts (so the patch changes the test to target a machine with
native FP16 support).

Reviewers: eli.friedman, olista01, SjoerdMeijer, javed.absar, efriedma

Reviewed By: javed.absar, efriedma

Subscribers: efriedma, kristof.beyls, cfe-commits, chrib

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

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

6 years agoFix Check test to avoid output string mismatch
Christian Bruel [Wed, 12 Sep 2018 08:59:17 +0000 (08:59 +0000)]
Fix Check test to avoid output string mismatch

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

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

6 years ago[Tooling] Wait for all threads to finish before resetting CWD.
Eric Liu [Wed, 12 Sep 2018 08:29:47 +0000 (08:29 +0000)]
[Tooling] Wait for all threads to finish before resetting CWD.

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

6 years ago[Driver] Search LibraryPaths when handling -print-file-name
Petr Hosek [Wed, 12 Sep 2018 03:26:10 +0000 (03:26 +0000)]
[Driver] Search LibraryPaths when handling -print-file-name

This is necessary to handle the multiarch runtime directories.

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

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

6 years agoRevert r342019, "Track definition merging on the canonical declaration
Richard Smith [Wed, 12 Sep 2018 02:28:14 +0000 (02:28 +0000)]
Revert r342019, "Track definition merging on the canonical declaration
even when [...]"

Further testing has revealed that this causes build breaks during
explicit module compilations.

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

6 years agoTrack definition merging on the canonical declaration even when local
Richard Smith [Wed, 12 Sep 2018 02:13:48 +0000 (02:13 +0000)]
Track definition merging on the canonical declaration even when local
submodule visibility is disabled.

Attempting to pick a specific declaration to make visible when the
module containing the merged declaration becomes visible is error-prone,
as we don't yet know which declaration we'll choose to be the definition
when we are informed of the merging.

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

6 years agoConsistently create a new declaration when merging a pre-existing but
Richard Smith [Wed, 12 Sep 2018 02:13:47 +0000 (02:13 +0000)]
Consistently create a new declaration when merging a pre-existing but
hidden definition with a would-be-parsed redefinition.

This permits a bunch of cleanups. In particular, we no longer need to
take merged definitions into account when checking declaration
visibility, only when checking definition visibility, which makes
certain visibility checks take linear instead of quadratic time.

We could also now remove the UPD_DECL_EXPORTED update record and track
on each declaration whether it was demoted from a definition (as we
already do for variables), but I'm not doing that in this patch to keep
the changes here simpler.

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

6 years agoFix tracking of merged definitions when the merge target is also merged
Richard Smith [Wed, 12 Sep 2018 02:13:46 +0000 (02:13 +0000)]
Fix tracking of merged definitions when the merge target is also merged
into something else.

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

6 years ago[NFC] Fix build breakage caused by D51948
Shuai Wang [Tue, 11 Sep 2018 22:41:14 +0000 (22:41 +0000)]
[NFC] Fix build breakage caused by D51948

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

6 years ago[analyzer] Add ExprMutationAnalyzer
Shuai Wang [Tue, 11 Sep 2018 21:13:20 +0000 (21:13 +0000)]
[analyzer] Add ExprMutationAnalyzer

Summary:
This is 1/2 of moving ExprMutationAnalyzer from clangtidy to
clang/Analysis.
This diff along simply copies the ExprMutationAnalyzer over with trivial
modifications (e.g. include path, namespace)
2/2 will migrate existing usage of ExprMutationAnalyzer and remove the
original copy inside clangtidy.

Reviewers: george.karpenkov

Subscribers: mgorny, xazax.hun, szepet, a.sidorin, mikhail.ramalho, Szelethus, cfe-commits, JonasToth

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

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

6 years agoIntroduce the VTable interleaving scheme to the CFI design documentation
Peter Collingbourne [Tue, 11 Sep 2018 20:43:52 +0000 (20:43 +0000)]
Introduce the VTable interleaving scheme to the CFI design documentation

Dimitar et. al. in [1] proposed a novel VTable layout scheme that enables efficient implementation of virtual call CFI.

This patch adds an introduction of this scheme to the CFI design documentation.

[1] Protecting C++ Dynamic Dispatch Through VTable Interleaving. Dimitar Bounov, Rami Gökhan Kıcı, Sorin Lerner. https://cseweb.ucsd.edu/~lerner/papers/ivtbl-ndss16.pdf

Patch by Zhaomo Yang!

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

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

6 years ago[gcov] Update a clang test for r341977
Vedant Kumar [Tue, 11 Sep 2018 19:42:58 +0000 (19:42 +0000)]
[gcov] Update a clang test for r341977

Update test/CodeGen/code-coverage.c so that it doesn't refer to a gcov
function which is no longer emitted after r341977.

Fixes bot failure:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/23831

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

6 years ago[analyzer] [NFC] Change the tests by making the version check more resilient
George Karpenkov [Tue, 11 Sep 2018 18:45:15 +0000 (18:45 +0000)]
[analyzer] [NFC] Change the tests by making the version check more resilient

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

6 years ago[clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstop
Mike Rice [Tue, 11 Sep 2018 17:10:44 +0000 (17:10 +0000)]
[clang-cl, PCH] Support for /Yc and /Yu without filename and #pragma hdrstop

With clang-cl, when the user specifies /Yc or /Yu without a filename
the compiler uses a #pragma hdrstop in the main source file to
determine the end of the PCH. If a header is specified with /Yc or
/Yu #pragma hdrstop has no effect.

The optional #pragma hdrstop filename argument is not yet supported.

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

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

6 years ago[ASTMatchers] add three matchers for dependent expressions
Jonas Toth [Tue, 11 Sep 2018 16:09:19 +0000 (16:09 +0000)]
[ASTMatchers] add three matchers for dependent expressions

Summary:
The new matchers can be used to check if an expression is type-, value- or instantiation-dependent
in a templated context.
These matchers are used in a clang-tidy check and generally useful as the
problem of unresolved templates occurs more often in clang-tidy and they
provide an easy way to check for this issue.

Reviewers: aaron.ballman, alexfh, klimek

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

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

6 years ago[CodeCompletion] Enable signature help when initializing class/struct/union members.
Kadir Cetinkaya [Tue, 11 Sep 2018 15:02:18 +0000 (15:02 +0000)]
[CodeCompletion] Enable signature help when initializing class/struct/union members.

Summary:
Factors out member decleration gathering and uses it in parsing to call signature
help. Doesn't support signature help for base class constructors, the code was too
coupled with diagnostic handling, but still can be factored out but just needs
more afford.

Reviewers: sammccall, ilya-biryukov, ioeric

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] Simplified checks for declarations in declare target regions.
Alexey Bataev [Tue, 11 Sep 2018 13:59:10 +0000 (13:59 +0000)]
[OPENMP] Simplified checks for declarations in declare target regions.

Sema analysis should not mark functions as an implicit declare target,
it may break codegen. Simplified semantic analysis and removed extra
code for implicit declare target functions.

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

6 years ago[python bindings] Expose getNumTemplateArguments
Jonathan Coe [Tue, 11 Sep 2018 12:44:52 +0000 (12:44 +0000)]
[python bindings] Expose getNumTemplateArguments

Expose the C bindings for clang_Type_getNumTemplateArguments() and
clang_Type_getTemplateArgumentAsType() in the python API.

Patch by kjteske (Kyle Teske).

Reviewed By: jbcoe

Subscribers: cfe-commits

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

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

6 years ago[Tooling] Restore working dir in ClangTool.
Ilya Biryukov [Tue, 11 Sep 2018 07:29:09 +0000 (07:29 +0000)]
[Tooling] Restore working dir in ClangTool.

Summary:
And add an option to disable this behavior. The option is only used in
AllTUsExecutor to avoid races when running concurrently on multiple
threads.

This fixes PR38869 introduced by r340937.

Reviewers: ioeric, steveire

Reviewed By: ioeric

Subscribers: cfe-commits

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

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

6 years agoMake test more robust in case the expected output appears in clang version string.
Douglas Yung [Tue, 11 Sep 2018 06:48:45 +0000 (06:48 +0000)]
Make test more robust in case the expected output appears in clang version string.

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

6 years ago[Modules] Add imported modules to the output of -module-file-info
Bruno Cardoso Lopes [Tue, 11 Sep 2018 05:17:13 +0000 (05:17 +0000)]
[Modules] Add imported modules to the output of -module-file-info

Fix a bug in the deserialization of IMPORTS section and allow for
imported modules to also be printed with -module-file-info.

rdar://problem/43867753

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

6 years agoclang-check: rename the local FixItAction
Saleem Abdulrasool [Mon, 10 Sep 2018 22:57:26 +0000 (22:57 +0000)]
clang-check: rename the local FixItAction

Resolve the ambiguity in the FixItAction definition by renaming the type.  With
Xcode 9.2, you would fail to build this with:

  llvm/tools/clang/tools/clang-check/ClangCheck.cpp:183:48: error: reference to 'FixItAction' is ambiguous
      FrontendFactory = newFrontendActionFactory<FixItAction>();
                                                 ^

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

6 years ago[Sema][ObjC] Infer availability of +new from availability of -init.
Erik Pilkington [Mon, 10 Sep 2018 22:20:09 +0000 (22:20 +0000)]
[Sema][ObjC] Infer availability of +new from availability of -init.

When defined in NSObject, +new will call -init. If -init has been marked
unavailable, diagnose uses of +new.

rdar://18335828

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

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

6 years agoFix test regression in r341862
Erich Keane [Mon, 10 Sep 2018 21:57:53 +0000 (21:57 +0000)]
Fix test regression in r341862

The commit updates when AES is enabled, but failed to update the tests.
This patch fixes them.

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

6 years ago[AST] Fix a crash on invalid.
Erik Pilkington [Mon, 10 Sep 2018 21:54:04 +0000 (21:54 +0000)]
[AST] Fix a crash on invalid.

Problem was that we were appending to the source location info buffer in the
copy assignment operator (instead of overwriting).

rdar://42746401

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

6 years agoMove AESNI generation to Skylake and Goldmont
Erich Keane [Mon, 10 Sep 2018 21:12:21 +0000 (21:12 +0000)]
Move AESNI generation to Skylake and Goldmont

The instruction set first appeared with Westmere, but not all processors
in that and the next few generations have the instructions. According to
Wikipedia[1], the first generation in which all SKUs have AES
instructions are Skylake and Goldmont. I can't find any Skylake,
Kabylake, Kabylake-R or Cannon Lake currently listed at
https://ark.intel.com that says "Intel® AES New Instructions" "No".

This matches GCC commit
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg01940.html

[1] https://en.wikipedia.org/wiki/AES_instruction_set

Patch By: thiagomacieira
Differential Revision: https://reviews.llvm.org/D51510

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

6 years agoImplement -Watomic-implicit-seq-cst
JF Bastien [Mon, 10 Sep 2018 20:42:56 +0000 (20:42 +0000)]
Implement -Watomic-implicit-seq-cst

Summary:
_Atomic and __sync_* operations are implicitly sequentially-consistent. Some
codebases want to force explicit usage of memory order instead. This warning
allows them to know where implicit sequentially-consistent memory order is used.
The warning isn't on by default because _Atomic was purposefully designed to
have seq_cst as the default: the idea was that it's the right thing to use most
of the time. This warning allows developers who disagree to enforce explicit
usage instead.

A follow-up patch will take care of C++'s std::atomic. It'll be different enough
from this patch that I think it should be separate: for C++ the atomic
operations all have a memory order parameter (or two), but it's defaulted. I
believe this warning should trigger when the default is used, but not when
seq_cst is used explicitly (or implicitly as the failure order for cmpxchg).

<rdar://problem/28172966>

Reviewers: rjmccall

Subscribers: dexonsmith, cfe-commits

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

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

6 years agoEnhance -Wc++14-compat for class template argument deduction to list the
Richard Smith [Mon, 10 Sep 2018 20:31:03 +0000 (20:31 +0000)]
Enhance -Wc++14-compat for class template argument deduction to list the
deduced type (if known).

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

6 years ago[clang-cl] Enable -march option
Alexandre Ganea [Mon, 10 Sep 2018 17:54:32 +0000 (17:54 +0000)]
[clang-cl] Enable -march option

This change allows usage of -march when using the clang-cl driver. This is similar to MSVC's /arch; however -march can target precisely all supported CPUs, while /arch has a more restricted set.

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

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

6 years agoRemove all uses of DIFlagBlockByrefStruct
Adrian Prantl [Mon, 10 Sep 2018 16:14:28 +0000 (16:14 +0000)]
Remove all uses of DIFlagBlockByrefStruct

This patch removes the last reason why DIFlagBlockByrefStruct from
Clang by directly implementing the drilling into the member type done
in DwarfDebug::DbgVariable::getType() into the frontend.

rdar://problem/31629055

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

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

6 years agoPrevent cpu-specific/cpu-dispatch from giong on a lambda.
Erich Keane [Mon, 10 Sep 2018 14:31:56 +0000 (14:31 +0000)]
Prevent cpu-specific/cpu-dispatch from giong on a lambda.

It is non-sensical to use cpu-specific/cpu-dispatch multiversioning
on a lambda, so prevent it when trying to add the attribute.

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

6 years ago[clang] Make sure codecompletion is called for calls even when inside a token.
Kadir Cetinkaya [Mon, 10 Sep 2018 13:46:28 +0000 (13:46 +0000)]
[clang] Make sure codecompletion is called for calls even when inside a token.

Summary:
Currently CodeCompleteCall only gets called after a comma or parantheses. This
patch makes sure it is called even at the cases like:
```foo(1^);```

Reviewers: ilya-biryukov, ioeric, hokein

Reviewed By: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

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

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

6 years ago[Analyzer] Commit fix for rL341790/rC341790
Adam Balogh [Mon, 10 Sep 2018 09:19:54 +0000 (09:19 +0000)]
[Analyzer] Commit fix for rL341790/rC341790

Test file was accidentally not added for rL341790/rC341790 and subsequant patches.

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

6 years ago[Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, emplace...
Adam Balogh [Mon, 10 Sep 2018 09:07:47 +0000 (09:07 +0000)]
[Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, emplace and erase operations

This patch adds support for the following operations in the iterator checkers: assign, clear, insert, insert_after, emplace, emplace_after, erase and erase_after. This affects mismatched iterator checks ("this" and parameter must match) and invalidation checks (according to the standard).

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

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

6 years ago[Analyzer] Iterator Checker - Part 7: Support for push and pop operations
Adam Balogh [Mon, 10 Sep 2018 09:06:31 +0000 (09:06 +0000)]
[Analyzer] Iterator Checker - Part 7: Support for push and pop operations

This patch adds support for the following operations in the iterator checkers: push_back, push_front, emplace_back, emplace_front, pop_back and pop_front. This affects iterator range checks (range is extended after push and emplace and reduced after pop operations) and invalidation checks (according to the standard).

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

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

6 years ago[Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors...
Adam Balogh [Mon, 10 Sep 2018 09:05:31 +0000 (09:05 +0000)]
[Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for constructors and comparisons

Extension of the mismatched iterator checker for constructors taking range of first..last (first and last must be iterators of the same container) and also for comparisons of iterators of different containers (one does not compare iterators of different containers, since the set of iterators is partially ordered, there are no relations between iterators of different containers, except that they are always non-equal).

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

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

6 years ago[Analyzer] Iterator Checker - Part 5: Move Assignment of Containers
Adam Balogh [Mon, 10 Sep 2018 09:04:27 +0000 (09:04 +0000)]
[Analyzer] Iterator Checker - Part 5: Move Assignment of Containers

If a container is moved by its move assignment operator, according to the standard all their iterators except the past-end iterators remain valid but refer to the new container. This patch introduces support for this case in the iterator checkers.

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

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

6 years ago[Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters
Adam Balogh [Mon, 10 Sep 2018 09:03:22 +0000 (09:03 +0000)]
[Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for function parameters

New check added to the checker which checks whether iterator parameters of template functions typed by the same template parameter refer to the same container.

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

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

6 years agoReleaseNotes: update links to use https
Hans Wennborg [Mon, 10 Sep 2018 08:51:25 +0000 (08:51 +0000)]
ReleaseNotes: update links to use https

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

6 years agoPR33222: Require the declared return type not the actual return type to
Richard Smith [Mon, 10 Sep 2018 06:35:32 +0000 (06:35 +0000)]
PR33222: Require the declared return type not the actual return type to
match when checking for redeclaration of a function template.

This properly handles differences in deduced return types, particularly
when performing redeclaration checks for a friend function template.

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

6 years agoPart of PR33222: defer enforcing return type mismatch for dependent
Richard Smith [Mon, 10 Sep 2018 05:32:13 +0000 (05:32 +0000)]
Part of PR33222: defer enforcing return type mismatch for dependent
friend function declarations of class templates.

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

6 years ago[OpenMP] Add support for nested 'declare target' directives
Kelvin Li [Mon, 10 Sep 2018 02:07:09 +0000 (02:07 +0000)]
[OpenMP] Add support for nested 'declare target' directives

Add the capability to nest multiple declare target directives
- including header files within a declare target region.

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

Patch by Patrick Lyster

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

6 years ago[Sema] Make typo correction slightly more efficient
Fangrui Song [Sun, 9 Sep 2018 17:20:03 +0000 (17:20 +0000)]
[Sema] Make typo correction slightly more efficient

edit_distance returns UpperBound+1 if the distance will exceed UpperBound. We can subtract 1 from UpperBound and change >= to > in the if condition. The threshold does not change but edit_distance will have more opportunity to bail out earlier.

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