]> granicus.if.org Git - clang/log
clang
7 years agoChange remaining references to lit.util.capture to use subprocess.check_output.
David L. Jones [Thu, 6 Jul 2017 21:46:47 +0000 (21:46 +0000)]
Change remaining references to lit.util.capture to use subprocess.check_output.

Summary:
The capture() function was removed in r306625. This should fix PGO breakages
reported by Michael Zolotukhin.

Reviewers: mzolotukhin

Subscribers: sanjoy, llvm-commits

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

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

7 years agoReject attempts to build a module without -fmodules, rather than silently doing weird...
Richard Smith [Thu, 6 Jul 2017 21:05:56 +0000 (21:05 +0000)]
Reject attempts to build a module without -fmodules, rather than silently doing weird things.

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

7 years agoAllow CompilerInvocations to generate .d files.
Sterling Augustine [Thu, 6 Jul 2017 21:02:52 +0000 (21:02 +0000)]
Allow CompilerInvocations to generate .d files.

Summary:
Most clang tools should ignore the -M
family of options because one wouldn't want them
to generate a new dependency (.d) file. However,
some tools may want this dependency file. This
patch creates a mechanism for them to do this.

This implementation just plumbs a boolean down
several layers of calls. Each of the modified calls
has several call sites, and so a single member
variable or new API entry point won't work.

An alternative would be to write a function to filter
the -M family of arguments out of CC1Args, and have
each caller call that function by hand before calling
newInvocation, Invocation::run, or buildAstFromCodeWithArgs.
This is a more complicated and error-prone solution.
Why burden all the callers to remember to use
this function?

But I could rewrite this patch to use that method if
that is deemed more appropriate.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

7 years ago [Objective-C] Fix non-determinism in clang
Mandeep Singh Grang [Thu, 6 Jul 2017 18:49:57 +0000 (18:49 +0000)]
 [Objective-C] Fix non-determinism in clang

Summary: Iteration of the unordered Ivars causes objc-modern-metadata-visibility.mm (uncovered by reverse iterating SmallPtrSet).

Reviewers: dblaikie, davide, rsmith

Reviewed By: dblaikie

Subscribers: cfe-commits, llvm-commits

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

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

7 years agoThis reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
Sjoerd Meijer [Thu, 6 Jul 2017 16:37:31 +0000 (16:37 +0000)]
This reverts r305820 (ARMv.2-A FP16 vector intrinsics) because it shows
problems in testing, see comments in D34161 for some more details.
A fix is in progres in D35011, but a revert seems better now as the fix will
probably take some more time to land.

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

7 years ago[OpenMP] Extend CLANG target options with device offloading kind.
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:22:21 +0000 (16:22 +0000)]
[OpenMP] Extend CLANG target options with device offloading kind.

Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld

Reviewed By: hfinkel

Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits

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

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

7 years ago[OpenMP] Customize CUDA-based tool chain selection
Gheorghe-Teodor Bercea [Thu, 6 Jul 2017 16:08:15 +0000 (16:08 +0000)]
[OpenMP] Customize CUDA-based tool chain selection

Summary: This patch provides a generic way of selecting CUDA based tool chains as host-device pairs.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: Hahnfeld

Subscribers: rengolin, cfe-commits

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

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

7 years ago[clang-format] Add TextProto language name, NFC
Krasimir Georgiev [Thu, 6 Jul 2017 14:39:39 +0000 (14:39 +0000)]
[clang-format] Add TextProto language name, NFC

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

7 years ago[clang-format] Add space between a message field key and the opening bracket in proto...
Krasimir Georgiev [Thu, 6 Jul 2017 13:58:29 +0000 (13:58 +0000)]
[clang-format] Add space between a message field key and the opening bracket in proto messages

Summary:
This patch updates the formatting of message fields of type `a{...}` to `a {...}`
for proto messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

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

7 years ago[OpenCL] Test on image access modifiers and image type can only be a type of a functi...
Egor Churaev [Thu, 6 Jul 2017 07:06:11 +0000 (07:06 +0000)]
[OpenCL] Test on image access modifiers and image type can only be a type of a function argument.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: yaxunl, cfe-commits, bader

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

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

7 years ago[modules ts] Do not emit strong function definitions from the module interface unit...
Richard Smith [Thu, 6 Jul 2017 00:30:00 +0000 (00:30 +0000)]
[modules ts] Do not emit strong function definitions from the module interface unit in every user.

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

