New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM 4.0 #14

merged 2,440 commits into from Mar 15, 2017


None yet

kripken commented Jan 25, 2017

zygoloid and others added some commits Dec 27, 2016

Add warning flag for "partial specialization is not more specialized …
…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: 91177308-0d34-0410-b5e6-96231b3b80d8
DebugInfo: Don't include size/alignment on class declarations
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

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
DR1315: a non-type template argument in a partial specialization is p…

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: 91177308-0d34-0410-b5e6-96231b3b80d8
Mark 'auto' as dependent when instantiating the type of a non-type te…

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

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[CodeGen] Unique constant CompoundLiterals.
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Teresa Johnson
[ThinLTO] Add missing FileCheck invocation
One of the intended checks was not being performed.

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Driver: switch Windows to static RelocModel"
This reverts commit r290569. It caused unforeseen codegen changes for
switch jump tables described in PR31488.

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Fix format. NFC
git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Teresa Johnson
[ThinLTO] No need to rediscover imports in distributed backend
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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Mention devirtualization in release notes"
Accidental commit. LLVM changes have not been pushed yet
This reverts commit 5924534.

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[ItaniumABI] NFC changes
git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[ADT] Delete RefCountedBaseVPTR.
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

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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[OpenMP] Sema and parsing for 'target teams distribute parallel for’ …

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

Differential Revision:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Allow lexer to handle string_view literals. Patch from Anton Bikineev.
This implements the compiler side of p0403r0. This patch was reviewed as

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: use a StringSwitch instead of cascasding ifs
Change the cascading ifs to a StringSwitch to simplify the conversion of
the relocation model.  NFC

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[clang] Minor fix to libASTMatcherTutorial
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: .

I found and fixed the error and one additional error.

Reviewers: aaron.ballman, malcolm.parsons

Subscribers: cfe-commits

Differential Revision:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Simon Pilgrim
Wdocumentation fix
git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[clang] Fix clean build of generate-order-file
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 gen-order-file
will be ill-formed (CLANG_ORDER_FILE will be empty).

Differential revision:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
[c++17] Implement P0522R0 as written. This allows a template template…
… 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: 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo in test case. NFC
git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: update comment about RTTI field
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: 91177308-0d34-0410-b5e6-96231b3b80d8
DR1391: Check for implicit conversion sequences for non-dependent fun…

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: 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "DR1391: Check for implicit conversion sequences for non-depen…
…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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8

djasper and others added some commits Jan 12, 2017

clang-format: Fix regression introduced by r291801.
Uncovered by polly tests.

                                 {}, aaaaaaaaaaaaaaaaaaaaaaa);

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa, {},

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Add entry for -MJ.
git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291850 and r291853:
r291850 | chandlerc | 2017-01-12 14:40:13 -0800 (Thu, 12 Jan 2017) | 9 lines

Address review comments on r290392:
- Don't break using '-mllvm -disable-llvm-optzns' (yet).
- Don't add support for '-mllvm -disable-llvm-passes'.

This is important for LLVM 4 as we haven't yet really told folks this is
coming. I'll add release notes about this.

I've also added some explicit testing of this so its more obvious what
is happening here.

r291853 | chandlerc | 2017-01-12 14:48:28 -0800 (Thu, 12 Jan 2017) | 1 line

Fix two test cases I missed updating in r291850. Sorry for the noise.

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291865:
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291871:
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
 * 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: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291877:
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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291907:
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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291881:
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

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291879:
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r291964:
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Mention Devirtualization and ThinLTO in ReleaseNotes
This might require some small fixits after generating



git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Add -fstrict-vtable-pointers to UsersManual
In order to have link from ReleaseNotes working
this needs to have -fstrict-vtable-pointers 

There is also one small typo fix (overridden)

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r292265:
r292265 | hans | 2017-01-17 13:31:57 -0800 (Tue, 17 Jan 2017) | 1 line

UsersManual.rst: add missing newline

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r292032:
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r292052:
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: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r292183:
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


git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Merging r292247:
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.

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

This was attempted in 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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8

@dylanmckay dylanmckay referenced this pull request Feb 11, 2017


Update to LLVM 4.0 #13

@kripken kripken merged commit 579d400 into incoming Mar 15, 2017

@kripken kripken deleted the next-merge branch Mar 15, 2017

juj pushed a commit that referenced this pull request Jan 31, 2018

Fix an assertion failure in FormatASTNodeDiagnosticArgument.
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/
#3 0x00007f3087054067 gsignal (/lib/x86_64-linux-gnu/
#4 0x00007f3087055448 abort (/lib/x86_64-linux-gnu/
#5 0x00007f308704d266 (/lib/x86_64-linux-gnu/
#6 0x00007f308704d312 (/lib/x86_64-linux-gnu/
#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/
#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:

git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment