]> granicus.if.org Git - clang/log
clang
6 years ago[CodeGen] add test file that should have been included with r340141
Sanjay Patel [Sun, 19 Aug 2018 17:32:56 +0000 (17:32 +0000)]
[CodeGen] add test file that should have been included with r340141

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

6 years ago[CodeGen] add rotate builtins that map to LLVM funnel shift
Sanjay Patel [Sun, 19 Aug 2018 16:50:30 +0000 (16:50 +0000)]
[CodeGen] add rotate builtins that map to LLVM funnel shift
This is a partial retry of rL340137 (reverted at rL340138 because of gcc host compiler crashing)
with 1 change:
Remove the changes to make microsoft builtins also use the LLVM intrinsics.

This exposes the LLVM funnel shift intrinsics as more familiar bit rotation functions in clang
(when both halves of a funnel shift are the same value, it's a rotate).

We're free to name these as we want because we're not copying gcc, but if there's some other
existing art (eg, the microsoft ops) that we want to replicate, we can change the names.

The funnel shift intrinsics were added here:
https://reviews.llvm.org/D49242

With improved codegen in:
https://reviews.llvm.org/rL337966
https://reviews.llvm.org/rL339359

And basic IR optimization added in:
https://reviews.llvm.org/rL338218
https://reviews.llvm.org/rL340022

...so these are expected to produce asm output that's equal or better to the multi-instruction
alternatives using primitive C/IR ops.

In the motivating loop example from PR37387:
https://bugs.llvm.org/show_bug.cgi?id=37387#c7
...we get the expected 'rolq' x86 instructions if we substitute the rotate builtin into the source.

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

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

6 years ago[NEON] Define fp16 vld and vst intrinsics conditionally
Ivan A. Kosarev [Sun, 19 Aug 2018 16:30:57 +0000 (16:30 +0000)]
[NEON] Define fp16 vld and vst intrinsics conditionally

This patch fixes definitions of vld and vst NEON intrinsics so
that we only define them if half-precision arithmetic is
supported on the target platform, as prescribed in ACLE 2.0.

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

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

6 years agorevert r340137: [CodeGen] add rotate builtins
Sanjay Patel [Sun, 19 Aug 2018 15:31:42 +0000 (15:31 +0000)]
revert r340137: [CodeGen] add rotate builtins

At least a couple of bots (gcc host compiler on PPC only?) are showing the compiler dying while trying to compile.

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

6 years ago[CodeGen] add/fix rotate builtins that map to LLVM funnel shift (retry)
Sanjay Patel [Sun, 19 Aug 2018 14:44:47 +0000 (14:44 +0000)]
[CodeGen] add/fix rotate builtins that map to LLVM funnel shift (retry)

This is a retry of rL340135 (reverted at rL340136 because of gcc host compiler crashing)
with 2 changes:
1. Move the code into a helper to reduce code duplication (and hopefully work-around the crash).
2. The original commit had a formatting bug in the docs (missing an underscore).

Original commit message:

This exposes the LLVM funnel shift intrinsics as more familiar bit rotation functions in clang
(when both halves of a funnel shift are the same value, it's a rotate).

We're free to name these as we want because we're not copying gcc, but if there's some other
existing art (eg, the microsoft ops that are modified in this patch) that we want to replicate,
we can change the names.

The funnel shift intrinsics were added here:
https://reviews.llvm.org/D49242

With improved codegen in:
https://reviews.llvm.org/rL337966
https://reviews.llvm.org/rL339359

And basic IR optimization added in:
https://reviews.llvm.org/rL338218
https://reviews.llvm.org/rL340022

...so these are expected to produce asm output that's equal or better to the multi-instruction
alternatives using primitive C/IR ops.

In the motivating loop example from PR37387:
https://bugs.llvm.org/show_bug.cgi?id=37387#c7
...we get the expected 'rolq' x86 instructions if we substitute the rotate builtin into the source.

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

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

6 years agorevert r340135: [CodeGen] add rotate builtins
Sanjay Patel [Sun, 19 Aug 2018 13:48:06 +0000 (13:48 +0000)]
revert r340135: [CodeGen] add rotate builtins

At least a couple of bots (PPC only?) are showing the compiler dying while trying to compile:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/11065/steps/build%20stage%201/logs/stdio
http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/18267/steps/build%20stage%201/logs/stdio

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

6 years ago[CodeGen] add rotate builtins
Sanjay Patel [Sun, 19 Aug 2018 13:12:40 +0000 (13:12 +0000)]
[CodeGen] add rotate builtins

This exposes the LLVM funnel shift intrinsics as more familiar bit rotation functions in clang
(when both halves of a funnel shift are the same value, it's a rotate).

We're free to name these as we want because we're not copying gcc, but if there's some other
existing art (eg, the microsoft ops that are modified in this patch) that we want to replicate,
we can change the names.

The funnel shift intrinsics were added here:
D49242

With improved codegen in:
rL337966
rL339359

And basic IR optimization added in:
rL338218
rL340022

...so these are expected to produce asm output that's equal or better to the multi-instruction
alternatives using primitive C/IR ops.

In the motivating loop example from PR37387:
https://bugs.llvm.org/show_bug.cgi?id=37387#c7
...we get the expected 'rolq' x86 instructions if we substitute the rotate builtin into the source.

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

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

6 years agoRevert "[analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker"
Bruno Cardoso Lopes [Sat, 18 Aug 2018 03:22:11 +0000 (03:22 +0000)]
Revert "[analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker"

This reverts commit a786521fa66c72edd308baff0c08961b6d964fb1.

Bots haven't caught up yet, but broke modules build with:

../tools/clang/include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h:18:10:
fatal error: cyclic dependency in module 'Clang_StaticAnalyzer_Core':
Clang_StaticAnalyzer_Core -> Clang_Analysis ->
Clang_StaticAnalyzer_Checkers -> Clang_StaticAnalyzer_Core
         ^

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

6 years ago[analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker
George Karpenkov [Sat, 18 Aug 2018 01:45:50 +0000 (01:45 +0000)]
[analyzer] [NFC] Split up RetainSummaryManager from RetainCountChecker

ARCMigrator is using code from RetainCountChecker, which is a layering
violation (and it also does it badly, by using a different header, and
then relying on implementation being present in a header file).

This change splits up RetainSummaryManager into a separate library in
lib/Analysis, which can be used independently of a checker.

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

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

6 years agoQuickfix for failing tests.
George Karpenkov [Fri, 17 Aug 2018 23:54:00 +0000 (23:54 +0000)]
Quickfix for failing tests.

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

6 years ago[index] For an ObjC message call, also record as receivers the protocols if they...
Argyrios Kyrtzidis [Fri, 17 Aug 2018 23:50:59 +0000 (23:50 +0000)]
[index] For an ObjC message call, also record as receivers the protocols if they are present in the ObjC type

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

6 years ago[ObjC] Error out when using forward-declared protocol in a @protocol
Alex Lorenz [Fri, 17 Aug 2018 22:18:08 +0000 (22:18 +0000)]
[ObjC] Error out when using forward-declared protocol in a @protocol
expression

Clang emits invalid protocol metadata when a @protocol expression is used with a
forward-declared protocol. The protocol metadata is missing protocol conformance
list of the protocol since we don't have access to the definition of it in the
compiled translation unit. The linker then might end up picking the invalid
metadata when linking which will lead to incorrect runtime protocol conformance
checks.

This commit makes sure that Clang fails to compile code that uses a @protocol
expression with a forward-declared protocol. This ensures that Clang does not
emit invalid protocol metadata. I added an extra assert in CodeGen to ensure
that this kind of issue won't happen in other places.

rdar://32787811

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

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

6 years agoDon't warn on returning the address of a label from a statement expression
Reid Kleckner [Fri, 17 Aug 2018 22:11:31 +0000 (22:11 +0000)]
Don't warn on returning the address of a label from a statement expression

Summary:
There isn't anything inherently wrong with returning a label from a
statement expression. In practice, the Linux kernel uses this pattern to
materialize PCs.

Fixes PR38569

Reviewers: niravd, rsmith, nickdesaulniers

Subscribers: cfe-commits

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

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

6 years ago[analyzer] [NFC] Minor refactoring of ISL-specific code in RetainCountChecker
George Karpenkov [Fri, 17 Aug 2018 21:43:27 +0000 (21:43 +0000)]
[analyzer] [NFC] Minor refactoring of ISL-specific code in RetainCountChecker

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

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

6 years ago[analyzer] Re-instate support for MakeCollectable is RetainCountChecker
George Karpenkov [Fri, 17 Aug 2018 21:42:59 +0000 (21:42 +0000)]
[analyzer] Re-instate support for MakeCollectable is RetainCountChecker

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

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

6 years ago[analyzer] [NFC] Move ObjCRetainCount to include/Analysis
George Karpenkov [Fri, 17 Aug 2018 21:42:32 +0000 (21:42 +0000)]
[analyzer] [NFC] Move ObjCRetainCount to include/Analysis

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

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

6 years ago[analyzer] [NFC] Move canEval function from RetainCountChecker to RetainCountSummaries
George Karpenkov [Fri, 17 Aug 2018 21:42:05 +0000 (21:42 +0000)]
[analyzer] [NFC] Move canEval function from RetainCountChecker to RetainCountSummaries

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

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

6 years ago[analyzer] [NFC] Split up summary generation in RetainCountChecker in two methods
George Karpenkov [Fri, 17 Aug 2018 21:41:37 +0000 (21:41 +0000)]
[analyzer] [NFC] Split up summary generation in RetainCountChecker in two methods

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

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

6 years ago[analyzer] [NFC] Split up RetainCountChecker
George Karpenkov [Fri, 17 Aug 2018 21:41:07 +0000 (21:41 +0000)]
[analyzer] [NFC] Split up RetainCountChecker

At some point, staring at 4k+ LOC file becomes a bit hard.

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

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

6 years ago[analyzer] Drop support for GC mode in RetainCountChecker
George Karpenkov [Fri, 17 Aug 2018 21:40:38 +0000 (21:40 +0000)]
[analyzer] Drop support for GC mode in RetainCountChecker

A lot of code in RetainCountChecker deals with GC mode.
Given that GC mode is deprecated, Apple does not ship runtime for it,
and modern compiler toolchain does not support it, it makes sense to
remove the code dealing with it in order to aid understanding of
RetainCountChecker.

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

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

6 years agotest commit: add a comment
Mike Rice [Fri, 17 Aug 2018 21:16:21 +0000 (21:16 +0000)]
test commit: add a comment

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

6 years agoUpdate comments in CGDebugInfo to reflect changes in the MS mangler, NFC
Reid Kleckner [Fri, 17 Aug 2018 20:59:52 +0000 (20:59 +0000)]
Update comments in CGDebugInfo to reflect changes in the MS mangler, NFC

I've tried to elaborate on the purpose of these type identifiers and why
and when clang uses them.

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

6 years ago[MS] Mangle a hash of the main file path into anonymous namespaces
Reid Kleckner [Fri, 17 Aug 2018 20:59:27 +0000 (20:59 +0000)]
[MS] Mangle a hash of the main file path into anonymous namespaces

Summary:
This is needed to avoid conflicts in mangled names for codeview types in
anonymous namespaces. In CodeView, types refer to each other typically
through forward declarations, which contain mangled names. These names
have to be unique, otherwise the debugger will look up the mangled name
and find the wrong definition.

Furthermore, ThinLTO will deduplicate the types, and debug info
verification can fail when the types have the wrong sizes. This is
PR38608.

Fixes PR38609.

Reviewers: majnemer, inglorion, hans

Subscribers: mehdi_amini, aprantl, JDevlieghere, dexonsmith, cfe-commits

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

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

6 years agoImprove diagnostic for missing comma in template parameter list.
Richard Smith [Fri, 17 Aug 2018 19:43:40 +0000 (19:43 +0000)]
Improve diagnostic for missing comma in template parameter list.

Given 'typename T typename U', we would correctly diagnose the missing
comma, but incorrectly disambiguate the first parameter as being a
non-type parameter and complain that the 'T' is not a qualified-id.

See also gcc.gnu.org/PR86998.

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

6 years ago[HIP] Make __hip_gpubin_handle hidden to avoid being merged across different shared...
Yaxun Liu [Fri, 17 Aug 2018 17:47:31 +0000 (17:47 +0000)]
[HIP] Make __hip_gpubin_handle hidden to avoid being merged across different shared libraries

Different shared libraries contain different fat binary, which is stored in a global variable
__hip_gpubin_handle. Since different compilation units share the same fat binary, this
variable has linkonce linkage. However, it should not be merged across different shared
libraries.

This patch set the visibility of the global variable to be hidden, which will make it invisible
in the shared library, therefore preventing it from being merged.

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

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

6 years agoMake __shiftleft128 / __shiftright128 real compiler built-ins.
Nico Weber [Fri, 17 Aug 2018 17:19:06 +0000 (17:19 +0000)]
Make __shiftleft128 / __shiftright128 real compiler built-ins.

r337619 added __shiftleft128 / __shiftright128 as functions in intrin.h.
Microsoft's STL plans on using these functions, and they're using intrin0.h
which just has declarations of built-ins to not pull in the huge intrin.h
header in the standard library headers. That requires that these functions are
real built-ins.

https://reviews.llvm.org/D50907

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

6 years ago[CodeGen] Merge identical block descriptor global variables.
Akira Hatanaka [Fri, 17 Aug 2018 15:46:07 +0000 (15:46 +0000)]
[CodeGen] Merge identical block descriptor global variables.

Currently, clang generates a new block descriptor global variable for
each new block literal. This commit merges block descriptors that are
identical inside and across translation units using the same approach
taken in r339438.

To enable merging identical block descriptors, the size and signature of
the block and information about the captures are encoded into the name
of the block descriptor variable. Also, the block descriptor variable is
marked as linkonce_odr and unnamed_addr.

rdar://problem/42640703

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

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

6 years ago[Preamble] Empty preamble is not an error.
Haojian Wu [Fri, 17 Aug 2018 14:25:10 +0000 (14:25 +0000)]
[Preamble] Empty preamble is not an error.

Summary:
Empty preamble is valid for source file which doesn't have any
preprocessor and #includes.

This patch makes clang treat an empty preamble as a normal preamble.

Check: ninja check-clang

A testcase is added in https://reviews.llvm.org/D50627.

Reviewers: ilya-biryukov

Subscribers: cfe-commits

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

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

6 years agoFix for bug 38508 - Don't do PCH processing when only generating preprocessor output
Erich Keane [Fri, 17 Aug 2018 13:43:39 +0000 (13:43 +0000)]
Fix for bug 38508 - Don't do PCH processing when only generating preprocessor output

This clang-cl driver change removes the PCH options when we are only generating
preprocessed output. This is similar to the behavior of Y-.

Patch by: mikerice
Differential Revision: https://reviews.llvm.org/D50640

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

6 years agoclang-cl: Expose -fno-crash-diagnostics (PR38574)
Hans Wennborg [Fri, 17 Aug 2018 13:37:57 +0000 (13:37 +0000)]
clang-cl: Expose -fno-crash-diagnostics (PR38574)

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

6 years ago[ThinLTO] Correct documentation on default number of threads
Teresa Johnson [Fri, 17 Aug 2018 13:19:36 +0000 (13:19 +0000)]
[ThinLTO] Correct documentation on default number of threads

Summary:
The number of threads used for ThinLTO backend parallelism was
dropped to the number of cores in r284618 to avoid oversubscribing
physical cores due to hyperthreading. This updates the documentation
to reflect that change.

Fixes PR38610.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits

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

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

6 years ago[AArch64] - return address signing
Luke Cheeseman [Fri, 17 Aug 2018 12:55:05 +0000 (12:55 +0000)]
[AArch64] - return address signing

- Add a command line options -msign-return-address to enable return address
  signing
- Armv8.3a added instructions to sign the return address to help mitigate
  against ROP attacks
- This patch adds command line options to generate function attributes that
  signal to the back whether return address signing instructions should be
  added

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

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

6 years ago[NFC] Some small test updates for Implicit Conversion sanitizer.
Roman Lebedev [Fri, 17 Aug 2018 07:33:25 +0000 (07:33 +0000)]
[NFC] Some small test updates for Implicit Conversion sanitizer.

Split off from D50250.

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

6 years ago[hexagon] restore -fuse-cxa-atexit by default
Brian Cain [Fri, 17 Aug 2018 03:53:51 +0000 (03:53 +0000)]
[hexagon] restore -fuse-cxa-atexit by default

"-fno-use-cxa-atexit" was a default provided by the initial
commit offering hexagon support.  This is no longer required.

Reviewers: bcahoon, sidneym

Subscribers: llvm-commits

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

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

6 years agoDisable pubnames in NVPTX debug info using metadata
David Blaikie [Thu, 16 Aug 2018 23:56:32 +0000 (23:56 +0000)]
Disable pubnames in NVPTX debug info using metadata

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

6 years agoRelax a CHECK line to allow for dso_local
Vedant Kumar [Thu, 16 Aug 2018 23:19:50 +0000 (23:19 +0000)]
Relax a CHECK line to allow for dso_local

Fixes a bot failure:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/11806

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

6 years ago[InstrProf] Use atomic profile counter updates for TSan
Vedant Kumar [Thu, 16 Aug 2018 22:24:47 +0000 (22:24 +0000)]
[InstrProf] Use atomic profile counter updates for TSan

Thread sanitizer instrumentation fails to skip all loads and stores to
profile counters. This can happen if profile counter updates are merged:

  %.sink = phi i64* ...
  %pgocount5 = load i64, i64* %.sink
  %27 = add i64 %pgocount5, 1
  %28 = bitcast i64* %.sink to i8*
  call void @__tsan_write8(i8* %28)
  store i64 %27, i64* %.sink

To suppress TSan diagnostics about racy counter updates, make the
counter updates atomic when TSan is enabled. If there's general interest
in this mode it can be surfaced as a clang/swift driver option.

Testing: check-{llvm,clang,profile}

rdar://40477803

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

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

6 years agoUpdate for LLVM API change
David Blaikie [Thu, 16 Aug 2018 21:30:24 +0000 (21:30 +0000)]
Update for LLVM API change

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

6 years agoAMDGPU: Correct errors in device table
Matt Arsenault [Thu, 16 Aug 2018 20:19:47 +0000 (20:19 +0000)]
AMDGPU: Correct errors in device table

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

6 years agoUpdate README and Dockerfile to include llvm-proto-fuzzer
Emmett Neyman [Thu, 16 Aug 2018 20:13:40 +0000 (20:13 +0000)]
Update README and Dockerfile to include llvm-proto-fuzzer

Summary: Added commands to Dockerfile to build llvm-proto-fuzzer and the other related tools. Also added a section to the bottom of the README describing what llvm-proto-fuzzer does and how to run it.

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years ago[ASTImporter] Add test for member pointer types.
Raphael Isemann [Thu, 16 Aug 2018 18:22:21 +0000 (18:22 +0000)]
[ASTImporter] Add test for member pointer types.

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for importing CompoundAssignOperators
Raphael Isemann [Thu, 16 Aug 2018 18:21:33 +0000 (18:21 +0000)]
[ASTImporter] Add test for importing CompoundAssignOperators

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, cfe-commits, martong

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

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

6 years ago[ASTImporter] Add test for DoStmt
Raphael Isemann [Thu, 16 Aug 2018 18:20:52 +0000 (18:20 +0000)]
[ASTImporter] Add test for DoStmt

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for WhileStmt
Raphael Isemann [Thu, 16 Aug 2018 18:20:05 +0000 (18:20 +0000)]
[ASTImporter] Add test for WhileStmt

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for IndirectGotoStmt
Raphael Isemann [Thu, 16 Aug 2018 18:19:21 +0000 (18:19 +0000)]
[ASTImporter] Add test for IndirectGotoStmt

Reviewers: a.sidorin, martong

Reviewed By: martong

Subscribers: rnkovacs, martong, cfe-commits

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

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

6 years ago[AST] Store the OwnedTagDecl as a trailing object in ElaboratedType.
Bruno Ricci [Thu, 16 Aug 2018 10:48:16 +0000 (10:48 +0000)]
[AST] Store the OwnedTagDecl as a trailing object in ElaboratedType.

The TagDecl *OwnedTagDecl in ElaboratedType is quite commonly
null (at least when parsing all of Boost, it is non-null for only about 600
of the 66k ElaboratedType). Therefore we can save a pointer in the
common case by storing it as a trailing object, and storing a bit in the
bit-fields of Type indicating when the pointer is null.

Reviewed By: rjmccall

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

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

6 years ago[AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type
Bruno Ricci [Thu, 16 Aug 2018 10:33:36 +0000 (10:33 +0000)]
[AST] Pack the unsigned of SubstTemplateTypeParmPackType into Type

The bit-fields of Type have enough space for the member
unsigned NumArgs of SubstTemplateTypeParmPackType.

Reviewed By: erichkeane

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

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

6 years ago[AST] Pack the unsigned of DependentTemplateSpecializationType into Type
Bruno Ricci [Thu, 16 Aug 2018 10:28:18 +0000 (10:28 +0000)]
[AST] Pack the unsigned of DependentTemplateSpecializationType into Type

The bit-fields of `Type` have enough space for the member
`unsigned NumArgs` of `DependentTemplateSpecializationType`.

Reviewed By: erichkeane

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

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

6 years ago[X86] Remove masking from the 512-bit paddus/psubus builtins. Use a select builtin...
Craig Topper [Thu, 16 Aug 2018 07:28:06 +0000 (07:28 +0000)]
[X86] Remove masking from the 512-bit paddus/psubus builtins. Use a select builtin instead.

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

6 years ago[X86] Remove masking from the 512-bit padds and psubs builtins. Use select builtin...
Craig Topper [Thu, 16 Aug 2018 06:20:29 +0000 (06:20 +0000)]
[X86] Remove masking from the 512-bit padds and psubs builtins. Use select builtin instead.

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

6 years ago[ASTImporter] Add test for CXXDefaultInitExpr
Raphael Isemann [Thu, 16 Aug 2018 01:37:43 +0000 (01:37 +0000)]
[ASTImporter] Add test for CXXDefaultInitExpr

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for CXXScalarValueInit
Raphael Isemann [Thu, 16 Aug 2018 01:36:37 +0000 (01:36 +0000)]
[ASTImporter] Add test for CXXScalarValueInit

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for ForStmt and ContinueStmt
Raphael Isemann [Thu, 16 Aug 2018 01:35:47 +0000 (01:35 +0000)]
[ASTImporter] Add test for ForStmt and ContinueStmt

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

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

6 years ago[Driver] -print-target-triple and -print-effective-triple options
Petr Hosek [Thu, 16 Aug 2018 00:22:03 +0000 (00:22 +0000)]
[Driver] -print-target-triple and -print-effective-triple options

These can be used to print Clang target and effective triple.

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

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

6 years agoImplementation of nested loops in cxx_loop_proto
Emmett Neyman [Wed, 15 Aug 2018 23:05:48 +0000 (23:05 +0000)]
Implementation of nested loops in cxx_loop_proto

Summary: Extended `cxx_loop_proto` to have neste for loops. Modified `loop_proto_to_llvm` and `loop_proto_to_cxx` to handle the new protos. All protos have a set of statements designated as "inner loop" statements and a set of statements designated as "outer loop" statements.

Reviewers: morehouse, kcc

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits

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

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

6 years ago[ASTImporter] Add test for ArrayInitLoopExpr
Raphael Isemann [Wed, 15 Aug 2018 22:52:21 +0000 (22:52 +0000)]
[ASTImporter] Add test for ArrayInitLoopExpr

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

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

6 years ago[ASTImporter] Add test for ExprWithCleanups
Raphael Isemann [Wed, 15 Aug 2018 22:51:37 +0000 (22:51 +0000)]
[ASTImporter] Add test for ExprWithCleanups

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

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

6 years ago[Darwin Driver] Fix Simulator builtins and test cases
Chris Bieneman [Wed, 15 Aug 2018 22:50:06 +0000 (22:50 +0000)]
[Darwin Driver] Fix Simulator builtins and test cases

In r339807, I broke linking the builtins libraries for simulator targets, which itself was bad, but turns out it was all completely untested and marked with FIXME in the test suite.

This fixes all the test cases so they actually work, and fixes the bug I introduced in r339807.

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

6 years ago[ASTImporter] Add test for IfStmt
Raphael Isemann [Wed, 15 Aug 2018 22:36:58 +0000 (22:36 +0000)]
[ASTImporter] Add test for IfStmt

Reviewers: a.sidorin, hiraditya

Reviewed By: hiraditya

Subscribers: hiraditya, martong, cfe-commits

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

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

6 years agoAdd a newline to SourceLocation dump output
Stephen Kelly [Wed, 15 Aug 2018 20:32:06 +0000 (20:32 +0000)]
Add a newline to SourceLocation dump output

Summary:
Migrate callers to print().

dump() should be useful to downstreams and third parties as a debugging
aid.  Everyone trips up on this and creates confusing output.

Subscribers: cfe-commits

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

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

6 years ago[CStringSyntaxChecker] Reduces space around error message for strlcat.
David Carlier [Wed, 15 Aug 2018 20:09:52 +0000 (20:09 +0000)]
[CStringSyntaxChecker] Reduces space around error message for strlcat.

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

6 years agoRefactor Darwin driver to refer to runtimes by component
Chris Bieneman [Wed, 15 Aug 2018 20:09:38 +0000 (20:09 +0000)]
Refactor Darwin driver to refer to runtimes by component

Summary:
In r335809, Petr Hosek lays out support for what he calls the multiarch
runtimes layout. This new way of laying out the directories for runtime
libraries is workable for all platforms. Petr did some of the common
infrastructure and made it work for Linux and Fuscia. This patch is a
cleanup to the Darwin and MachO drivers to serve as a step toward
supporting it in Darwin.

This patch does primarily two things:
(1) Changes the APIs for how the Darwin driver refers to compiler-rt
libraries to use the component names, similar to how Linux and Fuscia do

(2) Removes some legacy functionality for supporting macOS versions
before 10.6. This functionality is effectively dead code because in
r339277, the support was removed from compiler-rt for generating the 10.4
runtime support library, and Xcode 10 (currently in beta) removes
libgcc_s.10.4 and libgcc_s.10.5 from the macOS SDK.

With this patch landed a subsequent patch can modify
MachO::AddLinkRuntimeLib to support the multiarch runtimes layout.

Worth noting: None of the removed functionality was actually covered in
the test suite. So no test case updates are required.

Reviewers: phosek, bruno, arphaman

Reviewed By: phosek, arphaman

Subscribers: cfe-commits

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

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

6 years ago[OPENMP] FIx processing of declare target variables.
Alexey Bataev [Wed, 15 Aug 2018 19:45:12 +0000 (19:45 +0000)]
[OPENMP] FIx processing of declare target variables.

The compiler may produce unexpected error messages/crashes when declare
target variables were used. Patch fixes problems with the declarations
marked as declare target to or link.

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

6 years agoclang-format: Change Google style wrt. the formatting of empty messages.
Daniel Jasper [Wed, 15 Aug 2018 19:07:55 +0000 (19:07 +0000)]
clang-format: Change Google style wrt. the formatting of empty messages.

Before:
  message Empty {
  }

After:
  message Empty {}

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

6 years ago[AST] Pack the unsigned of PackExpansionType into Type
Bruno Ricci [Wed, 15 Aug 2018 16:28:58 +0000 (16:28 +0000)]
[AST] Pack the unsigned of PackExpansionType into Type

The bit-fields of `Type` have enough space for
the `unsigned NumExpansions` of `PackExpansionType`

Reviewed By: erichkeane

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

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

6 years ago[AST] Pack the bits of TemplateSpecializationType into Type
Bruno Ricci [Wed, 15 Aug 2018 16:21:17 +0000 (16:21 +0000)]
[AST] Pack the bits of TemplateSpecializationType into Type

Type has enough space for two members of
TemplateSpecializationType. Mechanical patch.

Reviewed By: erichkeane

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

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

6 years agoUse .cpp extension for certain tests instead of .cc
Momchil Velikov [Wed, 15 Aug 2018 12:22:08 +0000 (12:22 +0000)]
Use .cpp extension for certain tests instead of .cc

The tests `CodeGen/aapcs[64]-align.cc` are not run since files with a `.cc`
suffix aren't recognisze as tests. This patch renames the above two files to
`.cpp`.

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

Comitting as obvious.

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

6 years agoFix ASTMatchersTraversalTest testcase compile on older compilers
David Green [Wed, 15 Aug 2018 10:39:43 +0000 (10:39 +0000)]
Fix ASTMatchersTraversalTest testcase compile on older compilers

Some versions of gcc, especially when invoked through ccache (-E), can have
trouble with raw string literals inside macros. This moves the string out of
the macro.

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

6 years agoSilence "unused variable" warning.
Richard Smith [Wed, 15 Aug 2018 01:06:30 +0000 (01:06 +0000)]
Silence "unused variable" warning.

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

6 years ago[analyzer] Add support for constructors of arguments.
Artem Dergachev [Wed, 15 Aug 2018 00:33:55 +0000 (00:33 +0000)]
[analyzer] Add support for constructors of arguments.

Once CFG-side support for argument construction contexts landed in r338436,
the analyzer could make use of them to evaluate argument constructors properly.

When evaluated as calls, constructors of arguments now use the variable region
of the parameter as their target. The corresponding stack frame does not yet
exist when the parameter is constructed, and this stack frame is created
eagerly.

Construction of functions whose body is unavailable and of virtual functions
is not yet supported. Part of the reason is the analyzer doesn't consistently
use canonical declarations o identify the function in these cases, and every
re-declaration or potential override comes with its own set of parameter
declarations. Also it is less important because if the function is not
inlined, there's usually no benefit in inlining the argument constructor.

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

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

6 years agoRemove obsolete comment
Stephen Kelly [Tue, 14 Aug 2018 21:34:29 +0000 (21:34 +0000)]
Remove obsolete comment

This related to the code as first checked in in r266292 ([ASTImporter]
Implement some expression-related AST node import., 2016-04-14).

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

6 years agoFix Stmt::ignoreImplicit
Stephen Kelly [Tue, 14 Aug 2018 21:33:28 +0000 (21:33 +0000)]
Fix Stmt::ignoreImplicit

Summary:
A CXXBindTemporaryExpr can appear inside an ImplicitCastExpr, and was
not ignored previously.

Fixes the case reported in PR37327.

Reviewers: rsmith, dblaikie, klimek

Subscribers: cfe-commits

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

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

6 years agoFix lit fatal errors about requiring a USE_Z3_SOLVER param
Reid Kleckner [Tue, 14 Aug 2018 21:15:57 +0000 (21:15 +0000)]
Fix lit fatal errors about requiring a USE_Z3_SOLVER param

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

6 years ago[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.
Artem Dergachev [Tue, 14 Aug 2018 21:10:46 +0000 (21:10 +0000)]
[CFG] [analyzer] Find argument constructors in CXXTemporaryObjectExprs.

CXXTemporaryObjectExpr is a sub-class of CXXConstructExpr. If it has arguments
that are structures passed by value, their respective constructors need to be
handled by providing a ConstructionContext, like for regular function calls and
for regular constructors.

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

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

6 years ago[analyzer] Add a test forgotten in r339088.
Artem Dergachev [Tue, 14 Aug 2018 21:06:30 +0000 (21:06 +0000)]
[analyzer] Add a test forgotten in r339088.

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

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

6 years ago[InlineAsm] Update the min-legal-vector-width function attribute based on inputs...
Craig Topper [Tue, 14 Aug 2018 20:21:05 +0000 (20:21 +0000)]
[InlineAsm] Update the min-legal-vector-width function attribute based on inputs and outputs to inline assembly

Summary:
Another piece of my ongoing to work for prefer-vector-width.

min-legal-vector-width will eventually be used by the X86 backend to know whether it needs to make 512 bits type legal when prefer-vector-width=256. If the user used inline assembly that passed in/out a 512-bit register, we need to make sure 512 bits are considered legal. Otherwise we'll get an assert failure when we try to wire up the inline assembly to the rest of the code.

This patch just checks the LLVM IR types to see if they are vectors and then updates the attribute based on their total width. I'm not sure if this is the best way to do this or if there's any subtlety I might have missed. So if anyone has other opinions on how to do this I'm open to suggestions.

Reviewers: chandlerc, rsmith, rnk

Reviewed By: rnk

Subscribers: eraman, cfe-commits

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

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

6 years agoSafeStack: Disable Darwin support
Vlad Tsyrklevich [Tue, 14 Aug 2018 19:50:41 +0000 (19:50 +0000)]
SafeStack: Disable Darwin support

Summary:
Darwin support does not appear to be used as evidenced by the fact that
the runtime has never supported non-trivial programs.

Reviewers: pcc, kubamracek

Reviewed By: pcc

Subscribers: cfe-commits, kcc

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

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

6 years ago[analyzer] Fix bots by removing new check-clang-analyzer commands from CHECK-ALL
George Karpenkov [Tue, 14 Aug 2018 18:55:34 +0000 (18:55 +0000)]
[analyzer] Fix bots by removing new check-clang-analyzer commands from CHECK-ALL

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

6 years ago[OPENMP] Fix processing of declare target construct.
Alexey Bataev [Tue, 14 Aug 2018 18:31:20 +0000 (18:31 +0000)]
[OPENMP] Fix processing of declare target construct.

The attribute marked as inheritable since OpenMP 5.0 supports it +
additional fixes to support new functionality.

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

6 years agoWe have in place support for parsing #pragma FENV_ACCESS, but that
Kevin P. Neal [Tue, 14 Aug 2018 17:06:56 +0000 (17:06 +0000)]
We have in place support for parsing #pragma FENV_ACCESS, but that
information is then discarded with a warning to the user that we don't
support it.

This patch gets us one step closer by getting the info down into the
AST in most cases.

Reviewed by: rsmith
Differential Revision: https://reviews.llvm.org/D49865

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

6 years agoRevert test commit
Kevin P. Neal [Tue, 14 Aug 2018 16:57:10 +0000 (16:57 +0000)]
Revert test commit

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

6 years agoTest commit
Kevin P. Neal [Tue, 14 Aug 2018 16:56:25 +0000 (16:56 +0000)]
Test commit

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

6 years ago[OpenCL] Add test for constant sampler argument
Sven van Haastregt [Tue, 14 Aug 2018 13:56:52 +0000 (13:56 +0000)]
[OpenCL] Add test for constant sampler argument

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

6 years ago[gnu-objc] Make selector order deterministic.
David Chisnall [Tue, 14 Aug 2018 10:05:25 +0000 (10:05 +0000)]
[gnu-objc] Make selector order deterministic.

Summary:
This probably fixes PR35277, though there may be other sources of
nondeterminism (this was the only case of iterating over a DenseMap).

It's difficult to provide a test case for this, because it shows up only
on systems with ASLR enabled.

Reviewers: rjmccall

Reviewed By: rjmccall

Subscribers: bmwiedemann, mgrang, cfe-commits

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

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

6 years agoAdd a stub mangling for ObjC selectors in the Microsoft ABI.
David Chisnall [Tue, 14 Aug 2018 10:04:36 +0000 (10:04 +0000)]
Add a stub mangling for ObjC selectors in the Microsoft ABI.

This mangling is used only for outlined SEH finally blocks, which have
internal linkage.

This fixes the failure of CodeGenObjC/2007-04-03-ObjcEH.m on builds with
expensive checks enabled, on Windows.  This test should probably be
specifying a triple: it currently picks up whatever the host environment
is using.  Unfortunately, I have no idea what it is trying to test,
because it contains no comments and predates Clang having working
Objective-C IR generation.

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

6 years ago[XRay][clang] Add more test cases of -fxray-modes= (NFC)
Dean Michael Berris [Tue, 14 Aug 2018 09:16:37 +0000 (09:16 +0000)]
[XRay][clang] Add more test cases of -fxray-modes= (NFC)

This confirms expectations for multiple values provided through the
driver when selecting specific modes and the order of appearance of
individual values for the `-fxray-modes=` flag.

This change just adds more test cases to an existing test file.

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

6 years ago[analyzer] Made a buildbot happy.
Kristof Umann [Tue, 14 Aug 2018 08:38:35 +0000 (08:38 +0000)]
[analyzer] Made a buildbot happy.

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

6 years ago[analyzer][UninitializedObjectChecker] Void pointers are casted back to their dynamic...
Kristof Umann [Tue, 14 Aug 2018 08:20:51 +0000 (08:20 +0000)]
[analyzer][UninitializedObjectChecker] Void pointers are casted back to their dynamic type in note message

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

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

6 years ago[X86] Lowering addus/subus intrinsics to native IR
Tomasz Krupa [Tue, 14 Aug 2018 08:01:38 +0000 (08:01 +0000)]
[X86] Lowering addus/subus intrinsics to native IR

Summary: This is the patch that lowers x86 intrinsics to native IR in order to enable optimizations.

Reviewers: craig.topper, spatel, RKSimon

Reviewed By: craig.topper

Subscribers: cfe-commits

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

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

6 years ago[CStringSyntaxChecker] Check strlcat sizeof check
David Carlier [Tue, 14 Aug 2018 05:12:53 +0000 (05:12 +0000)]
[CStringSyntaxChecker] Check strlcat sizeof check

- Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer.
- Advising the proper usual pattern.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

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

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

6 years agoRevert r339623 "Model type attributes as regular Attrs."
Reid Kleckner [Tue, 14 Aug 2018 01:55:37 +0000 (01:55 +0000)]
Revert r339623 "Model type attributes as regular Attrs."

This breaks compiling atlwin.h in Chromium. I'm sure the code is invalid
in some way, but we put a lot of work into accepting it, and I'm sure
rejecting it was not an intended consequence of this refactoring. :)

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

6 years agoMove test inputs into Inputs directory.
Richard Smith [Tue, 14 Aug 2018 00:18:48 +0000 (00:18 +0000)]
Move test inputs into Inputs directory.

We don't need a new ExpectedOutputs/ convention. Expected outputs are
just another form of test input.

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

6 years ago[CodeGen] Before returning a copy/dispose helper function, bitcast it to
Akira Hatanaka [Tue, 14 Aug 2018 00:15:42 +0000 (00:15 +0000)]
[CodeGen] Before returning a copy/dispose helper function, bitcast it to
a void pointer type.

This fixes a bug introduced in r339438.

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

6 years agoFix check strings in test/CodeGenObjC/arc-blocks.m in preperation for
Akira Hatanaka [Tue, 14 Aug 2018 00:15:41 +0000 (00:15 +0000)]
Fix check strings in test/CodeGenObjC/arc-blocks.m in preperation for
fixing a bug introduced in r339438.

Check the descriptor global variables in the IR at both -O0 and -O2.

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

6 years ago[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields
George Karpenkov [Mon, 13 Aug 2018 23:32:15 +0000 (23:32 +0000)]
[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields

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

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

6 years ago[analyzer] [NFC] Introduce separate targets for testing the analyzer: check-clang...
George Karpenkov [Mon, 13 Aug 2018 23:12:43 +0000 (23:12 +0000)]
[analyzer] [NFC] Introduce separate targets for testing the analyzer: check-clang-analyzer and check-clang-analyzer-z3

Current testing setup for analyzer tests with Z3 is rather inconvenient:

There's no way to run the analyzer tests separately (I use
LIT_FILTER=Analysis ninja check-clang, but a direct target is nicer).

When Clang is built with Z3 support, there's no way to *not* run tests
with Z3 solver, and this is often desired, as tests with Z3 solver take
a very long time.

This patch introduces two extra targets:

 - check-clang-analyzer
 - check-clang-analyzer-z3

which solve those problems.

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

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

6 years agoFix Clang warnings and bad #include filenames in r339595 and r339599.
Richard Smith [Mon, 13 Aug 2018 22:07:11 +0000 (22:07 +0000)]
Fix Clang warnings and bad #include filenames in r339595 and r339599.

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

6 years agoModel type attributes as regular Attrs.
Richard Smith [Mon, 13 Aug 2018 22:07:09 +0000 (22:07 +0000)]
Model type attributes as regular Attrs.

Specifically, AttributedType now tracks a regular attr::Kind rather than
having its own parallel Kind enumeration, and AttributedTypeLoc now
holds an Attr* instead of holding an ad-hoc collection of Attr fields.

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

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

6 years agoConvert if/else to a switch. NFC.
Akira Hatanaka [Mon, 13 Aug 2018 20:59:57 +0000 (20:59 +0000)]
Convert if/else to a switch. NFC.

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

6 years ago[OPENMP] Fix emission of the loop doacross constructs.
Alexey Bataev [Mon, 13 Aug 2018 19:04:24 +0000 (19:04 +0000)]
[OPENMP] Fix emission of the loop doacross constructs.

The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.

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