Commit Graph

73970 Commits

Author SHA1 Message Date
Benjamin Kramer 9508af351a Reinstate quotes around the path to python that I accidentaly removed in r335330
This broke users with spaces in the path, like C:\Program Files\Python

llvm-svn: 335382
2018-06-22 20:03:32 +00:00
Richard Smith 69bc9aa22f Restore pre-r335182 behavior for naming inherited constructors as
members of dependent contexts.

This permits cases where the names before and after the '::' in a
dependent inherited constructor using-declaration do not match, but
where we can nonetheless tell when parsing the template that a
constructor is being named. Under (open) core language DR 2070, such
cases will probably be ill-formed, but r335182 does not quite give
that result and didn't intend to change this, so restore the old
behavior for now.

llvm-svn: 335381
2018-06-22 19:50:19 +00:00
Sam Clegg 5421b37893 Fix BUILD_SHARED_LIBS=1 build of libclangHandleLLVM
Differential Revision: https://reviews.llvm.org/D48503

llvm-svn: 335380
2018-06-22 19:44:48 +00:00
Alexey Bataev 12c62908b5 [OPENMP, NVPTX] Fix reduction of the big data types/structures.
If the shuffle is required for the reduced structures/big data type,
current code may cause compiler crash because of the loading of the
aggregate values. Patch fixes this problem.

llvm-svn: 335377
2018-06-22 19:10:38 +00:00
Bruno Cardoso Lopes a9c51fe089 Re-apply: Warning for framework headers using double quote includes
Introduce -Wquoted-include-in-framework-header, which should fire a warning
whenever a quote include appears in a framework header and suggest a fix-it.
For instance, for header A.h added in the tests, this is how the warning looks
like:

./A.framework/Headers/A.h:2:10: warning: double-quoted include "A0.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#include "A0.h"
         ^~~~~~
         <A/A0.h>
./A.framework/Headers/A.h:3:10: warning: double-quoted include "B.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#include "B.h"
         ^~~~~
         <B.h>

This helps users to prevent frameworks from using local headers when in fact
they should be targetting system level ones.

The warning is off by default.

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

rdar://problem/37077034

llvm-svn: 335375
2018-06-22 18:05:17 +00:00
Emmett Neyman e5f4a9ff76 Implemented proto to LLVM conversion and LLVM fuzz target
Differential Revision: https://reviews.llvm.org/D48106

llvm-svn: 335374
2018-06-22 18:05:00 +00:00
Erich Keane 87cfcfd009 [NFC] Fix AttributeList allocated_size for ParsedType.
This if/elseif structure seems to be missing this case.
Previously, this would report a size of 1 pointer too small. 
This didn't really change anything besides failing to reclaim
a very small amount of memory.

llvm-svn: 335372
2018-06-22 17:34:44 +00:00
Steven Wu b3684db431 Add const qualifier on FieldChainInfoComparator::operator()
libcxx has user defined warning to check for non const call operator.
Silence the warning by adding the const on operator().

llvm-svn: 335366
2018-06-22 16:51:17 +00:00
Anastasia Stulova 7f785bb458 [OpenCL] Fixed parsing of address spaces for C++.
Added address space tokens to C++ parsing code to be able
to parse declarations that start from an address space keyword.

llvm-svn: 335362
2018-06-22 16:20:21 +00:00
Anastasia Stulova bf549bf402 [Sema] Updated note for address spaces to print the type.
This allows to reuse the same diagnostic for OpenCL or CUDA.

llvm-svn: 335358
2018-06-22 15:45:08 +00:00
Kostya Kortchinsky 64d8093691 [Driver] Make scudo compatible with -fsanitize-minimal-runtime
Summary:
This is the clang side of the change, there is a compiler-rt counterpart.

Scudo works with UBSan using `-fsanitize=scudo,integer` for example, and to do
so it embeds UBSan runtime. This makes it not compatible with the UBSan minimal
runtime, but this is something we want for production purposes.

The idea is to have a Scudo minimal runtime on the compiler-rt side that will
not embed UBSan. This is basically the runtime that is currently in use for
Fuchsia, without coverage, stacktraces or symbolization. With this, Scudo
becomes compatible with `-fsanitize-minimal-runtime`.

