Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Update to LLVM 4.0 #13

Closed
wants to merge 2,439 commits into from
Closed

Conversation

dylanmckay
Copy link
Contributor

@dylanmckay dylanmckay commented Jan 19, 2017

This is accompanied with emscripten-core/emscripten-fastcomp#165

Ekaterina Romanova and others added 30 commits December 27, 2016 18:53
Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable.
Formatted comments to fit into 80 chars.
In some cases added \a command in front of the parameter names to display them in italics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290619 91177308-0d34-0410-b5e6-96231b3b80d8
…than primary template" error (since Eigen hits it), and while I'm here also add a warning flag for "partial specialization is not usable because one or more of its parameters cannot be deduced" warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290625 91177308-0d34-0410-b5e6-96231b3b80d8
This seems like it must've been a leftover by accident - no tests were
backing it up & it doesn't make much sense to include size/alignment on
class declarations (it'd only be on those declarations for which the
definition was available - otherwise the size/alignment would not be
known).

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

to make reference to template parameters. This is only a partial
implementation; we retain the restriction that the argument must not be
type-dependent, since it's unclear how that would work given the existence of
other language rules requiring an exact type match in this context, even for
type-dependent cases (a question has been raised on the core reflector).


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

parameter. Fixes failed deduction for 'auto' non-type template parameters
nested within templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290660 91177308-0d34-0410-b5e6-96231b3b80d8
Our newly aggressive constant folding logic makes it possible for
CGExprConstant to see the same CompoundLiteralExpr more than once. So,
emitting a new GlobalVariable every time we see a CompoundLiteral is no
longer correct.

We had a similar issue with BlockExprs that was caught while testing
said aggressive folding, so I applied the same style of fix (see D26410)
here. If we find yet another case where this needs to happen, we should
probably refactor this so we don't have a third DenseMap+getter+setter.

As a design note: getAddrOfConstantCompoundLiteralIfEmitted is really
only intended to be called by ConstExprEmitter::EmitLValue. So,
returning a GlobalVariable* instead of a ConstantAddress costs us
effectively nothing, and saves us either a few bytes per entry in our
map or a bit of code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290661 91177308-0d34-0410-b5e6-96231b3b80d8
One of the intended checks was not being performed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290671 91177308-0d34-0410-b5e6-96231b3b80d8
This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290672 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290673 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
We can simply import all external values with summaries included in
the individual index file created for the distributed backend job,
as only those are added to the individual index file created by the
WriteIndexesThinBackend (in addition to summaries for the original
module, which are skipped here).

While computing the cross module imports on this index would come to
the same conclusion as the original thin link import logic, it is
unnecessary work. And when tuning, it avoids the need to pass the
same function importing parameters (e.g. -import-instr-limit) to
both the thin link and the backends (otherwise they won't make the
same decisions).

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290674 91177308-0d34-0410-b5e6-96231b3b80d8
Accidental commit. LLVM changes have not been pushed yet
This reverts commit 5924534.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290676 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290677 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This class is unnecessary.

Its comment indicated that it was a compile error to allocate an
instance of a class that inherits from RefCountedBaseVPTR on the stack.
This may have been true at one point, but it's not today.

Moreover you really do not want to allocate *any* refcounted object on
the stack, vptrs or not, so if we did have a way to prevent these
objects from being stack-allocated, we'd want to apply it to regular
RefCountedBase too, obviating the need for a separate RefCountedBaseVPTR
class.

It seems that the main way RefCountedBaseVPTR provides safety is by
making its subclass's destructor virtual.  This may have been helpful at
one point, but these days clang will emit an error if you define a class
with virtual functions that inherits from RefCountedBase but doesn't
have a virtual destructor.

Reviewers: compnerd, dblaikie

Subscribers: cfe-commits, klimek, llvm-commits, mgorny

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

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

This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290725 91177308-0d34-0410-b5e6-96231b3b80d8
This implements the compiler side of p0403r0. This patch was reviewed as
https://reviews.llvm.org/D26829.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290744 91177308-0d34-0410-b5e6-96231b3b80d8
Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290762 91177308-0d34-0410-b5e6-96231b3b80d8
There was a small error in the code in the tutorial. The tutorial contains a few errors which results in code not being able to compile.