7 years ago[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS...
Richard Smith [Thu, 6 Jul 2017 00:29:13 +0000 (00:29 +0000)]
[cxx_status] Update link to Modules TS to latest working draft. Fix Coroutines TS flag to work if copy-pasted.

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

7 years agoFix test case in pre-C++11 mode; address Aaron Ballman's code review.
Douglas Gregor [Wed, 5 Jul 2017 21:12:37 +0000 (21:12 +0000)]
Fix test case in pre-C++11 mode; address Aaron Ballman's code review.

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

7 years agoFix one more reference to lit.util.capture()
Michael Zolotukhin [Wed, 5 Jul 2017 21:06:11 +0000 (21:06 +0000)]
Fix one more reference to lit.util.capture()

The capture method was removed in r306643.

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

7 years agoCope with Range-v3's CONCEPT_REQUIRES idiom
Douglas Gregor [Wed, 5 Jul 2017 20:20:15 +0000 (20:20 +0000)]
Cope with Range-v3's CONCEPT_REQUIRES idiom

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

7 years agoCustomize the SFINAE diagnostics for enable_if to provide the failed condition.
Douglas Gregor [Wed, 5 Jul 2017 20:20:14 +0000 (20:20 +0000)]
Customize the SFINAE diagnostics for enable_if to provide the failed condition.

When enable_if disables a particular overload resolution candidate,
rummage through the enable_if condition to find the specific condition
that caused the failure. For example, if we have something like:

    template<
      typename Iter,
      typename = std::enable_if_t<Random_access_iterator<Iter> &&
                                  Comparable<Iterator_value_type<Iter>>>>
    void mysort(Iter first, Iter last) {}

and we call "mysort" with "std::list<int>" iterators, we'll get a
diagnostic saying that the "Random_access_iterator<Iter>" requirement
failed. If we call "mysort" with
"std::vector<something_not_comparable>", we'll get a diagnostic saying
that the "Comparable<...>" requirement failed.

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

7 years agoAdd docs for -foptimization-record-file=
Brian Gesiak [Wed, 5 Jul 2017 19:55:51 +0000 (19:55 +0000)]
Add docs for -foptimization-record-file=

Summary: The Clang option was previously not included in the User's Manual.

Reviewers: anemet, davidxl, hfinkel

Reviewed By: hfinkel

Subscribers: cfe-commits

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

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

7 years ago[Sema] Don't allow -Wunguarded-availability to be silenced with redecls
Erik Pilkington [Wed, 5 Jul 2017 17:08:56 +0000 (17:08 +0000)]
[Sema] Don't allow -Wunguarded-availability to be silenced with redecls

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

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

7 years agoAddress comments that escaped D33333
Erich Keane [Wed, 5 Jul 2017 16:43:45 +0000 (16:43 +0000)]
Address comments that escaped D33333

Patch By: Jen Yu

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

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

7 years ago[SystemZ] Simplify handling of ISA revisions
Ulrich Weigand [Wed, 5 Jul 2017 13:19:47 +0000 (13:19 +0000)]
[SystemZ] Simplify handling of ISA revisions

This moves determination of the ISA revision from the CPU name to
one single place, removing a bunch of duplicated code.  It also
makes the supported ISA revisions available as feature strings.

No functional change.

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

7 years ago[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:37 +0000 (12:57 +0000)]
[driver][mips] Use AddTargetFeature to check arguments and add feature flags. NFC

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

7 years ago[driver][mips] Remove redundant curly brackets. NFC
Simon Atanasyan [Wed, 5 Jul 2017 12:57:32 +0000 (12:57 +0000)]
[driver][mips] Remove redundant curly brackets. NFC

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

7 years ago[clang-format] Fix an uninitialized memory access
Krasimir Georgiev [Wed, 5 Jul 2017 12:24:01 +0000 (12:24 +0000)]
[clang-format] Fix an uninitialized memory access

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

7 years agoAdd const to reference arguments of Diagnostic ctor
Alexander Kornienko [Wed, 5 Jul 2017 11:45:09 +0000 (11:45 +0000)]
Add const to reference arguments of Diagnostic ctor

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

7 years agoFix invalid warnings for header guards in preambles
Erik Verbruggen [Wed, 5 Jul 2017 09:44:07 +0000 (09:44 +0000)]
Fix invalid warnings for header guards in preambles

Fixes https://bugs.llvm.org/show_bug.cgi?id=33574

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

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

7 years ago[modules ts] Improve merging of module-private declarations.
Richard Smith [Wed, 5 Jul 2017 07:47:11 +0000 (07:47 +0000)]
[modules ts] Improve merging of module-private declarations.

These cases occur frequently for declarations in the global module (above the
module-declaration) in a Modules TS module interface. When we merge a
definition from another module into such a module-private definition, ensure
that we transitively make everything lexically within that definition visible
to that translation unit.

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Wed, 5 Jul 2017 05:37:45 +0000 (05:37 +0000)]
fix trivial typos in comments; NFC

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

7 years ago[AMDGPU] Fix size and alignment of size_t and pointer types
Yaxun Liu [Wed, 5 Jul 2017 04:58:24 +0000 (04:58 +0000)]
[AMDGPU] Fix size and alignment of size_t and pointer types

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

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

7 years ago[modules ts] Declarations from a module interface unit are only visible outside
Richard Smith [Wed, 5 Jul 2017 01:42:07 +0000 (01:42 +0000)]
[modules ts] Declarations from a module interface unit are only visible outside
the module if declared in an export block.

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

7 years ago[AMDGPU] Fix regressions on mesa/clover with libclc due to address space
Yaxun Liu [Tue, 4 Jul 2017 19:57:18 +0000 (19:57 +0000)]
[AMDGPU] Fix regressions on mesa/clover with libclc due to address space

Currently AMDGPUTargetInfo does not initialize AddrSpaceMap in constructor, which causes regressions in mesa/clover with libclc.

This patch fixes that.

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

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

7 years agoEnable LLVM asan support for NetBSD/amd64
Kamil Rytarowski [Tue, 4 Jul 2017 19:55:56 +0000 (19:55 +0000)]
Enable LLVM asan support for NetBSD/amd64

Summary:
Enable LLVM asan sanitizer for NetBSD/amd64.

Don't generate -ldl for dlopen(3)-like functions on NetBSD.
These features are available in libc on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, eugenis, kcc, dim

Reviewed By: dim

Subscribers: #clang, #sanitizers

Tags: #clang, #sanitizers

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

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

7 years agoclang-format: [JS] space between pseudo keywords and template literals.
Martin Probst [Tue, 4 Jul 2017 15:30:21 +0000 (15:30 +0000)]
clang-format: [JS] space between pseudo keywords and template literals.

Summary:
Before:
  yield`foo`;

After:
  yield `foo`;

This reinstates commit 71d3b5cd91 / r307023 and fixes the logic by
introducing an explicit table of JavaScript pseudo keywords.

Reviewers: djasper

Subscribers: klimek

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

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

7 years ago[index] Index nested name qualifiers in a forward declaration of a
Alex Lorenz [Tue, 4 Jul 2017 12:50:53 +0000 (12:50 +0000)]
[index] Index nested name qualifiers in a forward declaration of a
class template specialization

rdar://33122110

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

7 years ago[OpenCL] Rename err_opencl_enqueue_kernel_expected_type
Joey Gouly [Tue, 4 Jul 2017 11:50:23 +0000 (11:50 +0000)]
[OpenCL] Rename err_opencl_enqueue_kernel_expected_type

Rename err_opencl_enqueue_kernel_expected_type so that other builtins
can use the same diagnostic.

https://reviews.llvm.org/D34948

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

7 years ago[CodeGen] Check key function for typeinfo import
Shoaib Meenai [Tue, 4 Jul 2017 01:02:19 +0000 (01:02 +0000)]
[CodeGen] Check key function for typeinfo import

If the imported class does not have a key function, we should emit its
typeinfo locally instead of attempting to import it.

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

7 years ago[Sema] Make BreakContinueFinder handle nested loops.
Eli Friedman [Tue, 4 Jul 2017 00:52:24 +0000 (00:52 +0000)]
[Sema] Make BreakContinueFinder handle nested loops.

We don't care about break or continue statements that aren't
associated with the current loop, so make sure the visitor
doesn't find them.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32648 .

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

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

7 years ago[clang] Implement -Wcast-qual for C++
Roman Lebedev [Mon, 3 Jul 2017 17:59:22 +0000 (17:59 +0000)]
[clang] Implement -Wcast-qual for C++

Summary:
This way, the behavior of that warning flag
more closely resembles that of GCC.

Do note that there is at least one false-negative (see FIXME in tests).

Fixes PR4802.

Testing:
```
ninja check-clang-sema check-clang-semacxx
```

Reviewers: dblaikie, majnemer, rnk

Reviewed By: dblaikie, rnk

Subscribers: mclow.lists, cfe-commits, alexfh, rnk

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

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

7 years agoRevert "clang-format: [JS] space between pseudo keywords and template literals."
Martin Probst [Mon, 3 Jul 2017 15:31:28 +0000 (15:31 +0000)]
Revert "clang-format: [JS] space between pseudo keywords and template literals."

This reverts commit 71d3b5cd916106005ef23467e3f6c7fbca7bc499.

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

7 years ago[clang-format] Support text proto messages
Krasimir Georgiev [Mon, 3 Jul 2017 15:05:14 +0000 (15:05 +0000)]
[clang-format] Support text proto messages

Summary: This patch adds support for textual protocol buffer messages.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek, mgorny

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

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

7 years agoclang-format: [JS] space between pseudo keywords and template literals.
Martin Probst [Mon, 3 Jul 2017 14:29:13 +0000 (14:29 +0000)]
clang-format: [JS] space between pseudo keywords and template literals.

Summary:
Before:
    yield`foo`;

After:
    yield `foo`;

Reviewers: djasper

Subscribers: klimek

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

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

7 years ago[index] Remove 'implicit' role for message sends in implicit ObjC
Alex Lorenz [Mon, 3 Jul 2017 10:34:46 +0000 (10:34 +0000)]
[index] Remove 'implicit' role for message sends in implicit ObjC
property references

rdar://32375673

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

7 years agoAdd a fixit for -Wobjc-protocol-property-synthesis
Alex Lorenz [Mon, 3 Jul 2017 10:12:24 +0000 (10:12 +0000)]
Add a fixit for -Wobjc-protocol-property-synthesis

rdar://32132756

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

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Mon, 3 Jul 2017 08:49:44 +0000 (08:49 +0000)]
fix trivial typos in comments; NFC

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

7 years agofix trivial typos in comments; NFC
Hiroshi Inoue [Sun, 2 Jul 2017 06:12:49 +0000 (06:12 +0000)]
fix trivial typos in comments; NFC

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

7 years agoAdd an option group for deprecated warnings. Add the removed
Joerg Sonnenberger [Sat, 1 Jul 2017 21:36:21 +0000 (21:36 +0000)]
Add an option group for deprecated warnings. Add the removed
-fslp-vectorize-aggressive and -fno-slp-vectorize-aggressive flags back
under this group and test for the warning. Document the future removal
in the ReleaseNotes.

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

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

7 years ago[modules] Teach clang how to merge typedef over anonymous structs in C mode.
Vassil Vassilev [Sat, 1 Jul 2017 20:44:49 +0000 (20:44 +0000)]
[modules] Teach clang how to merge typedef over anonymous structs in C mode.

In C mode clang fails to merge the textually included definition with the one imported from a module. The C lookup rules fail to find the imported definition because its linkage is internal in non C++ mode.

This patch reinstates some of the ODR merging rules for typedefs of anonymous tags for languages other than C++.

Patch by Raphael Isemann and me (D34510).

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

7 years ago[Bash-autocompletion] Add support for older bash version.
Yuka Takahashi [Sat, 1 Jul 2017 18:32:55 +0000 (18:32 +0000)]
[Bash-autocompletion] Add support for older bash version.

Summary:
OS X seems to use older bash version which doesn't suport
_init_completion and compopt, so add support for this.

Reviewers: ruiu, v.g.vassilev, teemperor

Subscribers: cfe-commits

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

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