If this approach is suitable, I'll add the tests as well, otherwise I am open
to other options.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, cfe-commits

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

llvm-svn: 335352
2018-06-22 14:31:30 +00:00
Gabor Buella 716863c820 [X86] Lower _mm[256|512]_cmp[.]_mask intrinsics to native llvm IR
Summary:
Lowering some vector comparision builtins to fcmp IR instructions.
This ignores the signaling behaviour specified in the predicate
argument of said builtins.

Affected AVX512 builtins:

__builtin_ia32_cmpps128_mask
__builtin_ia32_cmpps256_mask
__builtin_ia32_cmpps512_mask
__builtin_ia32_cmppd128_mask
__builtin_ia32_cmppd256_mask
__builtin_ia32_cmppd512_mask

Reviewers: craig.topper, uriel.k, RKSimon, andrew.w.kaylor, spatel, scanon, efriedma

Reviewed By: craig.topper, spatel, efriedma

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

llvm-svn: 335339
2018-06-22 11:59:16 +00:00
Jacek Olesiak 2b772c1136 [clang-format] Add AlwaysBreakBeforeMultilineString tests
Summary: Followup to D47393.

Reviewers: stephanemoore

Reviewed By: stephanemoore

Subscribers: benhamilton, cfe-commits

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

llvm-svn: 335338
2018-06-22 11:57:55 +00:00
Benjamin Kramer 9b10b69afa [hmaptool] Turn %hmaptool into a proper substitution
This is still super ugly, but at least it doesn't require working
directories to just line up perfectly for python to find the tool.

llvm-svn: 335330
2018-06-22 09:46:40 +00:00
Chandler Carruth f34ffd58d9 [x86] Fix a tiny bug in my test case in r335309 by marking that we don't
expect any diagnostics.

llvm-svn: 335310
2018-06-21 23:52:36 +00:00
Chandler Carruth 16e6bc23a1 [x86] Teach the builtin argument range check to allow invalid ranges in
dead code.

This is important for C++ templates that essentially compute the valid
input in a way that is constant and will cause all the invalid cases to
be dead code that is deleted. Code in the wild actually does this and
GCC also accepts these kinds of patterns so it is important to support
it.

To make this work, we provide a non-error path to diagnose these issues,
and use a default-error warning instead. This keeps the relatively
strict handling but prevents nastiness like SFINAE on these errors. It
also allows us to safely use the system to diagnose this only when it
occurs at runtime (in emitted code).

Entertainingly, this required fixing the syntax in various other ways
for the x86 test because we never bothered to diagnose that the returns
were invalid.

Since debugging these compile failures was super confusing, I've also
improved the diagnostic to actually say what the value was. Most of the
checks I've made ignore this to simplify maintenance, but I've checked
it in a few places to make sure the diagnsotic is working.

Depends on D48462. Without that, we might actually crash some part of
the compiler after bypassing the error here.

Thanks to Richard, Ben Kramer, and especially Craig Topper for all the
help here.

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

llvm-svn: 335309
2018-06-21 23:46:09 +00:00
Craig Topper 342b095689 [X86] Update handling in CGBuiltin to be tolerant of out of range immediates.
D48464 contains changes that will loosen some of the range checks in SemaChecking to a DefaultError warning that can be disabled.

This patch adds explicit masking to avoid using the upper bits of immediates to gracefully handle the warning being disabled.

llvm-svn: 335308
2018-06-21 23:39:47 +00:00
Evgeniy Stepanov fb762b27f2 Ignore blacklist when generating __cfi_check_fail.
Summary: Fixes PR37898.

Reviewers: pcc, vlad.tsyrklevich

Subscribers: cfe-commits

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

llvm-svn: 335305
2018-06-21 23:22:37 +00:00
Emmett Neyman 07605cb6ea Test commit, made a minor change to a comment
llvm-svn: 335299
2018-06-21 22:08:20 +00:00
Bruno Cardoso Lopes dc3f88ad98 Re-apply: Add python tool to dump and construct header maps
Header maps are binary files used by Xcode, which are used to map
header names or paths to other locations. Clang has support for
those since its inception, but there's not a lot of header map
testing around.