One error was described here: https://llvm.org/bugs/show_bug.cgi?id=25583 .

I found and fixed the error and one additional error.

Reviewers: aaron.ballman, malcolm.parsons

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290766 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290773 91177308-0d34-0410-b5e6-96231b3b80d8
This diff fixes the clean build of the target generate-order-file.
In llvm/tools/clang/CMakeLists.txt 
add_subdirectory(utils/perf-training) should go after the block where 
the value of the variable CLANG_ORDER_FILE is set - otherwise 
(tested with cmake's version 3.6.2) the arguments of perf-helper.py gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).

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


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

to be specified for a template template parameter whenever the parameter is at
least as specialized as the argument (when there's an obvious and correct
mapping from uses of the parameter to uses of the argument). For example, a
template with more parameters can be passed to a template template parameter
with fewer, if those trailing parameters have default arguments.

This is disabled by default, despite being a DR resolution, as it's fairly
broken in its current state: there are no partial ordering rules to cope with
template template parameters that have different parameter lists, meaning that
code that attempts to decompose template-ids based on arity can hit unavoidable
ambiguity issues.

The diagnostics produced on a non-matching argument are also pretty bad right
now, but I aim to improve them in a subsequent commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290792 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290795 91177308-0d34-0410-b5e6-96231b3b80d8
The MS ABI RTTI has a reserved field which is used as a cache for the
demangled name.  It must be zero-initialized, which is used as a hint by
the runtime to say that the cache has not been populated.  Since this
field is populated at runtime, the RTTI structures must be placed in the
.data section rather than .rdata.  NFC

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

template parameters between deduction and substitution. The idea is to accept
as many cases as possible, on the basis that substitution failure outside
the immediate context is much more common during substitution than during
implicit conversion sequence formation.

This does not implement the partial ordering portion of DR1391, which so
far appears to be misguided.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290808 91177308-0d34-0410-b5e6-96231b3b80d8
…dent function template parameters between deduction and substitution. The idea is to accept as many cases as possible, on the basis that substitution failure outside the immediate context is much more common during substitution than during implicit conversion sequence formation."

This reverts commit r290808, as it broken all ARM and AArch64 test-suite
test: MultiSource/UnitTests/C++11/frame_layout

Also, please, next time, try to write a commit message in according to
our guidelines:

http://llvm.org/docs/DeveloperPolicy.html#commit-messages

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290811 91177308-0d34-0410-b5e6-96231b3b80d8
zmodem and others added 19 commits January 13, 2017 16:47
------------------------------------------------------------------------
r291865 | rsmith | 2017-01-12 16:43:31 -0800 (Thu, 12 Jan 2017) | 15 lines

Improve handling of instantiated thread_local variables in Itanium C++ ABI.

 * Do not initialize these variables when initializing the rest of the
   thread_locals in the TU; they have unordered initialization so they can be
   initialized by themselves.

   This fixes a rejects-valid bug: we would make the per-variable initializer
   function internal, but put it in a comdat keyed off the variable, resulting
   in link errors when the comdat is selected from a different TU (as the per
   TU TLS init function tries to call an init function that does not exist).

 * On Darwin, when we decide that we're not going to emit a thread wrapper
   function at all, demote its linkage to External. Fixes a verifier failure
   on explicit instantiation of a thread_local variable on Darwin.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291912 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291871 | rsmith | 2017-01-12 16:57:54 -0800 (Thu, 12 Jan 2017) | 10 lines

Update C++ status pages for Clang 4 branch:

 * Update version number in DR tests from 4.0 to 4
 * Teach make_cxx_dr_status script about version numbers that don't contain a
   period.
 * Update cxx_status.html and cxx_dr_status.html to list Clang 4 features as
   "Clang 4" rather than "SVN"

Clang 4 features are still listed in yellow rather than green until release.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291913 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291877 | smeenai | 2017-01-12 17:28:34 -0800 (Thu, 12 Jan 2017) | 13 lines

[Sema] Restrict explicit instantation definition dllexport

In the case where the template class itself is already `dllexport`, the
implicit instantiation will have already emitted all members. When we
check the explicit instantiation definition, the `Specialization` will
have inherited the `dllexport` attribute, so we'll attempt to emit all
members for a second time, which causes an assertion failure. Restrict
the exporting to when the `dllexport` attribute is newly introduced by
the explicit instantiation definition.

Fixes PR31608.

Differential Revision: https://reviews.llvm.org/D28590
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291943 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291907 | jbcoe | 2017-01-13 08:06:59 -0800 (Fri, 13 Jan 2017) | 6 lines

Revert "Support for Python 3 in libclang python bindings"

This reverts commit 4464581.

Memory access issues on Linux were reported by Mathieu Duponchelle and
discussed here: https://reviews.llvm.org/D26082.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291950 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291881 | chandlerc | 2017-01-12 18:47:34 -0800 (Thu, 12 Jan 2017) | 3 lines

Another fix for r291850 because there are apparently targets which add
"-mllvm" flags to the CC1 invocation (notably, Hexagon seems to hit
this).
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291951 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291879 | echristo | 2017-01-12 17:52:04 -0800 (Thu, 12 Jan 2017) | 1 line

Add a necessary newline for diagnose_if documentation.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291952 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r291964 | rsmith | 2017-01-13 14:16:41 -0800 (Fri, 13 Jan 2017) | 2 lines

PR31631: fix bad CFG (and bogus warnings) when an if-statement has an init-statement and has binary operator as its condition.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@291978 91177308-0d34-0410-b5e6-96231b3b80d8
This might require some small fixits after generating
doc

Devirtualization:
https://reviews.llvm.org/D28606

ThinLTO:
https://reviews.llvm.org/D28746



git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292080 91177308-0d34-0410-b5e6-96231b3b80d8
In order to have link from ReleaseNotes working
this needs to have -fstrict-vtable-pointers 
option.

There is also one small typo fix (overridden)
y

https://reviews.llvm.org/D28727



git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292113 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292265 | hans | 2017-01-17 13:31:57 -0800 (Tue, 17 Jan 2017) | 1 line

UsersManual.rst: add missing newline
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292266 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292032 | yrnkrn | 2017-01-14 13:12:08 -0800 (Sat, 14 Jan 2017) | 4 lines

Fix PR31644 introduced by r287138 and add a regression test.
Thanks Dimitry Andric for the report and fix!


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292311 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292052 | akirtzidis | 2017-01-14 22:11:04 -0800 (Sat, 14 Jan 2017) | 1 line

[code-completion] Fix crash when trying to do postfix completion of instance member inside a static function.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292313 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292183 | rsmith | 2017-01-16 18:14:37 -0800 (Mon, 16 Jan 2017) | 14 lines

Partial revert of r290511.

The rules around typechecking deduced template arguments during partial
ordering are not clear, and while the prior behavior does not seem to be
correct (it doesn't follow the general model of partial ordering where each
template parameter is replaced by a non-dependent but unique value), the new
behavior is also not clearly right and breaks some existing idioms.

The new behavior is retained for dealing with non-type template parameters
with 'auto' types, as without it even the most basic uses of that feature
don't work. We can revisit this once CWG has come to an agreement on how
partial ordering with 'auto' non-type template parameters is supposed to
work.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292338 91177308-0d34-0410-b5e6-96231b3b80d8
------------------------------------------------------------------------
r292247 | jbcoe | 2017-01-17 12:03:54 -0800 (Tue, 17 Jan 2017) | 14 lines

Fix Python 3 language issues and add an explicit check for Python version == 2.

Summary:
Python bindings cannot support Python 3 without work being done to fix Unicode c-string conversion.

This was attempted in https://reviews.llvm.org/D26082. That patch was reverted due to memory access issues on Linux.

This revision fixes enough language compatibility issues for the clang module to be loaded and raise an error if the Python version is not 2.

Reviewers: mgorny, MathieuDuponchelle, rengolin, compnerd

Reviewed By: compnerd

Differential Revision: https://reviews.llvm.org/D28682
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_40@292339 91177308-0d34-0410-b5e6-96231b3b80d8
@kripken
Copy link
Member

kripken commented Jan 19, 2017

Nice, thanks! :)