7 years ago[Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME
Yuka Takahashi [Sat, 1 Jul 2017 16:30:02 +0000 (16:30 +0000)]
[Bash-completion] Fixed a bug that ~ doesn't expanded to $HOME

Summary: `~/build/bin/clang -f[tab]` was executed without ~ expanded to $HOME, so changed this by expanding ~ to path using eval.

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

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

7 years ago[OpenMP] Fix mapping of scalars for combined directives
Jonas Hahnfeld [Sat, 1 Jul 2017 10:40:50 +0000 (10:40 +0000)]
[OpenMP] Fix mapping of scalars for combined directives

Combined directives like 'target parallel' have two captured statements.
Sema has to check the right one from the right direction.

Previously, Sema::IsOpenMPCapturedByRef would return false for mapped
scalars on combined directives. This results in a wrong signature of
the outlined function which triggers an assertion:
void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.

Fixes PR30975 (and PR31985). New function was taken from clang-ykt.

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

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

7 years agofix trivial typos; NFC
Hiroshi Inoue [Sat, 1 Jul 2017 08:46:43 +0000 (08:46 +0000)]
fix trivial typos; NFC

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

7 years agoChanged Opts.EABIVersion type string to llvm::EABI enum class
Yuka Takahashi [Sat, 1 Jul 2017 07:57:23 +0000 (07:57 +0000)]
Changed Opts.EABIVersion type string to llvm::EABI enum class

Summary:
Changed EABIVersion type from string to llvm::EABI.
It seems it was just a typo and this is intended implementation.

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

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

7 years agoUn-revert "[Driver] Add -fdiagnostics-hotness-threshold"
Brian Gesiak [Sat, 1 Jul 2017 05:45:26 +0000 (05:45 +0000)]
Un-revert "[Driver] Add -fdiagnostics-hotness-threshold"

Summary:
Un-revert https://reviews.llvm.org/D34868, but with a slight tweak to the
documentation to fix an error -- I had used the wrong syntax for a link.

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

7 years agoRevert "[Driver] Add -fdiagnostics-hotness-threshold"
Brian Gesiak [Sat, 1 Jul 2017 04:54:53 +0000 (04:54 +0000)]
Revert "[Driver] Add -fdiagnostics-hotness-threshold"

Summary:
The commit caused a documentation breakage.

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

7 years ago[Driver] Add -fdiagnostics-hotness-threshold
Brian Gesiak [Sat, 1 Jul 2017 04:44:38 +0000 (04:44 +0000)]
[Driver] Add -fdiagnostics-hotness-threshold

Summary:
Depends on https://reviews.llvm.org/D34867.

Add a Clang frontend option to enable optimization remark hotness
thresholds, which were added to LLVM in https://reviews.llvm.org/D34867.
This prevents diagnostics that do not meet a minimum hotness
threshold from being output. When generating optimization remarks for large
codebases with a ton of cold code paths, this option can be used
to limit the optimization remark output at a reasonable size.
Discussion of this change can be read here:
http://lists.llvm.org/pipermail/llvm-dev/2017-June/114377.html

Reviewers: anemet, davidxl, hfinkel

Reviewed By: anemet

Subscribers: fhahn, cfe-commits

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

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

7 years agoFix indentation.
Akira Hatanaka [Sat, 1 Jul 2017 04:37:54 +0000 (04:37 +0000)]
Fix indentation.

This is an attempt to fix a failing bot:

http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror

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

7 years agoUpdate clang support for -mexecute-only/-mpure-code for backend change to use subtarg...
Eric Christopher [Sat, 1 Jul 2017 02:55:23 +0000 (02:55 +0000)]
Update clang support for -mexecute-only/-mpure-code for backend change to use subtarget feature rather than command line option.

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

7 years ago[ODRHash] Revert r305104 - Skip inline namespaces when hashing.
Richard Trieu [Sat, 1 Jul 2017 02:00:05 +0000 (02:00 +0000)]
[ODRHash] Revert r305104 - Skip inline namespaces when hashing.

Test inline namespaces and handle them in the ODR hash again.

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

7 years ago[Driver] Check that the iOS deployment target is iOS 10 or earlier if
Akira Hatanaka [Sat, 1 Jul 2017 00:57:52 +0000 (00:57 +0000)]
[Driver] Check that the iOS deployment target is iOS 10 or earlier if
the target is 32-bit.

The following changes are made to the driver since 32-bit apps do not
run on iOS 11 or later:

- If the deployment target is set explicitly, either with a command-line
  option or an environment variable, the driver should report an error
  if the version is greater than iOS 10.

- In the case where the deployment target is not set explicitly and the
  default is inferred from the target triple or SDK version, it should
  use a maximum default of iOS 10.99.99.

rdar://problem/32230613

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

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

7 years ago[Modules] Implement ODR-like semantics for tag types in C/ObjC
Bruno Cardoso Lopes [Sat, 1 Jul 2017 00:06:47 +0000 (00:06 +0000)]
[Modules] Implement ODR-like semantics for tag types in C/ObjC

Allow ODR for ObjC/C in the sense that we won't keep more that
one definition around (merge them). However, ensure the decl
pass the structural compatibility check in C11 6.2.7/1, for that,
reuse the structural equivalence checks used by the ASTImporter.

Few other considerations:
- Create error diagnostics for tag types mismatches and thread
them into the structural equivalence checks.
- Note that by doing this we only support redefinition between types
that are considered "compatible types" by C.

This is mixed approach of the suggestions discussed in
http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html

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

rdar://problem/31909368

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

7 years agoChange enumerator default linkage type for C
Bruno Cardoso Lopes [Sat, 1 Jul 2017 00:06:27 +0000 (00:06 +0000)]
Change enumerator default linkage type for C

Redeclaration lookup should never find hidden enumerators in C, because
they do not have linkage (C11 6.2.2/6)

The linkage of an enumerator should be VisibleNoLinkage, and
isHiddenDeclarationVisible should be checking hasExternalFormalLinkage.

This is was reviewed as part of D31778, but splitted into a different
commit for clarity.

rdar://problem/31909368

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

7 years agoFix PR 33189: Clang assertion on template destructor declaration
Hubert Tong [Fri, 30 Jun 2017 22:43:54 +0000 (22:43 +0000)]
Fix PR 33189: Clang assertion on template destructor declaration

Summary:
This patch aims to fix the bug reported at
https://bugs.llvm.org/show_bug.cgi?id=33189. Clang hits an assertion
when a template destructor declaration is present. This is caused by
later processing that does not expect to encounter a template when
looking at a destructor. The resolution is to treat the destructor as
being not declared when later processing is interested in the properties
of the destructor of a class.

Reviewers: rcraik, hubert.reinterpretcast, aaron.ballman, rsmith

Reviewed By: rsmith

Subscribers: rsmith, cfe-commits

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

Patch by Kuang He!

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

7 years ago[ODRHash] Support Type TemplateArgument
Richard Trieu [Fri, 30 Jun 2017 22:40:33 +0000 (22:40 +0000)]
[ODRHash] Support Type TemplateArgument

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

7 years agoReinstate "Load lazily the template specialization in multi-module setups."
Vassil Vassilev [Fri, 30 Jun 2017 22:40:17 +0000 (22:40 +0000)]
Reinstate "Load lazily the template specialization in multi-module setups."

It was reverted in r305460 but the issue appears to only break our self-host
libcxx modules bot. Reapplying it will give us a chance to get a reproducer and
fix the issue.

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

7 years ago[Parse] Use normalized attr name for late-parsing checks.
George Burgess IV [Fri, 30 Jun 2017 22:33:24 +0000 (22:33 +0000)]
[Parse] Use normalized attr name for late-parsing checks.

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

7 years ago[Profile] Do not assign counters to functions without bodies
Vedant Kumar [Fri, 30 Jun 2017 21:02:14 +0000 (21:02 +0000)]
[Profile] Do not assign counters to functions without bodies

The root cause of the issues reported in D32406 and D34680 is that clang
instruments functions without bodies. Make it stop doing that, and also
teach it how to use old (incorrectly generated) profiles without
crashing.

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

7 years agoFix a typo. NFC.
Vedant Kumar [Fri, 30 Jun 2017 21:02:14 +0000 (21:02 +0000)]
Fix a typo. NFC.

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

7 years agoFix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR
Richard Smith [Fri, 30 Jun 2017 20:57:39 +0000 (20:57 +0000)]
Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR

This is a short-term fix for PR33650 aimed to get the modules build bots green again.

Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR
macros to try to locally specialize a global template for a global type. That's
not how C++ works.

Instead, we now centrally define how to format vectors of fundamental types and
of string (std::string and StringRef). We use flow formatting for the former
cases, since that's the obvious right thing to do; in the latter case, it's
less clear what the right choice is, but flow formatting is really bad for some
cases (due to very long strings), so we pick block formatting. (Many of the
cases that were using flow formatting for strings are improved by this change.)

Other than the flow -> block formatting change for some vectors of strings,
this should result in no functionality change.

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

Corresponding LLVM change is r306878.

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

7 years agoclang-format: add options to merge empty record body
Francois Ferrand [Fri, 30 Jun 2017 20:25:55 +0000 (20:25 +0000)]
clang-format: add options to merge empty record body

Summary:
This patch introduces a few extra BraceWrapping options, similar to
`SplitEmptyFunction`, to allow merging empty 'record' bodies (e.g.
class, struct, union and namespace):
* SplitEmptyClass
* SplitEmptyStruct
* SplitEmptyUnion
* SplitEmptyNamespace

The `SplitEmptyFunction` option name has also been simplified/
shortened (from `SplitEmptyFunctionBody`).

These options are helpful when the correspond AfterXXX option is
enabled, to allow merging the empty record:

  class Foo
  {};

In addition, this fixes an unexpected merging of short records, when
the AfterXXXX options are used, which caused to be formatted like
this:

  class Foo
  { void Foo(); };

This is now properly formatted as:

  class Foo
  {
     void Foo();
  };

Reviewers: djasper, krasimir

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

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

7 years ago[clang-rename] Just return instead of calling exit(3) from main.
Benjamin Kramer [Fri, 30 Jun 2017 20:24:32 +0000 (20:24 +0000)]
[clang-rename] Just return instead of calling exit(3) from main.

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

7 years agoclang-format: Do not binpack initialization lists
Francois Ferrand [Fri, 30 Jun 2017 20:00:02 +0000 (20:00 +0000)]
clang-format: Do not binpack initialization lists

Summary:
This patch tries to avoid binpacking when initializing lists/arrays, to allow things like:

  static int types[] = {
      registerType1(),
      registerType2(),
      registerType3(),
  };
  std::map<int, std::string> x = {
      { 0, "foo fjakfjaklf kljj" },
      { 1, "bar fjakfjaklf kljj" },
      { 2, "stuff fjakfjaklf kljj" },
  };

This is similar to how dictionnaries are formatted, and actually corresponds to the same conditions: when initializing a container (and not just 'calling' a constructor).

Such formatting involves 2 things:
* Line breaks around the content of the block. This can be forced by adding a comma or comment after the last element
* Elements should not be binpacked

This patch considers the block is an initializer list if it either ends with a comma, or follows an assignment, which seems to provide a sensible approximation.

Reviewers: krasimir, djasper

Reviewed By: djasper

Subscribers: malcolm.parsons, klimek, cfe-commits

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

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

7 years ago[ORE] Use LLVM's "diagnostics hotness" spelling
Brian Gesiak [Fri, 30 Jun 2017 19:37:11 +0000 (19:37 +0000)]
[ORE] Use LLVM's "diagnostics hotness" spelling

Summary:
Depends on https://reviews.llvm.org/D34864.

To unify Clang and LLVM's spelling of "diagnostic[s] hotness", use the
new "diagnostics hotness" spelling in LLVM, which was added in
https://reviews.llvm.org/D34864.

Reviewers: anemet, davidxl

Reviewed By: anemet

Subscribers: cfe-commits

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

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

7 years ago[X86] Add RDRND feature to Goldmont. Add MOVBE to all Atom CPUs.
Craig Topper [Fri, 30 Jun 2017 18:14:04 +0000 (18:14 +0000)]
[X86] Add RDRND feature to Goldmont. Add MOVBE to all Atom CPUs.

Diffential Revision: https://reviews.llvm.org/D34842

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

7 years ago[X86] Add a break to the last case of a few switches to prevent accidents in the...
Craig Topper [Fri, 30 Jun 2017 18:14:02 +0000 (18:14 +0000)]
[X86] Add a break to the last case of a few switches to prevent accidents in the future. NFC

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

7 years ago[X86] Move all atom CPUs to the same section of the switch and use fallthroughs like...
Craig Topper [Fri, 30 Jun 2017 18:14:01 +0000 (18:14 +0000)]
[X86] Move all atom CPUs to the same section of the switch and use fallthroughs like we do for other CPU generations. NFC

This is prep work to add MOVBE to all Atom CPUs. This instruction didn't come in to the Nehalem/Westmere/SandyBridge/etc. line until later so there's no natural place to overlap the Atom CPUs into that part of the switch.

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

7 years agoAttempt to fix the linkage error caused by r306840 on the mingw-RA-on-linux bot
Alex Lorenz [Fri, 30 Jun 2017 17:15:48 +0000 (17:15 +0000)]
Attempt to fix the linkage error caused by r306840 on the mingw-RA-on-linux bot

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

7 years agoMove ClassReplacements.cpp test from clang-rename tests to the
Alex Lorenz [Fri, 30 Jun 2017 16:58:36 +0000 (16:58 +0000)]
Move ClassReplacements.cpp test from clang-rename tests to the
clang-apply-replacements tests

The ClassReplacements.cpp test in the clang-rename tests uses
clang-apply-replacements. I moved it back to the clang-tools-extra repository
for now to ensure that the clang-rename tests can pass when clang is compiled
without clang-tools-extra.

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

7 years agoUse add_clang_unittest in the CMakeLists.txt for the moved unittest
Alex Lorenz [Fri, 30 Jun 2017 16:43:00 +0000 (16:43 +0000)]
Use add_clang_unittest in the CMakeLists.txt for the moved unittest

The unittest was moved in r306840

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

7 years ago[refactor] Move clang-rename into the clang repository
Alex Lorenz [Fri, 30 Jun 2017 16:36:09 +0000 (16:36 +0000)]
[refactor] Move clang-rename into the clang repository

The core engine of clang-rename will be used for local and global renames in the
new refactoring engine, as mentioned in
http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html.

The clang-rename tool is still supported but might get deprecated in the future.

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

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

7 years ago[objc] Don't require null-check and don't emit memset when result is ignored for...
Kuba Mracek [Fri, 30 Jun 2017 16:28:15 +0000 (16:28 +0000)]
[objc] Don't require null-check and don't emit memset when result is ignored for struct-returning method calls [clang part]

This fixes an issue with the emission of lifetime markers for struct-returning Obj-C msgSend calls. When the result of a struct-returning call is ignored, the temporary storage is only marked with lifetime markers in one of the two branches of the nil-receiver-check. The check is, however, not required when the result is unused. If we still need to emit the check (due to consumer arguments), let's not emit the memset to zero out the result if it's unused. This fixes a use-after-scope false positive with AddressSanitizer.

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

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

7 years ago[MS] Test that deleting destructor thunks are not exported
Reid Kleckner [Fri, 30 Jun 2017 16:12:14 +0000 (16:12 +0000)]
[MS] Test that deleting destructor thunks are not exported

The MSVC linker emits the LNK4102 warning if they are.

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

7 years agoRevert "[CodeGen] Propagate dllexport to thunks"
Reid Kleckner [Fri, 30 Jun 2017 16:11:49 +0000 (16:11 +0000)]
Revert "[CodeGen] Propagate dllexport to thunks"

This reverts r306770, it causes LNK4102 warnings in MSVC builds.

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

7 years agoDriver: fix option declaration
Saleem Abdulrasool [Fri, 30 Jun 2017 15:15:39 +0000 (15:15 +0000)]
Driver: fix option declaration

The option is a "joined" argument.  Fix silly copy-paste error.  This
allows the parsing to work at runtime.

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

7 years agoDriver: honor -nostdinc and -isystem-after on CrossWindows
Saleem Abdulrasool [Fri, 30 Jun 2017 15:15:38 +0000 (15:15 +0000)]
Driver: honor -nostdinc and -isystem-after on CrossWindows

This changes CrossWindows to look for -nostdinc instead of -nostdlibinc.
In addition, fixes a bug where -isystem-after options would be dropped
when called with -nostdinc.

Patch by Dave Lee!

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

7 years ago[OpenCL] Add function name to extension diagnostic
Joey Gouly [Fri, 30 Jun 2017 14:23:01 +0000 (14:23 +0000)]
[OpenCL] Add function name to extension diagnostic

Slightly improve the diagnostic by including the function name.

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

7 years ago[OPENMP] Initial support for taskloop reductions.
Alexey Bataev [Fri, 30 Jun 2017 13:50:13 +0000 (13:50 +0000)]
[OPENMP] Initial support for taskloop reductions.

Add sema/parsupping ort for taskloop [simd] reductions.

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

7 years ago[Driver] Actually report errors during parsing instead of stopping when there's an...
Benjamin Kramer [Fri, 30 Jun 2017 13:21:27 +0000 (13:21 +0000)]
[Driver] Actually report errors during parsing instead of stopping when there's an error somewhere.

This is a more principled version of r303756. That change was both very
brittle about the state of the Diags object going into the driver and
also broke tooling in funny ways.

In particular it prevented tools from capturing diagnostics properly and
made the compilation database logic fail to provide arguments to the
tool, falling back to scanning directories for JSON files.

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

7 years agoAmbiguity might be also uninitialized. Use llvm::Optional.
Vassil Vassilev [Fri, 30 Jun 2017 09:25:43 +0000 (09:25 +0000)]
Ambiguity might be also uninitialized. Use llvm::Optional.

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

7 years agoARMV8-A archkind and target defines helper functions
Sjoerd Meijer [Fri, 30 Jun 2017 08:07:34 +0000 (08:07 +0000)]
ARMV8-A archkind and target defines helper functions

This introduces helper functions that set target defines for different ARMV8-A
architecture kinds. It fixes an issue that the v8.1 define ARM_FEATURE_QRDMX
was not set for v8.2. These helper functions make things more “scalable” if we
want to add ARMv8.3 at some point, and a cleanup has been done to hold the
architecture kind in one variable (instead of one for each).

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

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

7 years agoFix heap use after free introduced by r306769.
Daniel Jasper [Fri, 30 Jun 2017 08:02:37 +0000 (08:02 +0000)]
Fix heap use after free introduced by r306769.

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

7 years agoFold exception-warnings.cpp into warn-throw-out-noexcept-func.cpp
Stephan Bergmann [Fri, 30 Jun 2017 07:22:02 +0000 (07:22 +0000)]
Fold exception-warnings.cpp into warn-throw-out-noexcept-func.cpp

I had failed to notice the latter existed when I recently introduced the former.

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

7 years agoAdd -no-canonical-prefixes to the test line so that we can handle different build...
Eric Christopher [Fri, 30 Jun 2017 06:03:47 +0000 (06:03 +0000)]
Add -no-canonical-prefixes to the test line so that we can handle different build modes.

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

7 years agofix trivial typos, NFC
Hiroshi Inoue [Fri, 30 Jun 2017 05:40:31 +0000 (05:40 +0000)]
fix trivial typos, NFC

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

7 years agoRemove Clang support for '-fvectorize-slp-aggressive' which used LLVM's
Chandler Carruth [Fri, 30 Jun 2017 05:13:31 +0000 (05:13 +0000)]
Remove Clang support for '-fvectorize-slp-aggressive' which used LLVM's
basic block vectorizer. This vectorizer has had no known users for many,
many years and is completely surpassed by the normal
'-fvectorize-slp'-controlled SLP vectorizer in LLVM.

Hal proposed this back in 2014 to no objections:
http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html

While this patch completely removes the flag, Joerg is working on
a patch that will add it back in a way that warns users and ignores the
flag in a clear and well factored way (so that we can keep doing this
going forward).

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

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

7 years agoRemove test commit.
Don Hinton [Fri, 30 Jun 2017 03:03:28 +0000 (03:03 +0000)]
Remove test commit.

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

7 years agoTest Commit
Don Hinton [Fri, 30 Jun 2017 02:57:34 +0000 (02:57 +0000)]
Test Commit

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

7 years ago[WebAssembly] Add throw/rethrow builtins for exception handling
Heejin Ahn [Fri, 30 Jun 2017 00:44:01 +0000 (00:44 +0000)]
[WebAssembly] Add throw/rethrow builtins for exception handling

Summary:
Add new builtins for throw/rethrow instructions. This follows exception handling
handling proposal in
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md

Reviewers: sunfish, dschuff

Reviewed By: dschuff

Subscribers: jfb, dschuff, sbc100, jgravelle-google

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

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

7 years ago[CodeGen] Propagate dllexport to thunks
Shoaib Meenai [Fri, 30 Jun 2017 00:07:54 +0000 (00:07 +0000)]
[CodeGen] Propagate dllexport to thunks

Under Windows Itanium, we need to export virtual and non-virtual thunks
if the functions being thunked are exported. These thunks would
previously inherit their dllexport attribute from the declaration, but
r298330 changed declarations to not have dllexport attributes. We
therefore need to add the dllexport attribute to the definition
ourselves now.

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

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

7 years agoUnified logic for computing target ABI in backend and front end by moving this common...
Eric Christopher [Fri, 30 Jun 2017 00:03:56 +0000 (00:03 +0000)]
Unified logic for computing target ABI in backend and front end by moving this common code to Support/TargetParser.

Modeled Triple::GNU after front end code (aapcs abi) and updated tests that expect apcs abi.

Patch by Ana Pazos!

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

7 years ago[PM] Add support for sample PGO in the new pass manager (clang-side)
Dehao Chen [Thu, 29 Jun 2017 23:33:13 +0000 (23:33 +0000)]
[PM] Add support for sample PGO in the new pass manager (clang-side)

Summary: This implements the clang bits of https://reviews.llvm.org/D34720, and add corresponding test to verify if it worked.

Reviewers: chandlerc, davidxl, davide, tejohnson

Reviewed By: chandlerc, tejohnson

Subscribers: tejohnson, sanjoy, mehdi_amini, eraman, cfe-commits

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

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

7 years agoTeach ASTReader how to read only the Preprocessor state from an AST file, not the...
Richard Smith [Thu, 29 Jun 2017 23:23:46 +0000 (23:23 +0000)]
Teach ASTReader how to read only the Preprocessor state from an AST file, not the ASTContext state.

We use this when running a preprocessor-only action on an AST file in order to
avoid paying the runtime cost of loading the extra information.

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