Since it's a binary format, testing becomes pretty much brittle
and its hard to even know what's inside if you don't have the
appropriate tools.

Add a python based tool that allows creating and dumping header
maps based on a json description of those. While here, rewrite
tests to use the tool and remove the binary files from the tree.

This tool was initially written by Daniel Dunbar.

Thanks to Stella Stamenova for helping make this work on Windows.

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

rdar://problem/39994722

llvm-svn: 335295
2018-06-21 21:45:24 +00:00
Tobias Edler von Koch e597a2cf81 Revert "[LTO] Enable module summary emission by default for regular LTO"
This is breaking a couple of buildbots. We need to run the
NameAnonGlobal pass for regular LTO now as well (since we're producing a
summary). I'll post a separate patch for review to make this happen and
then re-commit.

This reverts commit c0759b7b1f4a81ff9021b952aa38a222d5fa4dfd.

llvm-svn: 335291
2018-06-21 21:24:30 +00:00
Konstantin Zhuravlyov 37e9739a58 AMDGPU: Remove amdgpu-debugger-reserve-regs feature
llvm-svn: 335287
2018-06-21 20:27:47 +00:00
Alexey Bataev 4065b9ae48 [OPENMP, NVPTX] Fix globalization of the variables passed to orphaned
parallel region.

If the current construct requires sharing of the local variable in the
inner parallel region, this variable must be globalized to avoid
runtime crash.

llvm-svn: 335285
2018-06-21 20:26:33 +00:00
Tobias Edler von Koch 9a8be606f3 [LTO] Enable module summary emission by default for regular LTO
Summary:
With D33921, we gained the ability to have module summaries in regular
LTO modules without triggering ThinLTO compilation. Module summaries in
regular LTO allow garbage collection (dead stripping) before LTO
compilation and thus open up additional optimization opportunities.

This patch enables summary emission in regular LTO for all targets
except ld64-based ones (which use the legacy LTO API).

Reviewers: pcc, tejohnson, mehdi_amini

Subscribers: inglorion, eraman, cfe-commits

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

llvm-svn: 335284
2018-06-21 20:20:41 +00:00
Jonathan Coe aef6c79d28 [bindings] Fix most Python binding unittests on Windows
Summary:
This fixes all but one of the test cases for Windows. TestCDB will
take more work to debug, as CompilationDatabase seems not to work correctly.

Reviewers: bkramer, wanders, jbcoe

Reviewed By: bkramer, jbcoe

Subscribers: cfe-commits

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

Patch written by ethanhs (Ethan)

llvm-svn: 335282
2018-06-21 20:07:03 +00:00
Craig Topper 1763dbb278 [X86] Correct the inline assembly implementations of __movsb/w/d/q and __stosw/d/q to mark registers/memory as modified
The inline assembly for these didn't mark that edi, esi, ecx are modified by movs/stos instruction. It also didn't mark that memory is modified.

This issue was reported to llvm-dev last year http://lists.llvm.org/pipermail/cfe-dev/2017-November/055863.html but no bug was ever filed.

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

llvm-svn: 335270
2018-06-21 18:56:30 +00:00
Craig Topper b2431c6c33 [Intrinsics] Add/move some builtin declarations in intrin.h to get ms-intrinsics.c to not issue warnings
ud2 and int2c were missing declarations entirely. And the bitscans were only under x86_64, but they seem to be in BuiltinsARM.def as well and are tested by ms_intrinsics.c

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

llvm-svn: 335259
2018-06-21 17:07:04 +00:00
Anastasis Grammenos dfe8fe503c [DebugInfo] Inline for without DebugLocation
Summary:
This test is a strip down version of a function inside the
amalgamated sqlite source. When converted to IR clang produces
a phi instruction without debug location.

This patch fixes the above issue.

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

llvm-svn: 335255
2018-06-21 16:53:48 +00:00
Craig Topper ddfe69cc99 [X86] Rewrite the add/mul/or/and reduction intrinsics to make better use of other intrinsics and remove undef shuffle indices.
Similar to what was done to max/min recently.

These already reduced the vector width to 256 and 128 bit as we go unlike the original max/min code.

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

llvm-svn: 335253
2018-06-21 16:41:28 +00:00
Rainer Orth 4bd5c47601 [liblang] Remove DOS line endings in libclang.exports
Undefined                       first referenced
 symbol                             in file
clang_getCompletionFixIt           /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getTokenLocation             /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getToken                     /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getTemplateCursorKind        /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getTUResourceUsageName       /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionChunkKind       /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionChunkText       /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getSpellingLocation          /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionParent          /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionChunkCompletionString /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionPriority        /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionNumFixIts       /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getTokenExtent               /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getCompletionNumAnnotations  /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
clang_getTokenKind                 /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
make[2]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/build.make:651: lib/libclang.so.7] Error 1

It turns out that this is caused by https://reviews.llvm.org/D46862: it added a
couple of CRs (^M) to some lines.  Solaris ld takes them to be part of the symbol
names, which of course are missing from the input objects.  GNU ld handles this
just fine.  Fixed by removing the CRs.

Bootstrapped on i386-pc-solaris2.11.  I guess this is obvious.

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

llvm-svn: 335234
2018-06-21 13:40:50 +00:00
Ivan Donchevskii 42e31cbe7c Fix line endings in recently updated test file
llvm-svn: 335220
2018-06-21 12:39:24 +00:00
Ivan Donchevskii f83cfda02b [Sema] Fix overloaded static functions for templates
Apply almost the same fix as https://reviews.llvm.org/D36390 but for templates.

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

llvm-svn: 335211
2018-06-21 08:34:50 +00:00
Craig Topper 2da60bc231 [X86] Remove masking from the 512-bit floating point max/min builtins. Use select in IR instead.
llvm-svn: 335200
2018-06-21 05:01:01 +00:00
Bruno Cardoso Lopes 1f3cc8c1d3 Revert "Add python tool to dump and construct header maps"
This reverts commit fcfa2dd517ec1a6045a81e8247e346d630a22618.

Broke bots:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio

llvm-svn: 335196
2018-06-21 01:23:58 +00:00
Bruno Cardoso Lopes 6a0a6d8a8b Revert "Warning for framework headers using double quote includes"
This reverts commit 9b5ff2db7e31c4bb11a7d468260b068b41c7c285.

Broke bots:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio

llvm-svn: 335195
2018-06-21 01:23:51 +00:00
Bruno Cardoso Lopes 17d52f65d8 Revert "Fix hmaptool cmake file to work on Windows"
This reverts commit 63711c3cd337a0d22617579a904af07481139611, due to
breaking bots:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio

llvm-svn: 335194
2018-06-21 01:23:42 +00:00
Evgeniy Stepanov 2b61d12f1e ASan docs: no_sanitize("address") works on globals.
Summary: Mention that no_sanitize attribute can be used with globals.

Reviewers: alekseyshl

Subscribers: cfe-commits

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

llvm-svn: 335193
2018-06-21 00:16:32 +00:00
Richard Smith 90ae9677e7 When a dependent alignas is applied to a non-dependent typedef,
prioritize the error for the bad subject over the error for the
dependent / non-dependent mismatch.

llvm-svn: 335191
2018-06-20 23:36:55 +00:00
Bruno Cardoso Lopes 9dd5090086 Fix hmaptool cmake file to work on Windows
Unbreak a few windows buildbots:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdio

llvm-svn: 335190
2018-06-20 23:08:43 +00:00
Akira Hatanaka 8c21627963 Use cast instead of dyn_cast_or_null.
This addresses John's post-commit review feedback.

https://reviews.llvm.org/rC335021#inline-2038

llvm-svn: 335189
2018-06-20 22:56:59 +00:00
Bruno Cardoso Lopes d1d83df807 Warning for framework headers using double quote includes
Introduce -Wquoted-include-in-framework-header, which should fire a warning
whenever a quote include appears in a framework header and suggest a fix-it.
For instance, for header A.h added in the tests, this is how the warning looks
like:

./A.framework/Headers/A.h:2:10: warning: double-quoted include "A0.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#include "A0.h"
         ^~~~~~
         <A/A0.h>
./A.framework/Headers/A.h:3:10: warning: double-quoted include "B.h" in framework header, expected angle-bracketed instead [-Wquoted-include-in-framework-header]
#include "B.h"
         ^~~~~
         <B.h>

This helps users to prevent frameworks from using local headers when in fact
they should be targetting system level ones.

The warning is off by default.

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

rdar://problem/37077034

llvm-svn: 335184
2018-06-20 22:11:59 +00:00
Richard Smith 715ee079da Related to PR37768: improve diagnostics for class name shadowing.
Diagnose the name of the class being shadowed by using declarations, and
improve the diagnostics for the case where the name of the class is
shadowed by a non-static data member in a class with constructors.  In
the latter case, we now always give the "member with the same name as
its class" diagnostic regardless of the relative order of the member and
the constructor, rather than giving an inscrutible diagnostic if the
constructor appears second.

llvm-svn: 335182
2018-06-20 21:58:20 +00:00
Bruno Cardoso Lopes f3003a92c1 Add python tool to dump and construct header maps
Header maps are binary files used by Xcode, which are used to map
header names or paths to other locations. Clang has support for
those since its inception, but there's not a lot of header map
testing around.

Since it's a binary format, testing becomes pretty much brittle
and its hard to even know what's inside if you don't have the
appropriate tools.

Add a python based tool that allows creating and dumping header
maps based on a json description of those. While here, rewrite
tests to use the tool and remove the binary files from the tree.

This tool was initially written by Daniel Dunbar.

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

rdar://problem/39994722

llvm-svn: 335177
2018-06-20 21:16:37 +00:00
Reid Kleckner c8ae878399 [MS] Make sure __GetExceptionInfo works on types with no linkage
Fixes PR36327

llvm-svn: 335175
2018-06-20 21:12:20 +00:00
Artem Belevich e5a42e977f [CUDA] Removed unused __nvvm_* builtins with non-generic pointers.
They were hot even hooked into CGBuiltin's machinery. Even if they were,
CUDA does not support AS-specific pointers, so there would be no legal way
no way to call these builtins.

This came up in D47154.

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

llvm-svn: 335168
2018-06-20 20:34:04 +00:00
Leonard Chan 2e5aa36011 Fixed test in prior build where FileCheck tried to match against
`common` when declaring a global variable when we primarily care about
the value assigned in the test.

llvm-svn: 335159
2018-06-20 19:34:05 +00:00
Leonard Chan 7170b5ae74 Fixed test that failed when checking what variable a value was stored
in for fixed point types.

llvm-svn: 335155
2018-06-20 18:48:05 +00:00
Leonard Chan db01c3adc6 [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point Literals
This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal.

Fixed point literals are declared using the suffixes

```
hr: short _Fract
uhr: unsigned short _Fract
r: _Fract
ur: unsigned _Fract
lr: long _Fract
ulr: unsigned long _Fract
hk: short _Accum
uhk: unsigned short _Accum
k: _Accum
uk: unsigned _Accum
```
Errors are also thrown for illegal literal values

```
unsigned short _Accum u_short_accum = 256.0uhk;   // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}}
```

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

llvm-svn: 335148
2018-06-20 17:19:40 +00:00
Nico Weber 192184c5f8 Simplify. No behavior change.
llvm-svn: 335139
2018-06-20 15:57:38 +00:00
Mikhail R. Gadelha bd1077e2bc [analyzer] Optimize constraint generation when the range is a concrete value
Summary:
If a constraint is something like:
```
$0 = [1,1]
```
it'll now be created as:
```
assert($0 == 1)
```
instead of:
```
assert($0 >= 1 && $0 <= 1)
```

In general, ~3% speedup when solving per query in my machine. Biggest improvement was when verifying sqlite3, total time went down from 3000s to 2200s.

I couldn't create a test for this as there is no way to dump the formula yet. D48221 adds a method to dump the formula but there is no way to do it from the command line.

Also, a test that prints the formula will most likely fail in the future, as different solvers print the formula in different formats.

Reviewers: NoQ, george.karpenkov, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

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

llvm-svn: 335116
2018-06-20 11:42:12 +00:00