What's the status of this and the second PR? (WIP I guess from the title, but I'm curious for more detail, if it's not too early)

@dylanmckay
Copy link
Contributor Author

Nice, thanks! :)

No problem :)

They're both mostly done. I've merged 4.0 into both of them, resolved all conflicts, audited the diff against 4.0 and everything looks good.

I haven't run the clang test suite yet, but I imagine it will likely pass once the two above CodeGen tests pass.

@kripken
Copy link
Member

kripken commented Jan 19, 2017

Great!

We don't actually run the clang test suite ourselves, since we hardly modified clang - it should just pass, yeah. What is more crucial to test is the emscripten test suite - often a merge hits issues there. Let me know if I can help with testing/fixing stuff there.

We'll need to bump the emscripten expected LLVM version number (in tools/shared.py in the emscripten repo), so we'll need a small PR to emscripten to do that, and to handle any test fixes/changes if any. I can help there too if you want.

@dylanmckay dylanmckay changed the title WIP: Update to LLVM 4.0 Update to LLVM 4.0 Jan 20, 2017
@dylanmckay dylanmckay changed the base branch from master to incoming January 20, 2017 00:21
@dylanmckay
Copy link
Contributor Author

Superseded by #14

@dylanmckay dylanmckay closed this Feb 11, 2017
juj pushed a commit that referenced this pull request Jan 31, 2018
Summary:
The test being added in this patch used to cause an assertion failure:

/build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
--
Exit Code: 134

Command Output (stderr):
--
clang: /src/tools/clang/lib/AST/ASTDiagnostic.cpp:424: void clang::FormatASTNodeDiagnosticArgument(DiagnosticsEngine::ArgumentKind, intptr_t, llvm::StringRef, llvm::StringRef, ArrayRef<DiagnosticsEngine::ArgumentValue>, SmallVectorImpl<char> &, void *, ArrayRef<intptr_t>): Assertion `isa<NamedDecl>(DC) && "Expected a NamedDecl"' failed.
#0 0x0000000001c7a1b4 PrintStackTraceSignalHandler(void*) (/build/./bin/clang+0x1c7a1b4)
#1 0x0000000001c7a4e6 SignalHandler(int) (/build/./bin/clang+0x1c7a4e6)
#2 0x00007f30880078d0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#3 0x00007f3087054067 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35067)
#4 0x00007f3087055448 abort (/lib/x86_64-linux-gnu/libc.so.6+0x36448)
#5 0x00007f308704d266 (/lib/x86_64-linux-gnu/libc.so.6+0x2e266)
#6 0x00007f308704d312 (/lib/x86_64-linux-gnu/libc.so.6+0x2e312)
#7 0x00000000035b7f22 clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind, long, llvm::StringRef, llvm::StringRef, llvm::ArrayRef<std::pair<clang::DiagnosticsEngine::ArgumentKind, long> >, llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) (/build/
./bin/clang+0x35b7f22)
#8 0x0000000001ddbae4 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddbae4)
#9 0x0000000001ddb323 clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const (/build/./bin/clang+0x1ddb323)
#10 0x00000000022878a4 clang::TextDiagnosticBuffer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) (/build/./bin/clang+0x22878a4)
#11 0x0000000001ddf387 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const (/build/./bin/clang+0x1ddf387)
#12 0x0000000001dd9dea clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) (/build/./bin/clang+0x1dd9dea)
#13 0x0000000002cad00c clang::Sema::EmitCurrentDiagnostic(unsigned int) (/build/./bin/clang+0x2cad00c)
#14 0x0000000002d91cd2 clang::Sema::CheckShadow(clang::NamedDecl*, clang::NamedDecl*, clang::LookupResult const&) (/build/./bin/clang+0x2d91cd2)

Stack dump:
0.      Program arguments: /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp
1.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:214:23: current parser token ';'
2.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: parsing function body 'handleLinkageSpec'
3.      /src/tools/clang/test/SemaCXX/warn-shadow.cpp:213:26: in compound statement ('{}')
/build/tools/clang/test/SemaCXX/Output/warn-shadow.cpp.script: line 1: 15595 Aborted                 (core dumped) /build/./bin/clang -cc1 -internal-isystem /build/lib/clang/5.0.0/include -nostdsysteminc -verify -fsyntax-only -std=c++11 -Wshadow-all /src/tools/clang/test/SemaCXX/warn-shadow.cpp

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: krytarowski, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303325 91177308-0d34-0410-b5e6-96231b3b80d8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet