]> granicus.if.org Git - clang/log
clang
8 years agoFix clang-offload-bundler test.
Zachary Turner [Tue, 11 Oct 2016 16:06:32 +0000 (16:06 +0000)]
Fix clang-offload-bundler test.

A recent change to llvm::cl slightly changed the format of
the help output, and it broke this test.  NFC

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

8 years ago[OpenCL] Allow partial initializer for array and struct
Yaxun Liu [Tue, 11 Oct 2016 15:53:28 +0000 (15:53 +0000)]
[OpenCL] Allow partial initializer for array and struct

Currently Clang allows partial initializer for C99 but not for OpenCL, e.g.

float a[16][16] = {1.0f, 2.0f};

is allowed in C99 but not allowed in OpenCL.

This patch fixes that.

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

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

8 years agoRevert r283887 and r283882, until the issue is understood and fixed.
Vassil Vassilev [Tue, 11 Oct 2016 15:51:06 +0000 (15:51 +0000)]
Revert r283887 and r283882, until the issue is understood and fixed.

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

8 years agoUse StringRef instead of raw pointer in SourceManagerInternals LineTableInfo API...
Mehdi Amini [Tue, 11 Oct 2016 15:15:32 +0000 (15:15 +0000)]
Use StringRef instead of raw pointer in SourceManagerInternals LineTableInfo API (NFC)

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

8 years agor283882 followup. Don't demote ParmVarDecls. This should fix our module builds.
Vassil Vassilev [Tue, 11 Oct 2016 15:09:26 +0000 (15:09 +0000)]
r283882 followup. Don't demote ParmVarDecls. This should fix our module builds.

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

8 years ago[modules] PR28752: Do not instantiate variable declarations which are not visible.
Vassil Vassilev [Tue, 11 Oct 2016 13:57:36 +0000 (13:57 +0000)]
[modules] PR28752: Do not instantiate variable declarations which are not visible.

https://reviews.llvm.org/D24508

Patch developed in collaboration with Richard Smith!

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

8 years agoRevert "[Driver][Diagnostics] Make 'show option names' default for driver warnings"
Renato Golin [Tue, 11 Oct 2016 10:26:33 +0000 (10:26 +0000)]
Revert "[Driver][Diagnostics] Make 'show option names' default for driver warnings"

This reverts commit r283827, as it's breaking all ARM/AARch64 bots.

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

8 years agoDelete clang-completion-mode.el.
Manuel Klimek [Tue, 11 Oct 2016 09:25:34 +0000 (09:25 +0000)]
Delete clang-completion-mode.el.

It has been unmaintained for a while (last change was more than four
years ago), and it appears not widely used.
By now there are multiple well-maintained alternatives (emacs-ycmd,
atuo-complete-clang), and if users try to make this work they'll likely
have a bad user experience.

Reasoning and problems pointed out by Philipp Stephani.

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

8 years agoTurn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)
Mehdi Amini [Tue, 11 Oct 2016 07:31:29 +0000 (07:31 +0000)]
Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)

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

8 years agoExplicitly ignore return code in test for test systems that use pipefail
Daniel Jasper [Tue, 11 Oct 2016 06:13:18 +0000 (06:13 +0000)]
Explicitly ignore return code in test for test systems that use pipefail

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

8 years agoFixup test/Driver/opt-record.c for nvptx pointer size
Hal Finkel [Tue, 11 Oct 2016 01:05:45 +0000 (01:05 +0000)]
Fixup test/Driver/opt-record.c for nvptx pointer size

On some systems, it looks like nvptx is used instead of nvptx64.

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

8 years agoAdd an option to save the backend-produced YAML optimization record to a file
Hal Finkel [Tue, 11 Oct 2016 00:26:09 +0000 (00:26 +0000)]
Add an option to save the backend-produced YAML optimization record to a file

The backend now has the capability to save information from optimizations, the
same information that can be used to generate optimization diagnostics but in
machine-consumable form, into an output file. This can be enabled when using
opt (see r282539), and this change enables it when using clang. The idea is
that other tools will be able to consume these files, and perhaps in
combination with the original source code, produce various kinds of
optimization reports for users (and for compiler developers).

We now have at-least two tools that can consume these files:
  * tools/llvm-opt-report
  * utils/opt-viewer

Using the flag -fsave-optimization-record will cause the YAML file to be
generated; the file name will be based on the output file name (if we're using
-c or -S and have an output name), or the input file name. When we're using
CUDA, or some other offloading mechanism, separate files are generated for each
backend target. The output file name can be specified by the user using
-foptimization-record-file=filename.

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

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

8 years ago[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.
Justin Lebar [Tue, 11 Oct 2016 00:23:53 +0000 (00:23 +0000)]
[Sema] Add explicit move constructor for ExpressionEvaluationContextRecord.

This is needed to keep MSVC 2013 happy.

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

8 years agoAligned allocation versus CUDA: make deallocation function preference order
Richard Smith [Tue, 11 Oct 2016 00:21:10 +0000 (00:21 +0000)]
Aligned allocation versus CUDA: make deallocation function preference order
match other CUDA preference orders, per discussion with jlebar. We now model
this in an attempt to match overload resolution as closely as possible:

- First, we throw out all non-callable (due to CUDA host/device mismatch)
  operator delete functions.
- Then we apply sizedness / alignedness preferences based on whether the type
  is overaligned and whether the deallocation function is a member.
- Finally, we use the CUDA callability preference as a tiebreaker.

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

8 years ago[Driver][Diagnostics] Make 'show option names' default for driver warnings
Bruno Cardoso Lopes [Tue, 11 Oct 2016 00:01:22 +0000 (00:01 +0000)]
[Driver][Diagnostics] Make 'show option names' default for driver warnings

Currently, driver level warnings do not show option names (e.g. warning:
complain about foo [-Woption-name]) in a diagnostic unless
-fdiagnostics-show-option is explictly specified. OTOH, the driver by
default turn this option on for CC1. Change the logic to show option
names by default in the driver as well.

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

rdar://problem/27300909

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

8 years agoStore FileEntry::Filename as a StringRef instead of raw pointer (NFC)
Mehdi Amini [Mon, 10 Oct 2016 22:52:47 +0000 (22:52 +0000)]
Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)

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

8 years ago[Driver] Let -gline-tables-only win when it comes after -gmodules.
Adrian Prantl [Mon, 10 Oct 2016 21:56:20 +0000 (21:56 +0000)]
[Driver] Let -gline-tables-only win when it comes after -gmodules.
The -gmodules option is all about putting debug type info into clang
modules and for line tables the type information is irrelevant, so
combining these two options makes no sense.
This commmit fixes the behavior to match the one  documented on the
clang man page: the last -g... option wins.

<rdar://problem/27059770>

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

8 years agoChange Builtins name to be stored as StringRef instead of raw pointers (NFC)
Mehdi Amini [Mon, 10 Oct 2016 21:34:29 +0000 (21:34 +0000)]
Change Builtins name to be stored as StringRef instead of raw pointers (NFC)

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

8 years agoAdd -fno-sanitize-address-use-after-scope flag
Vitaly Buka [Mon, 10 Oct 2016 21:31:50 +0000 (21:31 +0000)]
Add -fno-sanitize-address-use-after-scope flag

Reviewers: eugenis

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

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

8 years agoMake the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the...
Nick Lewycky [Mon, 10 Oct 2016 20:07:13 +0000 (20:07 +0000)]
Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers in the LValue as the QualType in the LValue. No functionality change intended.

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

8 years agoImplement MS read/write barriers and __faststorefence intrinsic
Albert Gutowski [Mon, 10 Oct 2016 19:40:51 +0000 (19:40 +0000)]
Implement MS read/write barriers and __faststorefence intrinsic

Reviewers: hans, rnk, majnemer

Subscribers: cfe-commits

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

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

8 years ago[AST] Don't use make_pointee_iterator in VTableBuilder.
Justin Lebar [Mon, 10 Oct 2016 19:26:22 +0000 (19:26 +0000)]
[AST] Don't use make_pointee_iterator in VTableBuilder.

Our implementation of make_pointee_iterator seems to be causing MSVC
2015 to crash, so I'm going to remove it.

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

8 years agoRe-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
Richard Smith [Mon, 10 Oct 2016 18:54:32 +0000 (18:54 +0000)]
Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of
past-the-end iterator.

Original commit message:

P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

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

8 years agoImplement __emul, __emulu, _mul128 and _umul128 MS intrinsics
Albert Gutowski [Mon, 10 Oct 2016 18:09:27 +0000 (18:09 +0000)]
Implement __emul, __emulu, _mul128 and _umul128 MS intrinsics

Reviewers: rnk, thakis, majnemer, hans

Subscribers: cfe-commits

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

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

8 years ago[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.
Justin Lebar [Mon, 10 Oct 2016 16:41:00 +0000 (16:41 +0000)]
[Examples] Fix use of sema.LateParsedTemplateMap in clang/examples.

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

8 years agoUse StringRef in LangOptions::isNoBuiltinFunc API (NFC)
Mehdi Amini [Mon, 10 Oct 2016 16:34:07 +0000 (16:34 +0000)]
Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)

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

8 years ago[Analysis] Use unique_ptr for CallGraph::FunctionMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:48 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr for CallGraph::FunctionMap.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.
Justin Lebar [Mon, 10 Oct 2016 16:26:44 +0000 (16:26 +0000)]
[Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[AST] Convert Marshallers to use unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:40 +0000 (16:26 +0000)]
[AST] Convert Marshallers to use unique_ptr.

Reviewers: timshen

Subscribers: cfe-commits, klimek

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

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

8 years agoUse unique_ptr for VTableBuilder::VBaseInfo map.
Justin Lebar [Mon, 10 Oct 2016 16:26:36 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VBaseInfo map.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years agoUse unique_ptr for VTableBuilder::VFTableLayouts map.
Justin Lebar [Mon, 10 Oct 2016 16:26:33 +0000 (16:26 +0000)]
Use unique_ptr for VTableBuilder::VFTableLayouts map.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years agoUse unique_ptr for VPtrLocationsMap and VPtrInfoVector.
Justin Lebar [Mon, 10 Oct 2016 16:26:29 +0000 (16:26 +0000)]
Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[AST] Use unique_ptr for VTableLayout.
Justin Lebar [Mon, 10 Oct 2016 16:26:24 +0000 (16:26 +0000)]
[AST] Use unique_ptr for VTableLayout.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[AST] Convert MangleNumberingContext to a unique_ptr.
Justin Lebar [Mon, 10 Oct 2016 16:26:19 +0000 (16:26 +0000)]
[AST] Convert MangleNumberingContext to a unique_ptr.

Summary: It doesn't need to be refcounted anymore, either.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.
Justin Lebar [Mon, 10 Oct 2016 16:26:08 +0000 (16:26 +0000)]
[Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.

Summary:
This is possible now that MapVector supports move-only values.

Depends on D25404.

Reviewers: timshen

Subscribers: cfe-commits

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

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

8 years ago[Sema] Prevent using member declaration diagnostic if the base class is invalid.
Eric Fiselier [Mon, 10 Oct 2016 14:26:40 +0000 (14:26 +0000)]
[Sema] Prevent using member declaration diagnostic if the base class is invalid.

Summary:
Once a base class has been made invalid (by a static_assert for example) all using-member declarations in the derived classes will result in a "not a base class" diagnostic. This diagnostic is very misleading and should not be emitted.

This change is needed to help libc++ produce reasonable diagnostics in `std::optional` and `std::variant`.

Reviewers: rsmith, majnemer, aaron.ballman

Subscribers: cfe-commits

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

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

8 years agoRevert r283683 because r283680 got reverted.
Nico Weber [Mon, 10 Oct 2016 14:20:35 +0000 (14:20 +0000)]
Revert r283683 because r283680 got reverted.

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

8 years agoRevert "P0035R4: Semantic analysis and code generation for C++17 overaligned allocation."
Daniel Jasper [Mon, 10 Oct 2016 14:13:55 +0000 (14:13 +0000)]
Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned allocation."

This reverts commit r283722. Breaks:
  Clang.SemaCUDA.device-var-init.cu
  Clang.CodeGenCUDA.device-var-init.cu

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/

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

8 years agoRevert r283680.
Nico Weber [Mon, 10 Oct 2016 14:10:00 +0000 (14:10 +0000)]
Revert r283680.

Breaks bootstrap builds on (at least) Windows:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\lib\Support\Allocator.cpp:14:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/Allocator.h:24:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/SmallVector.h:20:
In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/MathExtras.h:19:
D:\buildslave\clang-x64-ninja-win7\stage1.install\bin\..\lib\clang\4.0.0\include\algorithm(63,8) :
    error: unknown type name '__device__'
    inline __device__ const __T &

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

8 years ago[Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Michal Gorny [Mon, 10 Oct 2016 12:23:40 +0000 (12:23 +0000)]
[Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

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

8 years agoRevert "[x86][inline-asm][clang] accept 'v' constraint"
Daniel Jasper [Mon, 10 Oct 2016 11:40:28 +0000 (11:40 +0000)]
Revert "[x86][inline-asm][clang] accept 'v' constraint"

This reverts commit r283716.

Breaks buildbot:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/9155/testReport/junit/Clang/CodeGen/x86_inline_asm_v_constraint_c/

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

8 years agoFix style issue. Spaces in argument list.
Daniel Marjamaki [Mon, 10 Oct 2016 07:39:39 +0000 (07:39 +0000)]
Fix style issue. Spaces in argument list.

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

8 years agoMark aligned allocation as done.
Richard Smith [Mon, 10 Oct 2016 06:55:42 +0000 (06:55 +0000)]
Mark aligned allocation as done.

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

8 years agoP0035R4: Semantic analysis and code generation for C++17 overaligned
Richard Smith [Mon, 10 Oct 2016 06:42:31 +0000 (06:42 +0000)]
P0035R4: Semantic analysis and code generation for C++17 overaligned
allocation.

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

8 years ago[x86][inline-asm][clang] accept 'v' constraint
Michael Zuckerman [Mon, 10 Oct 2016 05:45:54 +0000 (05:45 +0000)]
[x86][inline-asm][clang] accept 'v' constraint

Commit in the name of: Coby Tayree

1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64).
2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent)

This patch applies the needed changes to clang
 LLVM patch: https://reviews.llvm.org/D25005

Differential Revision: D25004

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

8 years agoWhen optimizing for size, enable loop rerolling by default
Hal Finkel [Sun, 9 Oct 2016 03:06:31 +0000 (03:06 +0000)]
When optimizing for size, enable loop rerolling by default

We have a loop-rerolling optimization which can be enabled by using
-freroll-loops. While sometimes loops are hand-unrolled for performance
reasons, when optimizing for size, we should always undo this manual
optimization to produce smaller code (our optimizer's unroller will still
unroll the rerolled loops if it thinks that is a good idea).

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

8 years ago[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.
Justin Lebar [Sun, 9 Oct 2016 00:27:39 +0000 (00:27 +0000)]
[CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir.

This is obviously wrong -- if we do this, then all compiles will pick up
these wrappers, which is not what we want.

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

8 years ago[CUDA] Support <complex> and std::min/max on the device.
Justin Lebar [Sat, 8 Oct 2016 22:16:12 +0000 (22:16 +0000)]
[CUDA] Support <complex> and std::min/max on the device.

Summary:
We do this by wrapping <complex> and <algorithm>.

Tests are in the test-suite.

Reviewers: tra

Subscribers: jhen, beanz, cfe-commits, mgorny

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

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

8 years ago[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.
Justin Lebar [Sat, 8 Oct 2016 22:16:08 +0000 (22:16 +0000)]
[CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

Summary: This matches the idiom we use for our other CUDA wrapper headers.

Reviewers: tra

Subscribers: beanz, mgorny, cfe-commits

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

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

8 years ago[CUDA] Declare our __device__ math functions in the same inline namespace as our...
Justin Lebar [Sat, 8 Oct 2016 22:16:03 +0000 (22:16 +0000)]
[CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

Summary:
Currently we declare our inline __device__ math functions in namespace
std.  But libstdc++ and libc++ declare these functions in an inline
namespace inside namespace std.  We need to match this because, in a
later patch, we want to get e.g. <complex> to use our device overloads,
and it only will if those overloads are in the right inline namespace.

Reviewers: tra

Subscribers: cfe-commits, jhen

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

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

8 years ago[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.
Justin Lebar [Sat, 8 Oct 2016 22:15:58 +0000 (22:15 +0000)]
[CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.

Summary:
These cause us to consider all functions in-between to be __host__
__device__.

You can nest these pragmas; you just can't have more 'end's than
'begin's.

Reviewers: rsmith

Subscribers: tra, jhen, cfe-commits

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

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

8 years agoTurn cl::values() (for enum) from a vararg function to using C++ variadic template
Mehdi Amini [Sat, 8 Oct 2016 19:41:06 +0000 (19:41 +0000)]
Turn cl::values() (for enum) from a vararg function to using C++ variadic template

The core of the change is supposed to be NFC, however it also fixes
what I believe was an undefined behavior when calling:

 va_start(ValueArgs, Desc);

with Desc being a StringRef.

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

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

8 years ago[analyzer] Fix build error after r283660 - remove constexpr strings.
Artem Dergachev [Sat, 8 Oct 2016 11:07:21 +0000 (11:07 +0000)]
[analyzer] Fix build error after r283660 - remove constexpr strings.

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

8 years ago[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"
Artem Dergachev [Sat, 8 Oct 2016 10:54:30 +0000 (10:54 +0000)]
[analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"

The parent commit (r283092) was reverted before and now finally landed.

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

8 years ago[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"
Artem Dergachev [Sat, 8 Oct 2016 10:53:00 +0000 (10:53 +0000)]
[analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"

The parent commit (r283092) was reverted before and now finally landed.

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

8 years agoUn-tabify source files, NFC.
Yaron Keren [Sat, 8 Oct 2016 06:45:10 +0000 (06:45 +0000)]
Un-tabify source files, NFC.

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

8 years agoUse StringRef in Command::printArg() instead of raw pointer (NFC)
Mehdi Amini [Sat, 8 Oct 2016 01:38:43 +0000 (01:38 +0000)]
Use StringRef in Command::printArg() instead of raw pointer (NFC)

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

8 years ago[CUDA] Do a better job at detecting wrong-side calls.
Justin Lebar [Sat, 8 Oct 2016 01:07:11 +0000 (01:07 +0000)]
[CUDA] Do a better job at detecting wrong-side calls.

Summary:
Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to
DiagnoseUseOfDecl.  This lets us catch some edge cases we were missing,
specifically around class operators.

This necessitates a few other changes:

 - Avoid emitting duplicate deferred diags in CheckCUDACall.

   Previously we'd carefully placed our call to CheckCUDACall such that
   it would only ever run once for a particular callsite.  But now this
   isn't the case.

 - Emit deferred diagnostics from a template
   specialization/instantiation's primary template, in addition to from
   the specialization/instantiation itself.  DiagnoseUseOfDecl ends up
   putting the deferred diagnostics on the template, rather than the
   specialization, so we need to check both.

Reviewers: rsmith

Subscribers: cfe-commits, tra

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

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

8 years agoRename variable to not use C++ reserved name (leading underscore + capital) (NFC)
Mehdi Amini [Fri, 7 Oct 2016 22:03:03 +0000 (22:03 +0000)]
Rename variable to not use C++ reserved name (leading underscore + capital) (NFC)

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

8 years agoFix MSVC build: requires namespace in front of StringRef (NFC)
Mehdi Amini [Fri, 7 Oct 2016 22:02:59 +0000 (22:02 +0000)]
Fix MSVC build: requires namespace in front of StringRef (NFC)

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

8 years agoDriver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)
Mehdi Amini [Fri, 7 Oct 2016 21:41:00 +0000 (21:41 +0000)]
Driver: use StringRef instead of raw pointer in lookupTypeForExtension() (NFC)

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

8 years agoTurn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)
Mehdi Amini [Fri, 7 Oct 2016 21:27:26 +0000 (21:27 +0000)]
Turn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)

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

8 years agoVisually align table def with respective enum. NFC
Douglas Katzman [Fri, 7 Oct 2016 21:02:38 +0000 (21:02 +0000)]
Visually align table def with respective enum. NFC

'warn_attribute_wrong_decl_type' has to stay in sync with
'enum AttributeDeclKind' which is much easier when they line up.

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

8 years agoRevert r283572 - [Driver] Make -print-libgcc-file-name print compiler-rt lib when...
Michal Gorny [Fri, 7 Oct 2016 20:04:00 +0000 (20:04 +0000)]
Revert r283572 - [Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Revert the -print-libgcc-file-name change as the new test fails
on Darwin. It needs to be updated to run the libgcc part only on systems
supporting that rtlib.

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

8 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)
Artem Dergachev [Fri, 7 Oct 2016 19:25:10 +0000 (19:25 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.4 (last)

The problem that caused the msvc crash has been indentified and fixed
in the previous commit. This patch contains the rest of r283092.

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

8 years agoSilence Warning. NFC.
Nirav Dave [Fri, 7 Oct 2016 19:11:33 +0000 (19:11 +0000)]
Silence Warning. NFC.

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

8 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.
Artem Dergachev [Fri, 7 Oct 2016 17:24:06 +0000 (17:24 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.3, fixup 1.

Remove the brace default initializer to see if this is what's causing
the msvc crash.

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

8 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.3.
Artem Dergachev [Fri, 7 Oct 2016 17:12:05 +0000 (17:12 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.3.

This is the primary suspect for causing the msvc crash, now that vector of
smart pointers was proven to be safe. Probably the default {}-initializer
is the problem.

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

8 years ago[Driver] Make -print-libgcc-file-name print compiler-rt lib when used
Michal Gorny [Fri, 7 Oct 2016 17:08:06 +0000 (17:08 +0000)]
[Driver] Make -print-libgcc-file-name print compiler-rt lib when used

Make the -print-libgcc-file-name option print an appropriate compiler
runtime library, that is libgcc.a if gcc runtime is used
and an appropriate compiler-rt library if that runtime is used.

The main use for this is to allow linking executables built with
-nodefaultlibs (e.g. to avoid linking to the standard C++ library) to
the compiler runtime library, e.g. using:

  clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name)

in which case currently a program built like this linked to the gcc
runtime unconditionally. The patch fixes it to use compiler-rt libraries
instead when compiler-rt is the active runtime.

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

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

8 years ago[analyzer] Re-apply r283092, attempt no.4, chunk no.2.
Artem Dergachev [Fri, 7 Oct 2016 15:55:18 +0000 (15:55 +0000)]
[analyzer] Re-apply r283092, attempt no.4, chunk no.2.

Define the list of pieces in BugReport class. This is half of the changes
in the BugReport class code, which is pointed to by the msvc crash message.

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

8 years ago[analyzer] Re-apply r283092, attempt no.4, a small chunk.
Artem Dergachev [Fri, 7 Oct 2016 15:23:02 +0000 (15:23 +0000)]
[analyzer] Re-apply r283092, attempt no.4, a small chunk.

Define PathDiagnosticNotePiece. The next commit would be able to address the
BugReport class code that is pointed to by the msvc crash message.

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

8 years agoUpdate clang test to accomendate discriminator change in https://reviews.llvm.org...
Dehao Chen [Fri, 7 Oct 2016 15:21:29 +0000 (15:21 +0000)]
Update clang test to accomendate discriminator change in https://reviews.llvm.org/D25132

Summary: https://reviews.llvm.org/D25132 added discriminator even add -g0. This leads to test fail which is addressed in thie patch.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

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

8 years ago[analyzer] Don't merge different return nodes in ExplodedGraph
Daniel Marjamaki [Fri, 7 Oct 2016 14:21:08 +0000 (14:21 +0000)]
[analyzer] Don't merge different return nodes in ExplodedGraph

Returns when calling an inline function should not be merged in the ExplodedGraph unless they are same.

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

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

8 years agoWdocumentation fix
Simon Pilgrim [Fri, 7 Oct 2016 13:25:41 +0000 (13:25 +0000)]
Wdocumentation fix

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

8 years ago[ARM]: Add Cortex-R52 target
Javed Absar [Fri, 7 Oct 2016 12:08:41 +0000 (12:08 +0000)]
[ARM]: Add Cortex-R52 target

This patch adds Cortex-R52, the new ARM real-time processor.
Cortex-R52 implements the ARMv8-R architecture.

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

8 years agoRevert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."
Artem Dergachev [Fri, 7 Oct 2016 11:29:32 +0000 (11:29 +0000)]
Revert "[analyzer] Re-apply r283092, attempt no.3, in small chunks this time."

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

8 years ago[analyzer] Re-apply r283092, attempt no.3, in small chunks this time.
Artem Dergachev [Fri, 7 Oct 2016 11:26:15 +0000 (11:26 +0000)]
[analyzer] Re-apply r283092, attempt no.3, in small chunks this time.

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

8 years agoRevert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Artem Dergachev [Fri, 7 Oct 2016 10:56:44 +0000 (10:56 +0000)]
Revert "[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

Vector of smart pointers wasn't the thing that caused msvc crash.

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

8 years ago[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"
Artem Dergachev [Fri, 7 Oct 2016 10:44:09 +0000 (10:44 +0000)]
[analyzer] Try to re-apply r283092 "Extend bug reports with extra notes"

Replace SmallVector<IntrusiveRefCntPtr> with a vector of plain pointers.
Would insignificantly increase memory usage.

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

8 years agoUse StringReg in TargetParser APIs (NFC)
Mehdi Amini [Fri, 7 Oct 2016 08:37:29 +0000 (08:37 +0000)]
Use StringReg in TargetParser APIs (NFC)

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

8 years agoPR25890: Fix incoherent error handling in PerformImplicitConversion and
Richard Smith [Thu, 6 Oct 2016 23:12:58 +0000 (23:12 +0000)]
PR25890: Fix incoherent error handling in PerformImplicitConversion and
CheckSingleAssignmentConstraints. These no longer produce ExprError() when they
have not emitted an error, and reliably inform the caller when they *have*
emitted an error.

This fixes some serious issues where we would fail to emit any diagnostic for
invalid code and then attempt to emit code for an invalid AST, and conversely
some issues where we would emit two diagnostics for the same problem.

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

8 years ago[analyzer] Add explanation why analyzer report is not generated (fix for PR12421).
Anton Yartsev [Thu, 6 Oct 2016 21:42:21 +0000 (21:42 +0000)]
[analyzer] Add explanation why analyzer report is not generated (fix for PR12421).

Currently if the path diagnostic consumer (e.g HTMLDiagnostics and PlistDiagnostics) do not support cross file diagnostics then the path diagnostic report is silently omitted in the case of cross file diagnostics. The patch adds a little verbosity to Clang in this case.
The patch also adds help entry for the "--analyzer-output" driver option.

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

8 years agoAdd another .def file to module map to fix modules buildbot's displeasure.
Richard Smith [Thu, 6 Oct 2016 21:31:04 +0000 (21:31 +0000)]
Add another .def file to module map to fix modules buildbot's displeasure.

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

8 years ago[coroutines] Fix co_return statement for initializer list arguments
Eric Fiselier [Thu, 6 Oct 2016 21:23:38 +0000 (21:23 +0000)]
[coroutines] Fix co_return statement for initializer list arguments

Summary:
Previously the statement `co_return {42}` would be transformed into `P.return_void()`, since the type of `{42}` is represented as `void` by Clang.

This patch fixes the bug by checking for `InitListExpr` arguments and transforming them accordingly.

Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

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

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

8 years ago[modules] Be sure to emit local specializations of imported templates, even if
Richard Smith [Thu, 6 Oct 2016 20:30:51 +0000 (20:30 +0000)]
[modules] Be sure to emit local specializations of imported templates, even if
the resulting specialization is not referenced by the rest of the AST. This
both avoids performing unnecessary reinstantiations in downstream users of the
AST file and fixes a bug (breaking modules self-host right now) where we would
sometimes fail to emit a definition of a class template specialization if we
imported just a declaration of it from elsewhere (see new testcase for reduced
example).

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

8 years ago[Sema] Replace smart quote with "'" in comment.
Justin Lebar [Thu, 6 Oct 2016 19:47:56 +0000 (19:47 +0000)]
[Sema] Replace smart quote with "'" in comment.

Looks like the smart quote was copy/pasted from the C++ standard.

The smart quote was not encoded as valid UTF-8 (?), even though vim was
detecting the file as UTF-8.  This broke the clang-format Python script,
which tried to read the file using the same encoding as vim detected.

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

8 years ago[OpenMP] Check if the template specialization is mappable instead of specialized...
David Sheinkman [Thu, 6 Oct 2016 15:47:36 +0000 (15:47 +0000)]
[OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: https://reviews.llvm.org/D25252

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

8 years agoAllocate after the early exit checks. NFC.
Vassil Vassilev [Thu, 6 Oct 2016 13:18:06 +0000 (13:18 +0000)]
Allocate after the early exit checks. NFC.

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

8 years ago[modules] Allow VarDecls with initializers to use special var abbrev.
Vassil Vassilev [Thu, 6 Oct 2016 13:04:54 +0000 (13:04 +0000)]
[modules] Allow VarDecls with initializers to use special var abbrev.

Update storage sizes to fit the (past) changes in the VarDecl's data model.
Update some comments.

Patch partially reviewed by Richard Smith as part of https://reviews.llvm.org/D24508

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

8 years ago[Sema] Fix PR30520: Handle incomplete field types in transparent_union unions
Alex Lorenz [Thu, 6 Oct 2016 09:47:29 +0000 (09:47 +0000)]
[Sema] Fix PR30520: Handle incomplete field types in transparent_union unions

This commit fixes a crash that happens when clang is analyzing a
transparent_union attribute on a union which has a field with incomplete type.

rdar://28630028

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

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

8 years agoAdd missing -no-canonical-prefixes.
Benjamin Kramer [Thu, 6 Oct 2016 09:40:37 +0000 (09:40 +0000)]
Add missing -no-canonical-prefixes.

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

8 years agoFix PR30440: Initialize FunctionTypeDepth in CXXNameMangler
Alex Lorenz [Thu, 6 Oct 2016 09:37:15 +0000 (09:37 +0000)]
Fix PR30440: Initialize FunctionTypeDepth in CXXNameMangler

This commit fixes PR 30440 by initializing CXXNameMangler's FunctionTypeDepth
in the two constructors added in r274222 (The commit that caused this
regression).

rdar://28455269

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

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

8 years ago[Driver] Add driver support for Fuchsia
Petr Hosek [Thu, 6 Oct 2016 06:08:09 +0000 (06:08 +0000)]
[Driver] Add driver support for Fuchsia

Provide toolchain and tool support for Fuchsia operating system.
Fuchsia uses compiler-rt as the runtime library and libc++, libc++abi
and libunwind as the C++ standard library. lld is used as a default
linker.

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

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

8 years agoTaking StringRef in Driver.h APIs instead of raw pointers (NFC)
Mehdi Amini [Thu, 6 Oct 2016 05:11:48 +0000 (05:11 +0000)]
Taking StringRef in Driver.h APIs instead of raw pointers (NFC)

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

8 years agoUse llvm::raw_string_ostream instead of std::stringstream (NFC)
Mehdi Amini [Thu, 6 Oct 2016 04:26:16 +0000 (04:26 +0000)]
Use llvm::raw_string_ostream instead of std::stringstream (NFC)

As a side effect, this avoid having to call .data() on the StringRef.

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

8 years agoPR22924, PR22845, some of CWG1464: When checking the initializer for an array
Richard Smith [Wed, 5 Oct 2016 22:41:02 +0000 (22:41 +0000)]
PR22924, PR22845, some of CWG1464: When checking the initializer for an array
new expression, distinguish between the case of a constant and non-constant
initializer. In the former case, if the bound is erroneous (too many
initializer elements, bound is negative, or allocated size overflows), reject,
and take the bound into account when determining whether we need to
default-construct any elements. In the remanining cases, move the logic to
check for default-constructibility of trailing elements into the initialization
code rather than inventing a bogus array bound, to cope with cases where the
number of initialized elements is not the same as the number of initializer
list elements (this can happen due to string literal initialization or brace
elision).

This also fixes rejects-valid and crash-on-valid errors when initializing a
new'd array of character type from a braced string literal.

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

8 years agoRemoving optimization from the RUN lines and adjusting the checks
Nemanja Ivanovic [Wed, 5 Oct 2016 19:11:36 +0000 (19:11 +0000)]
Removing optimization from the RUN lines and adjusting the checks
to not rely on optimization.

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

8 years agoMake DeletedLines local variables in checkEmptyNamespace.
Eric Liu [Wed, 5 Oct 2016 15:49:01 +0000 (15:49 +0000)]
Make DeletedLines local variables in checkEmptyNamespace.

Summary: Patch by Sam McCall!

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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

8 years ago[clang-format] append newline after code when inserting new headers at the end of...
Eric Liu [Wed, 5 Oct 2016 15:42:19 +0000 (15:42 +0000)]
[clang-format] append newline after code when inserting new headers at the end of the code which does not end with newline.

Summary:
append newline after code when inserting new headers at the end of the
code which does not end with newline.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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

8 years ago[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang
Michael Zuckerman [Wed, 5 Oct 2016 12:56:06 +0000 (12:56 +0000)]
[Clang][AVX512][BuiltIn]Adding missing intrinsics move_{sd|ss} to clang

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

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