svn commit: r317951 - in vendor/clang/dist: docs include/clang/AST include/clang/ASTMatchers include/clang/Basic include/clang/Driver include/clang/Frontend include/clang/Lex include/clang/Sema inc...
Dimitry Andric
dim at FreeBSD.org
Mon May 8 17:13:17 UTC 2017
Author: dim
Date: Mon May 8 17:13:11 2017
New Revision: 317951
URL: https://svnweb.freebsd.org/changeset/base/317951
Log:
Vendor import of clang trunk r302418:
https://llvm.org/svn/llvm-project/cfe/trunk@302418
Added:
vendor/clang/dist/lib/Headers/lwpintrin.h (contents, props changed)
vendor/clang/dist/test/CodeGen/aarch64-args.cpp (contents, props changed)
vendor/clang/dist/test/CodeGen/lwp-builtins.c (contents, props changed)
vendor/clang/dist/test/FixIt/fixit-availability.c (contents, props changed)
vendor/clang/dist/test/FixIt/fixit-availability.mm
vendor/clang/dist/test/Index/KeepGoingWithLotsOfErrors.mm
vendor/clang/dist/test/Modules/Inputs/preprocess/file2.h (contents, props changed)
vendor/clang/dist/test/OpenMP/varargs.cpp (contents, props changed)
vendor/clang/dist/test/SemaCXX/warn-zero-nullptr.cpp (contents, props changed)
Modified:
vendor/clang/dist/docs/LanguageExtensions.rst
vendor/clang/dist/docs/LibASTMatchersReference.html
vendor/clang/dist/docs/SanitizerCoverage.rst
vendor/clang/dist/docs/ThreadSafetyAnalysis.rst
vendor/clang/dist/include/clang/AST/ODRHash.h
vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h
vendor/clang/dist/include/clang/Basic/Attr.td
vendor/clang/dist/include/clang/Basic/AttrDocs.td
vendor/clang/dist/include/clang/Basic/BuiltinsARM.def
vendor/clang/dist/include/clang/Basic/BuiltinsX86.def
vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def
vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
vendor/clang/dist/include/clang/Driver/CC1Options.td
vendor/clang/dist/include/clang/Driver/Distro.h
vendor/clang/dist/include/clang/Driver/Multilib.h
vendor/clang/dist/include/clang/Driver/Options.td
vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
vendor/clang/dist/include/clang/Frontend/FrontendAction.h
vendor/clang/dist/include/clang/Lex/HeaderSearch.h
vendor/clang/dist/include/clang/Lex/Lexer.h
vendor/clang/dist/include/clang/Lex/ModuleMap.h
vendor/clang/dist/include/clang/Lex/Preprocessor.h
vendor/clang/dist/include/clang/Sema/Sema.h
vendor/clang/dist/include/clang/Tooling/FixIt.h
vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp
vendor/clang/dist/lib/Basic/Diagnostic.cpp
vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp
vendor/clang/dist/lib/Basic/Targets.cpp
vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
vendor/clang/dist/lib/CodeGen/TargetInfo.cpp
vendor/clang/dist/lib/Driver/Distro.cpp
vendor/clang/dist/lib/Driver/Multilib.cpp
vendor/clang/dist/lib/Driver/SanitizerArgs.cpp
vendor/clang/dist/lib/Driver/ToolChains/CrossWindows.cpp
vendor/clang/dist/lib/Driver/ToolChains/Gnu.cpp
vendor/clang/dist/lib/Format/FormatToken.h
vendor/clang/dist/lib/Format/FormatTokenLexer.cpp
vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp
vendor/clang/dist/lib/Frontend/FrontendAction.cpp
vendor/clang/dist/lib/Frontend/FrontendActions.cpp
vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp
vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp
vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp
vendor/clang/dist/lib/Headers/CMakeLists.txt
vendor/clang/dist/lib/Headers/arm_acle.h
vendor/clang/dist/lib/Headers/x86intrin.h
vendor/clang/dist/lib/Index/IndexDecl.cpp
vendor/clang/dist/lib/Lex/HeaderSearch.cpp
vendor/clang/dist/lib/Lex/Lexer.cpp
vendor/clang/dist/lib/Lex/ModuleMap.cpp
vendor/clang/dist/lib/Lex/PPDirectives.cpp
vendor/clang/dist/lib/Lex/PPLexerChange.cpp
vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp
vendor/clang/dist/lib/Lex/Pragma.cpp
vendor/clang/dist/lib/Lex/Preprocessor.cpp
vendor/clang/dist/lib/Lex/TokenLexer.cpp
vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp
vendor/clang/dist/lib/Sema/Sema.cpp
vendor/clang/dist/lib/Sema/SemaChecking.cpp
vendor/clang/dist/lib/Sema/SemaDecl.cpp
vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp
vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp
vendor/clang/dist/lib/Sema/SemaExpr.cpp
vendor/clang/dist/lib/Sema/SemaStmt.cpp
vendor/clang/dist/lib/Tooling/JSONCompilationDatabase.cpp
vendor/clang/dist/test/CodeGen/arm_acle.c
vendor/clang/dist/test/CodeGen/mozilla-ms-inline-asm.c
vendor/clang/dist/test/CodeGen/ms-inline-asm-64.c
vendor/clang/dist/test/CodeGen/ms-inline-asm-avx512.c
vendor/clang/dist/test/CodeGen/ms-inline-asm.c
vendor/clang/dist/test/CodeGen/ms-inline-asm.cpp
vendor/clang/dist/test/CodeGen/thinlto_backend.ll
vendor/clang/dist/test/CodeGenCXX/ms-inline-asm-fields.cpp
vendor/clang/dist/test/CodeGenObjC/arc-foreach.m
vendor/clang/dist/test/CodeGenOpenCL/kernel-attributes.cl
vendor/clang/dist/test/Driver/android-ndk-standalone.cpp
vendor/clang/dist/test/Driver/darwin-version.c
vendor/clang/dist/test/Driver/fsanitize-coverage.c
vendor/clang/dist/test/Driver/windows-cross.c
vendor/clang/dist/test/Index/Core/index-source.cpp
vendor/clang/dist/test/Misc/pragma-attribute-supported-attributes-list.test
vendor/clang/dist/test/Modules/Inputs/preprocess/module.modulemap
vendor/clang/dist/test/Modules/preprocess-module.cpp
vendor/clang/dist/test/Parser/MicrosoftExtensions.cpp
vendor/clang/dist/test/Parser/ms-square-bracket-attributes.mm
vendor/clang/dist/test/Preprocessor/aarch64-target-features.c
vendor/clang/dist/test/Preprocessor/macro_paste_commaext.c
vendor/clang/dist/test/Preprocessor/pragma_module.c
vendor/clang/dist/test/Preprocessor/stringize_space.c
vendor/clang/dist/test/Sema/arm-interrupt-attr.c
vendor/clang/dist/test/Sema/attr-availability.c
vendor/clang/dist/test/SemaCXX/ms-uuid.cpp
vendor/clang/dist/test/SemaCXX/varargs.cpp
vendor/clang/dist/test/SemaObjC/x86-method-vector-values.m
vendor/clang/dist/test/SemaOpenCL/invalid-kernel-attrs.cl
vendor/clang/dist/test/SemaOpenCL/sampler_t.cl
vendor/clang/dist/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
vendor/clang/dist/unittests/Format/FormatTestJS.cpp
Modified: vendor/clang/dist/docs/LanguageExtensions.rst
==============================================================================
--- vendor/clang/dist/docs/LanguageExtensions.rst Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/docs/LanguageExtensions.rst Mon May 8 17:13:11 2017 (r317951)
@@ -780,14 +780,14 @@ Use ``__has_feature(cxx_variadic_templat
``__has_extension(cxx_variadic_templates)`` to determine if support for
variadic templates is enabled.
-C++1y
+C++14
-----
-The features listed below are part of the committee draft for the C++1y
-standard. As a result, all these features are enabled with the ``-std=c++1y``
-or ``-std=gnu++1y`` option when compiling C++ code.
+The features listed below are part of the C++14 standard. As a result, all
+these features are enabled with the ``-std=C++14`` or ``-std=gnu++14`` option
+when compiling C++ code.
-C++1y binary literals
+C++14 binary literals
^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_binary_literals)`` or
@@ -795,37 +795,37 @@ Use ``__has_feature(cxx_binary_literals)
binary literals (for instance, ``0b10010``) are recognized. Clang supports this
feature as an extension in all language modes.
-C++1y contextual conversions
+C++14 contextual conversions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_contextual_conversions)`` or
-``__has_extension(cxx_contextual_conversions)`` to determine if the C++1y rules
+``__has_extension(cxx_contextual_conversions)`` to determine if the C++14 rules
are used when performing an implicit conversion for an array bound in a
*new-expression*, the operand of a *delete-expression*, an integral constant
expression, or a condition in a ``switch`` statement.
-C++1y decltype(auto)
+C++14 decltype(auto)
^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_decltype_auto)`` or
``__has_extension(cxx_decltype_auto)`` to determine if support
for the ``decltype(auto)`` placeholder type is enabled.
-C++1y default initializers for aggregates
+C++14 default initializers for aggregates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_aggregate_nsdmi)`` or
``__has_extension(cxx_aggregate_nsdmi)`` to determine if support
for default initializers in aggregate members is enabled.
-C++1y digit separators
+C++14 digit separators
^^^^^^^^^^^^^^^^^^^^^^
Use ``__cpp_digit_separators`` to determine if support for digit separators
using single quotes (for instance, ``10'000``) is enabled. At this time, there
is no corresponding ``__has_feature`` name
-C++1y generalized lambda capture
+C++14 generalized lambda capture
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_init_captures)`` or
@@ -833,7 +833,7 @@ Use ``__has_feature(cxx_init_captures)``
lambda captures with explicit initializers is enabled
(for instance, ``[n(0)] { return ++n; }``).
-C++1y generic lambdas
+C++14 generic lambdas
^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_generic_lambdas)`` or
@@ -841,7 +841,7 @@ Use ``__has_feature(cxx_generic_lambdas)
(polymorphic) lambdas is enabled
(for instance, ``[] (auto x) { return x + 1; }``).
-C++1y relaxed constexpr
+C++14 relaxed constexpr
^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_relaxed_constexpr)`` or
@@ -849,7 +849,7 @@ Use ``__has_feature(cxx_relaxed_constexp
declarations, local variable modification, and control flow constructs
are permitted in ``constexpr`` functions.
-C++1y return type deduction
+C++14 return type deduction
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_return_type_deduction)`` or
@@ -857,7 +857,7 @@ Use ``__has_feature(cxx_return_type_dedu
for return type deduction for functions (using ``auto`` as a return type)
is enabled.
-C++1y runtime-sized arrays
+C++14 runtime-sized arrays
^^^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_runtime_array)`` or
@@ -866,7 +866,7 @@ for arrays of runtime bound (a restricte
is enabled.
Clang's implementation of this feature is incomplete.
-C++1y variable templates
+C++14 variable templates
^^^^^^^^^^^^^^^^^^^^^^^^
Use ``__has_feature(cxx_variable_templates)`` or
Modified: vendor/clang/dist/docs/LibASTMatchersReference.html
==============================================================================
--- vendor/clang/dist/docs/LibASTMatchersReference.html Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/docs/LibASTMatchersReference.html Mon May 8 17:13:11 2017 (r317951)
@@ -924,6 +924,19 @@ in
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxStdInitializerListExpr0')"><a name="cxxStdInitializerListExpr0Anchor">cxxStdInitializerListExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStdInitializerListExpr.html">CXXStdInitializerListExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxStdInitializerListExpr0"><pre>Matches C++ initializer list expressions.
+
+Given
+ std::vector<int> a({ 1, 2, 3 });
+ std::vector<int> b = { 4, 5 };
+ int c[] = { 6, 7 };
+ std::pair<int, int> d = { 8, 9 };
+cxxStdInitializerListExpr()
+ matches "{ 1, 2, 3 }" and "{ 4, 5 }"
+</pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxTemporaryObjectExpr0')"><a name="cxxTemporaryObjectExpr0Anchor">cxxTemporaryObjectExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTemporaryObjectExpr.html">CXXTemporaryObjectExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="cxxTemporaryObjectExpr0"><pre>Matches functional cast expressions having N != 1 arguments
@@ -1160,7 +1173,7 @@ Example matches [&](){return 5;}
<tr><td colspan="4" class="doc" id="materializeTemporaryExpr0"><pre>Matches nodes where temporaries are materialized.
Example: Given
- struct T {void func()};
+ struct T {void func();};
T f();
void g(T);
materializeTemporaryExpr() matches 'f()' in these statements
@@ -5233,7 +5246,7 @@ Example matches y in x(y)
<tr><td colspan="4" class="doc" id="hasReceiverType0"><pre>Matches on the receiver of an ObjectiveC Message expression.
Example
-matcher = objCMessageExpr(hasRecieverType(asString("UIWebView *")));
+matcher = objCMessageExpr(hasReceiverType(asString("UIWebView *")));
matches the [webView ...] message invocation.
NSString *webViewJavaScript = ...
UIWebView *webView = ...
Modified: vendor/clang/dist/docs/SanitizerCoverage.rst
==============================================================================
--- vendor/clang/dist/docs/SanitizerCoverage.rst Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/docs/SanitizerCoverage.rst Mon May 8 17:13:11 2017 (r317951)
@@ -144,8 +144,9 @@ Use these flags together with ``trace-pc
like this: ``-fsanitize-coverage=func,trace-pc-guard``.
When ``edge`` or ``bb`` is used, some of the edges/blocks may still be left
-uninstrumented if such instrumentation is considered redundant.
-**TODO**: add a user-visible option to disable the optimization.
+uninstrumented (pruned) if such instrumentation is considered redundant.
+Use ``no-prune`` (e.g. ``-fsanitize-coverage=bb,no-prune,trace-pc-guard``)
+to disable pruning. This could be useful for better coverage visualization.
Edge coverage
Modified: vendor/clang/dist/docs/ThreadSafetyAnalysis.rst
==============================================================================
--- vendor/clang/dist/docs/ThreadSafetyAnalysis.rst Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/docs/ThreadSafetyAnalysis.rst Mon May 8 17:13:11 2017 (r317951)
@@ -764,8 +764,6 @@ implementation.
#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op
#endif
- #define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
-
#define CAPABILITY(x) \
THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
Modified: vendor/clang/dist/include/clang/AST/ODRHash.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ODRHash.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/AST/ODRHash.h Mon May 8 17:13:11 2017 (r317951)
@@ -25,7 +25,7 @@ namespace clang {
class Decl;
class IdentifierInfo;
-class NestedNameSpecifer;
+class NestedNameSpecifier;
class Stmt;
class TemplateParameterList;
Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Mon May 8 17:13:11 2017 (r317951)
@@ -1223,6 +1223,20 @@ AST_MATCHER_P(InitListExpr, hasSyntactic
InnerMatcher.matches(*SyntForm, Finder, Builder));
}
+/// \brief Matches C++ initializer list expressions.
+///
+/// Given
+/// \code
+/// std::vector<int> a({ 1, 2, 3 });
+/// std::vector<int> b = { 4, 5 };
+/// int c[] = { 6, 7 };
+/// std::pair<int, int> d = { 8, 9 };
+/// \endcode
+/// cxxStdInitializerListExpr()
+/// matches "{ 1, 2, 3 }" and "{ 4, 5 }"
+const internal::VariadicDynCastAllOfMatcher<Stmt,
+ CXXStdInitializerListExpr> cxxStdInitializerListExpr;
+
/// \brief Matches implicit initializers of init list expressions.
///
/// Given
Modified: vendor/clang/dist/include/clang/Basic/Attr.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Attr.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/Attr.td Mon May 8 17:13:11 2017 (r317951)
@@ -864,6 +864,13 @@ def OpenCLUnrollHint : InheritableAttr {
let Documentation = [OpenCLUnrollHintDocs];
}
+def OpenCLIntelReqdSubGroupSize: InheritableAttr {
+ let Spellings = [GNU<"intel_reqd_sub_group_size">];
+ let Args = [UnsignedArgument<"SubGroupSize">];
+ let Subjects = SubjectList<[Function], ErrorDiag>;
+ let Documentation = [OpenCLIntelReqdSubGroupSizeDocs];
+}
+
// This attribute is both a type attribute, and a declaration attribute (for
// parameter variables).
def OpenCLAccess : Attr {
Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/AttrDocs.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Mon May 8 17:13:11 2017 (r317951)
@@ -2216,6 +2216,21 @@ s6.11.5 for details.
}];
}
+def OpenCLIntelReqdSubGroupSizeDocs : Documentation {
+ let Category = DocCatStmt;
+ let Heading = "__attribute__((intel_reqd_sub_group_size))";
+ let Content = [{
+The optional attribute intel_reqd_sub_group_size can be used to indicate that
+the kernel must be compiled and executed with the specified subgroup size. When
+this attribute is present, get_max_sub_group_size() is guaranteed to return the
+specified integer value. This is important for the correctness of many subgroup
+algorithms, and in some cases may be used by the compiler to generate more optimal
+code. See `cl_intel_required_subgroup_size
+<https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt>`
+for details.
+ }];
+}
+
def OpenCLAccessDocs : Documentation {
let Category = DocCatStmt;
let Heading = "__read_only, __write_only, __read_write (read_only, write_only, read_write)";
Modified: vendor/clang/dist/include/clang/Basic/BuiltinsARM.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsARM.def Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsARM.def Mon May 8 17:13:11 2017 (r317951)
@@ -25,11 +25,93 @@
// In libgcc
BUILTIN(__clear_cache, "vv*v*", "i")
+// 16-bit multiplications
+BUILTIN(__builtin_arm_smulbb, "iii", "nc")
+BUILTIN(__builtin_arm_smulbt, "iii", "nc")
+BUILTIN(__builtin_arm_smultb, "iii", "nc")
+BUILTIN(__builtin_arm_smultt, "iii", "nc")
+BUILTIN(__builtin_arm_smulwb, "iii", "nc")
+BUILTIN(__builtin_arm_smulwt, "iii", "nc")
+
// Saturating arithmetic
BUILTIN(__builtin_arm_qadd, "iii", "nc")
BUILTIN(__builtin_arm_qsub, "iii", "nc")
BUILTIN(__builtin_arm_ssat, "iiUi", "nc")
-BUILTIN(__builtin_arm_usat, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usat, "UiiUi", "nc")
+
+BUILTIN(__builtin_arm_smlabb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlabt, "iiii", "nc")
+BUILTIN(__builtin_arm_smlatb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlatt, "iiii", "nc")
+BUILTIN(__builtin_arm_smlawb, "iiii", "nc")
+BUILTIN(__builtin_arm_smlawt, "iiii", "nc")
+
+BUILTIN(__builtin_arm_ssat16, "iii", "nc")
+BUILTIN(__builtin_arm_usat16, "iii", "nc")
+
+BUILTIN(__builtin_arm_sxtab16, "iii", "nc")
+BUILTIN(__builtin_arm_sxtb16, "ii", "nc")
+BUILTIN(__builtin_arm_uxtab16, "iii", "nc")
+BUILTIN(__builtin_arm_uxtb16, "ii", "nc")
+
+BUILTIN(__builtin_arm_sel, "iii", "nc")
+
+BUILTIN(__builtin_arm_qadd8, "iii", "nc")
+BUILTIN(__builtin_arm_qsub8, "iii", "nc")
+BUILTIN(__builtin_arm_sadd8, "iii", "nc")
+BUILTIN(__builtin_arm_shadd8, "iii", "nc")
+BUILTIN(__builtin_arm_shsub8, "iii", "nc")
+BUILTIN(__builtin_arm_ssub8, "iii", "nc")
+BUILTIN(__builtin_arm_uadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsub8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqadd8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsub8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usub8, "UiUiUi", "nc")
+
+// Sum of 8-bit absolute differences
+BUILTIN(__builtin_arm_usad8, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usada8, "UiUiUiUi", "nc")
+
+// Parallel 16-bit addition and subtraction
+BUILTIN(__builtin_arm_qadd16, "iii", "nc")
+BUILTIN(__builtin_arm_qasx, "iii", "nc")
+BUILTIN(__builtin_arm_qsax, "iii", "nc")
+BUILTIN(__builtin_arm_qsub16, "iii", "nc")
+BUILTIN(__builtin_arm_sadd16, "iii", "nc")
+BUILTIN(__builtin_arm_sasx, "iii", "nc")
+BUILTIN(__builtin_arm_shadd16, "iii", "nc")
+BUILTIN(__builtin_arm_shasx, "iii", "nc")
+BUILTIN(__builtin_arm_shsax, "iii", "nc")
+BUILTIN(__builtin_arm_shsub16, "iii", "nc")
+BUILTIN(__builtin_arm_ssax, "iii", "nc")
+BUILTIN(__builtin_arm_ssub16, "iii", "nc")
+BUILTIN(__builtin_arm_uadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uhsub16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqadd16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqasx, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_uqsub16, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usax, "UiUiUi", "nc")
+BUILTIN(__builtin_arm_usub16, "UiUiUi", "nc")
+
+// Parallel 16-bit multiplication
+BUILTIN(__builtin_arm_smlad, "iiii", "nc")
+BUILTIN(__builtin_arm_smladx, "iiii", "nc")
+BUILTIN(__builtin_arm_smlald, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlaldx, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlsd, "iiii", "nc")
+BUILTIN(__builtin_arm_smlsdx, "iiii", "nc")
+BUILTIN(__builtin_arm_smlsld, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smlsldx, "LLiiiLLi", "nc")
+BUILTIN(__builtin_arm_smuad, "iii", "nc")
+BUILTIN(__builtin_arm_smuadx, "iii", "nc")
+BUILTIN(__builtin_arm_smusd, "iii", "nc")
+BUILTIN(__builtin_arm_smusdx, "iii", "nc")
// Bit manipulation
BUILTIN(__builtin_arm_rbit, "UiUi", "nc")
Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsX86.def Mon May 8 17:13:11 2017 (r317951)
@@ -668,6 +668,12 @@ TARGET_BUILTIN(__builtin_ia32_pext_si, "
// TBM
TARGET_BUILTIN(__builtin_ia32_bextri_u32, "UiUiIUi", "", "tbm")
+// LWP
+TARGET_BUILTIN(__builtin_ia32_llwpcb, "vv*", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_slwpcb, "v*", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpins32, "UcUiUiUi", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpval32, "vUiUiUi", "", "lwp")
+
// SHA
TARGET_BUILTIN(__builtin_ia32_sha1rnds4, "V4iV4iV4iIc", "", "sha")
TARGET_BUILTIN(__builtin_ia32_sha1nexte, "V4iV4iV4i", "", "sha")
Modified: vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def
==============================================================================
--- vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/BuiltinsX86_64.def Mon May 8 17:13:11 2017 (r317951)
@@ -69,6 +69,8 @@ TARGET_BUILTIN(__builtin_ia32_bzhi_di, "
TARGET_BUILTIN(__builtin_ia32_pdep_di, "ULLiULLiULLi", "", "bmi2")
TARGET_BUILTIN(__builtin_ia32_pext_di, "ULLiULLiULLi", "", "bmi2")
TARGET_BUILTIN(__builtin_ia32_bextri_u64, "ULLiULLiIULLi", "", "tbm")
+TARGET_BUILTIN(__builtin_ia32_lwpins64, "UcULLiUiUi", "", "lwp")
+TARGET_BUILTIN(__builtin_ia32_lwpval64, "vULLiUiUi", "", "lwp")
TARGET_BUILTIN(__builtin_ia32_pbroadcastq512_gpr_mask, "V8LLiLLiV8LLiUc", "", "avx512f")
TARGET_BUILTIN(__builtin_ia32_pbroadcastq128_gpr_mask, "V2LLiULLiV2LLiUc","","avx512vl")
TARGET_BUILTIN(__builtin_ia32_pbroadcastq256_gpr_mask, "V4LLiULLiV4LLiUc","","avx512vl")
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Mon May 8 17:13:11 2017 (r317951)
@@ -475,8 +475,6 @@ def warn_pragma_pop_macro_no_push : Warn
def warn_pragma_message : Warning<"%0">,
InGroup<PoundPragmaMessage>, DefaultWarnNoWerror;
def err_pragma_message : Error<"%0">;
-def err_pragma_module_import_expected_module_name : Error<
- "expected %select{identifier in|'.' or end of directive after}0 module name">;
def warn_pragma_ignored : Warning<"unknown pragma ignored">,
InGroup<UnknownPragmas>, DefaultIgnore;
def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
@@ -511,6 +509,22 @@ def warn_pragma_debug_unexpected_command
"unexpected debug command '%0'">, InGroup<IgnoredPragmas>;
def warn_pragma_debug_missing_argument : Warning<
"missing argument to debug command '%0'">, InGroup<IgnoredPragmas>;
+// #pragma module
+def err_pp_expected_module_name : Error<
+ "expected %select{identifier after '.' in |}0module name">;
+def err_pp_module_begin_wrong_module : Error<
+ "must specify '-fmodule-name=%0' to enter %select{|submodule of }1"
+ "this module%select{ (current module is %3)|}2">;
+def err_pp_module_begin_no_module_map : Error<
+ "no module map available for module %0">;
+def err_pp_module_begin_no_submodule : Error<
+ "submodule %0.%1 not declared in module map">;
+def err_pp_module_begin_without_module_end : Error<
+ "no matching '#pragma clang module end' for this "
+ "'#pragma clang module begin'">;
+def err_pp_module_end_without_module_begin : Error<
+ "no matching '#pragma clang module begin' for this "
+ "'#pragma clang module end'">;
def err_defined_macro_name : Error<"'defined' cannot be used as a macro name">;
def err_paste_at_start : Error<
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Mon May 8 17:13:11 2017 (r317951)
@@ -730,6 +730,9 @@ def err_super_in_lambda_unsupported : Er
def warn_pragma_unused_undeclared_var : Warning<
"undeclared variable %0 used as an argument for '#pragma unused'">,
InGroup<IgnoredPragmas>;
+def warn_atl_uuid_deprecated : Warning<
+ "specifying 'uuid' as an ATL attribute is deprecated; use __declspec instead">,
+ InGroup<DeprecatedDeclarations>;
def warn_pragma_unused_expected_var_arg : Warning<
"only variables can be arguments to '#pragma unused'">,
InGroup<IgnoredPragmas>;
@@ -2088,7 +2091,7 @@ def err_enum_invalid_underlying : Error<
"non-integral type %0 is an invalid underlying type">;
def err_enumerator_too_large : Error<
"enumerator value is not representable in the underlying type %0">;
-def ext_enumerator_too_large : ExtWarn<
+def ext_enumerator_too_large : Extension<
"enumerator value is not representable in the underlying type %0">,
InGroup<MicrosoftEnumValue>;
def err_enumerator_wrapped : Error<
@@ -2868,7 +2871,8 @@ def warn_partial_availability : Warning<
def note_partial_availability_silence : Note<
"explicitly redeclare %0 to silence this warning">;
def note_unguarded_available_silence : Note<
- "enclose %0 in an @available check to silence this warning">;
+ "enclose %0 in %select{an @available|a __builtin_available}1 check to silence"
+ " this warning">;
def warn_partial_message : Warning<"%0 is partial: %1">,
InGroup<UnguardedAvailability>, DefaultIgnore;
def warn_partial_fwdclass_message : Warning<
@@ -4759,7 +4763,7 @@ def ext_forward_ref_enum : Extension<
"ISO C forbids forward references to 'enum' types">;
def err_forward_ref_enum : Error<
"ISO C++ forbids forward references to 'enum' types">;
-def ext_ms_forward_ref_enum : Extension<
+def ext_ms_forward_ref_enum : ExtWarn<
"forward references to 'enum' types are a Microsoft extension">,
InGroup<MicrosoftEnumForwardReference>;
def ext_forward_ref_enum_def : Extension<
@@ -7920,7 +7924,11 @@ def warn_empty_switch_body : Warning<
def note_empty_body_on_separate_line : Note<
"put the semicolon on a separate line to silence this warning">;
-def err_va_start_used_in_non_variadic_function : Error<
+def err_va_start_captured_stmt : Error<
+ "'va_start' cannot be used in a captured statement">;
+def err_va_start_outside_function : Error<
+ "'va_start' cannot be used outside a function">;
+def err_va_start_fixed_function : Error<
"'va_start' used in function with fixed args">;
def err_va_start_used_in_wrong_abi_function : Error<
"'va_start' used in %select{System V|Win64}0 ABI function">;
@@ -8297,6 +8305,8 @@ def err_sampler_argument_required : Erro
"sampler_t variable required - got %0">;
def err_wrong_sampler_addressspace: Error<
"sampler type cannot be used with the __local and __global address space qualifiers">;
+def err_opencl_nonconst_global_sampler : Error<
+ "global sampler requires a const or constant address space qualifier">;
def err_opencl_cast_non_zero_to_event_t : Error<
"cannot cast non-zero value '%0' to 'event_t'">;
def err_opencl_global_invalid_addr_space : Error<
@@ -8971,6 +8981,9 @@ def warn_nullability_lost : Warning<
"implicit conversion from nullable pointer %0 to non-nullable pointer "
"type %1">,
InGroup<NullableToNonNullConversion>, DefaultIgnore;
+def warn_zero_as_null_pointer_constant : Warning<
+ "zero as null pointer constant">,
+ InGroup<DiagGroup<"zero-as-null-pointer-constant">>, DefaultIgnore;
def err_nullability_cs_multilevel : Error<
"nullability keyword %0 cannot be applied to multi-level pointer type %1">;
Modified: vendor/clang/dist/include/clang/Driver/CC1Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/CC1Options.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Driver/CC1Options.td Mon May 8 17:13:11 2017 (r317951)
@@ -297,6 +297,9 @@ def fsanitize_coverage_trace_pc
def fsanitize_coverage_trace_pc_guard
: Flag<["-"], "fsanitize-coverage-trace-pc-guard">,
HelpText<"Enable PC tracing with guard in sanitizer coverage">;
+def fsanitize_coverage_no_prune
+ : Flag<["-"], "fsanitize-coverage-no-prune">,
+ HelpText<"Disable coverage pruning (i.e. instrument all blocks/edges)">;
def fprofile_instrument_EQ : Joined<["-"], "fprofile-instrument=">,
HelpText<"Enable PGO instrumentation. The accepted value is clang, llvm, "
"or none">;
Modified: vendor/clang/dist/include/clang/Driver/Distro.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Distro.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Driver/Distro.h Mon May 8 17:13:11 2017 (r317951)
@@ -57,6 +57,7 @@ public:
UbuntuXenial,
UbuntuYakkety,
UbuntuZesty,
+ UbuntuArtful,
UnknownDistro
};
@@ -110,9 +111,9 @@ public:
}
bool IsUbuntu() const {
- return DistroVal >= UbuntuHardy && DistroVal <= UbuntuZesty;
+ return DistroVal >= UbuntuHardy && DistroVal <= UbuntuArtful;
}
-
+
/// @}
};
Modified: vendor/clang/dist/include/clang/Driver/Multilib.h
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Multilib.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Driver/Multilib.h Mon May 8 17:13:11 2017 (r317951)
@@ -70,13 +70,21 @@ public:
/// All elements begin with either '+' or '-'
const flags_list &flags() const { return Flags; }
flags_list &flags() { return Flags; }
+
/// Add a flag to the flags list
+ /// \p Flag must be a flag accepted by the driver with its leading '-' removed,
+ /// and replaced with either:
+ /// '-' which contraindicates using this multilib with that flag
+ /// or:
+ /// '+' which promotes using this multilib in the presence of that flag
+ /// otherwise '-print-multi-lib' will not emit them correctly.
Multilib &flag(StringRef F) {
assert(F.front() == '+' || F.front() == '-');
Flags.push_back(F);
return *this;
}
+ LLVM_DUMP_METHOD void dump() const;
/// \brief print summary of the Multilib
void print(raw_ostream &OS) const;
@@ -150,6 +158,7 @@ public:
unsigned size() const { return Multilibs.size(); }
+ LLVM_DUMP_METHOD void dump() const;
void print(raw_ostream &OS) const;
MultilibSet &setIncludeDirsCallback(IncludeDirsFunc F) {
Modified: vendor/clang/dist/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.td Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Driver/Options.td Mon May 8 17:13:11 2017 (r317951)
@@ -1688,6 +1688,8 @@ def mllvm : Separate<["-"], "mllvm">, Fl
HelpText<"Additional arguments to forward to LLVM's option processing">;
def mmacosx_version_min_EQ : Joined<["-"], "mmacosx-version-min=">,
Group<m_Group>, HelpText<"Set Mac OS X deployment target">;
+def mmacos_version_min_EQ : Joined<["-"], "mmacos-version-min=">,
+ Group<m_Group>, Alias<mmacosx_version_min_EQ>;
def mms_bitfields : Flag<["-"], "mms-bitfields">, Group<m_Group>, Flags<[CC1Option]>,
HelpText<"Set the default structure layout to be compatible with the Microsoft compiler standard">;
def mno_ms_bitfields : Flag<["-"], "mno-ms-bitfields">, Group<m_Group>,
@@ -1750,6 +1752,7 @@ def mno_bmi : Flag<["-"], "mno-bmi">, Gr
def mno_bmi2 : Flag<["-"], "mno-bmi2">, Group<m_x86_Features_Group>;
def mno_popcnt : Flag<["-"], "mno-popcnt">, Group<m_x86_Features_Group>;
def mno_tbm : Flag<["-"], "mno-tbm">, Group<m_x86_Features_Group>;
+def mno_lwp : Flag<["-"], "mno-lwp">, Group<m_x86_Features_Group>;
def mno_fma4 : Flag<["-"], "mno-fma4">, Group<m_x86_Features_Group>;
def mno_fma : Flag<["-"], "mno-fma">, Group<m_x86_Features_Group>;
def mno_xop : Flag<["-"], "mno-xop">, Group<m_x86_Features_Group>;
@@ -1949,6 +1952,7 @@ def mbmi : Flag<["-"], "mbmi">, Group<m_
def mbmi2 : Flag<["-"], "mbmi2">, Group<m_x86_Features_Group>;
def mpopcnt : Flag<["-"], "mpopcnt">, Group<m_x86_Features_Group>;
def mtbm : Flag<["-"], "mtbm">, Group<m_x86_Features_Group>;
+def mlwp : Flag<["-"], "mlwp">, Group<m_x86_Features_Group>;
def mfma4 : Flag<["-"], "mfma4">, Group<m_x86_Features_Group>;
def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>;
def mxop : Flag<["-"], "mxop">, Group<m_x86_Features_Group>;
Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Mon May 8 17:13:11 2017 (r317951)
@@ -160,6 +160,7 @@ CODEGENOPT(SanitizeCoverageTracePC, 1, 0
///< in sanitizer coverage.
CODEGENOPT(SanitizeCoverageTracePCGuard, 1, 0) ///< Enable PC tracing with guard
///< in sanitizer coverage.
+CODEGENOPT(SanitizeCoverageNoPrune, 1, 0) ///< Disable coverage pruning.
CODEGENOPT(SanitizeStats , 1, 0) ///< Collect statistics for sanitizers.
CODEGENOPT(SimplifyLibCalls , 1, 1) ///< Set when -fbuiltin is enabled.
CODEGENOPT(SoftFloat , 1, 0) ///< -soft-float.
Modified: vendor/clang/dist/include/clang/Frontend/FrontendAction.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/FrontendAction.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Frontend/FrontendAction.h Mon May 8 17:13:11 2017 (r317951)
@@ -146,6 +146,8 @@ public:
return *CurrentASTUnit;
}
+ Module *getCurrentModule() const;
+
std::unique_ptr<ASTUnit> takeCurrentASTUnit() {
return std::move(CurrentASTUnit);
}
Modified: vendor/clang/dist/include/clang/Lex/HeaderSearch.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/HeaderSearch.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Lex/HeaderSearch.h Mon May 8 17:13:11 2017 (r317951)
@@ -538,9 +538,15 @@ public:
///
/// \param File The module map file.
/// \param IsSystem Whether this file is in a system header directory.
+ /// \param ID If the module map file is already mapped (perhaps as part of
+ /// processing a preprocessed module), the ID of the file.
+ /// \param Offset [inout] An offset within ID to start parsing. On exit,
+ /// filled by the end of the parsed contents (either EOF or the
+ /// location of an end-of-module-map pragma).
///
/// \returns true if an error occurred, false otherwise.
- bool loadModuleMapFile(const FileEntry *File, bool IsSystem);
+ bool loadModuleMapFile(const FileEntry *File, bool IsSystem,
+ FileID ID = FileID(), unsigned *Offset = nullptr);
/// \brief Collect the set of all known, top-level modules.
///
@@ -686,7 +692,9 @@ private:
LoadModuleMapResult loadModuleMapFileImpl(const FileEntry *File,
bool IsSystem,
- const DirectoryEntry *Dir);
+ const DirectoryEntry *Dir,
+ FileID ID = FileID(),
+ unsigned *Offset = nullptr);
/// \brief Try to load the module map file in the given directory.
///
Modified: vendor/clang/dist/include/clang/Lex/Lexer.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/Lexer.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Lex/Lexer.h Mon May 8 17:13:11 2017 (r317951)
@@ -478,6 +478,11 @@ public:
return getCharAndSizeSlowNoWarn(Ptr, Size, LangOpts);
}
+ /// Returns the leading whitespace for line that corresponds to the given
+ /// location \p Loc.
+ static StringRef getIndentationForLine(SourceLocation Loc,
+ const SourceManager &SM);
+
//===--------------------------------------------------------------------===//
// Internal implementation interfaces.
private:
Modified: vendor/clang/dist/include/clang/Lex/ModuleMap.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/ModuleMap.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Lex/ModuleMap.h Mon May 8 17:13:11 2017 (r317951)
@@ -546,14 +546,20 @@ public:
/// \param HomeDir The directory in which relative paths within this module
/// map file will be resolved.
///
+ /// \param ID The FileID of the file to process, if we've already entered it.
+ ///
+ /// \param Offset [inout] On input the offset at which to start parsing. On
+ /// output, the offset at which the module map terminated.
+ ///
/// \param ExternModuleLoc The location of the "extern module" declaration
/// that caused us to load this module map file, if any.
///
/// \returns true if an error occurred, false otherwise.
bool parseModuleMapFile(const FileEntry *File, bool IsSystem,
- const DirectoryEntry *HomeDir,
+ const DirectoryEntry *HomeDir, FileID ID = FileID(),
+ unsigned *Offset = nullptr,
SourceLocation ExternModuleLoc = SourceLocation());
-
+
/// \brief Dump the contents of the module map, for debugging purposes.
void dump();
Modified: vendor/clang/dist/include/clang/Lex/Preprocessor.h
==============================================================================
--- vendor/clang/dist/include/clang/Lex/Preprocessor.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Lex/Preprocessor.h Mon May 8 17:13:11 2017 (r317951)
@@ -324,7 +324,7 @@ class Preprocessor {
/// \brief If the current lexer is for a submodule that is being built, this
/// is that submodule.
- Module *CurSubmodule;
+ Module *CurLexerSubmodule;
/// \brief Keeps track of the stack of files currently
/// \#included, and macros currently being expanded from, not counting
@@ -507,16 +507,19 @@ class Preprocessor {
/// \brief Information about a submodule that we're currently building.
struct BuildingSubmoduleInfo {
- BuildingSubmoduleInfo(Module *M, SourceLocation ImportLoc,
+ BuildingSubmoduleInfo(Module *M, SourceLocation ImportLoc, bool IsPragma,
SubmoduleState *OuterSubmoduleState,
unsigned OuterPendingModuleMacroNames)
- : M(M), ImportLoc(ImportLoc), OuterSubmoduleState(OuterSubmoduleState),
+ : M(M), ImportLoc(ImportLoc), IsPragma(IsPragma),
+ OuterSubmoduleState(OuterSubmoduleState),
OuterPendingModuleMacroNames(OuterPendingModuleMacroNames) {}
/// The module that we are building.
Module *M;
/// The location at which the module was included.
SourceLocation ImportLoc;
+ /// Whether we entered this submodule via a pragma.
+ bool IsPragma;
/// The previous SubmoduleState.
SubmoduleState *OuterSubmoduleState;
/// The number of pending module macro names when we started building this.
@@ -773,8 +776,9 @@ public:
/// expansions going on at the time.
PreprocessorLexer *getCurrentFileLexer() const;
- /// \brief Return the submodule owning the file being lexed.
- Module *getCurrentSubmodule() const { return CurSubmodule; }
+ /// \brief Return the submodule owning the file being lexed. This may not be
+ /// the current module if we have changed modules since entering the file.
+ Module *getCurrentLexerSubmodule() const { return CurLexerSubmodule; }
/// \brief Returns the FileID for the preprocessor predefines.
FileID getPredefinesFileID() const { return PredefinesFileID; }
@@ -1726,13 +1730,16 @@ public:
bool CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef,
bool *ShadowFlag = nullptr);
-private:
+ void EnterSubmodule(Module *M, SourceLocation ImportLoc, bool ForPragma);
+ Module *LeaveSubmodule(bool ForPragma);
+private:
void PushIncludeMacroStack() {
assert(CurLexerKind != CLK_CachingLexer && "cannot push a caching lexer");
- IncludeMacroStack.emplace_back(
- CurLexerKind, CurSubmodule, std::move(CurLexer), std::move(CurPTHLexer),
- CurPPLexer, std::move(CurTokenLexer), CurDirLookup);
+ IncludeMacroStack.emplace_back(CurLexerKind, CurLexerSubmodule,
+ std::move(CurLexer), std::move(CurPTHLexer),
+ CurPPLexer, std::move(CurTokenLexer),
+ CurDirLookup);
CurPPLexer = nullptr;
}
@@ -1742,16 +1749,13 @@ private:
CurPPLexer = IncludeMacroStack.back().ThePPLexer;
CurTokenLexer = std::move(IncludeMacroStack.back().TheTokenLexer);
CurDirLookup = IncludeMacroStack.back().TheDirLookup;
- CurSubmodule = IncludeMacroStack.back().TheSubmodule;
+ CurLexerSubmodule = IncludeMacroStack.back().TheSubmodule;
CurLexerKind = IncludeMacroStack.back().CurLexerKind;
IncludeMacroStack.pop_back();
}
void PropagateLineStartLeadingSpaceInfo(Token &Result);
- void EnterSubmodule(Module *M, SourceLocation ImportLoc);
- void LeaveSubmodule();
-
/// Determine whether we need to create module macros for #defines in the
/// current context.
bool needModuleMacros() const;
@@ -1967,7 +1971,6 @@ public:
void HandlePragmaPoison();
void HandlePragmaSystemHeader(Token &SysHeaderTok);
void HandlePragmaDependency(Token &DependencyTok);
- void HandlePragmaModuleImport(Token &Tok);
void HandlePragmaPushMacro(Token &Tok);
void HandlePragmaPopMacro(Token &Tok);
void HandlePragmaIncludeAlias(Token &Tok);
Modified: vendor/clang/dist/include/clang/Sema/Sema.h
==============================================================================
--- vendor/clang/dist/include/clang/Sema/Sema.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Sema/Sema.h Mon May 8 17:13:11 2017 (r317951)
@@ -3766,6 +3766,9 @@ public:
void diagnoseNullableToNonnullConversion(QualType DstType, QualType SrcType,
SourceLocation Loc);
+ /// Warn when implicitly casting 0 to nullptr.
+ void diagnoseZeroToNullptrConversion(CastKind Kind, const Expr *E);
+
ParsingDeclState PushParsingDeclaration(sema::DelayedDiagnosticPool &pool) {
return DelayedDiagnostics.push(pool);
}
Modified: vendor/clang/dist/include/clang/Tooling/FixIt.h
==============================================================================
--- vendor/clang/dist/include/clang/Tooling/FixIt.h Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/include/clang/Tooling/FixIt.h Mon May 8 17:13:11 2017 (r317951)
@@ -65,6 +65,13 @@ FixItHint createReplacement(const D &Des
getText(Source, Context));
}
+// \brief Returns a FixItHint to replace \p Destination by \p Source.
+template <typename D>
+FixItHint createReplacement(const D &Destination, StringRef Source) {
+ return FixItHint::CreateReplacement(internal::getSourceRange(Destination),
+ Source);
+}
+
} // end namespace fixit
} // end namespace tooling
} // end namespace clang
Modified: vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp
==============================================================================
--- vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -153,6 +153,7 @@ RegistryMaps::RegistryMaps() {
REGISTER_MATCHER(cxxRecordDecl);
REGISTER_MATCHER(cxxReinterpretCastExpr);
REGISTER_MATCHER(cxxStaticCastExpr);
+ REGISTER_MATCHER(cxxStdInitializerListExpr);
REGISTER_MATCHER(cxxTemporaryObjectExpr);
REGISTER_MATCHER(cxxThisExpr);
REGISTER_MATCHER(cxxThrowExpr);
Modified: vendor/clang/dist/lib/Basic/Diagnostic.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Diagnostic.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/Basic/Diagnostic.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -146,10 +146,9 @@ void DiagnosticsEngine::SetDelayedDiagno
}
void DiagnosticsEngine::ReportDelayed() {
- Report(DelayedDiagID) << DelayedDiagArg1 << DelayedDiagArg2;
+ unsigned ID = DelayedDiagID;
DelayedDiagID = 0;
- DelayedDiagArg1.clear();
- DelayedDiagArg2.clear();
+ Report(ID) << DelayedDiagArg1 << DelayedDiagArg2;
}
void DiagnosticsEngine::DiagStateMap::appendFirst(
@@ -420,11 +419,10 @@ bool DiagnosticsEngine::EmitCurrentDiagn
}
// Clear out the current diagnostic object.
- unsigned DiagID = CurDiagID;
Clear();
// If there was a delayed diagnostic, emit it now.
- if (!Force && DelayedDiagID && DelayedDiagID != DiagID)
+ if (!Force && DelayedDiagID)
ReportDelayed();
return Emitted;
Modified: vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/Basic/DiagnosticIDs.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -666,6 +666,10 @@ bool DiagnosticIDs::ProcessDiag(Diagnost
}
}
+ // Make sure we set FatalErrorOccurred to ensure that the notes from the
+ // diagnostic that caused `fatal_too_many_errors` won't be emitted.
+ if (Diag.CurDiagID == diag::fatal_too_many_errors)
+ Diag.FatalErrorOccurred = true;
// Finally, report it.
EmitDiag(Diag, DiagLevel);
return true;
Modified: vendor/clang/dist/lib/Basic/Targets.cpp
==============================================================================
--- vendor/clang/dist/lib/Basic/Targets.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/Basic/Targets.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -2591,6 +2591,7 @@ class X86TargetInfo : public TargetInfo
bool HasRDSEED = false;
bool HasADX = false;
bool HasTBM = false;
+ bool HasLWP = false;
bool HasFMA = false;
bool HasF16C = false;
bool HasAVX512CD = false;
@@ -3363,6 +3364,7 @@ bool X86TargetInfo::initFeatureMap(
case CK_BDVER1:
// xop implies avx, sse4a and fma4.
setFeatureEnabledImpl(Features, "xop", true);
+ setFeatureEnabledImpl(Features, "lwp", true);
setFeatureEnabledImpl(Features, "lzcnt", true);
setFeatureEnabledImpl(Features, "aes", true);
setFeatureEnabledImpl(Features, "pclmul", true);
@@ -3634,6 +3636,8 @@ bool X86TargetInfo::handleTargetFeatures
HasADX = true;
} else if (Feature == "+tbm") {
HasTBM = true;
+ } else if (Feature == "+lwp") {
+ HasLWP = true;
} else if (Feature == "+fma") {
HasFMA = true;
} else if (Feature == "+f16c") {
@@ -3949,6 +3953,9 @@ void X86TargetInfo::getTargetDefines(con
if (HasTBM)
Builder.defineMacro("__TBM__");
+ if (HasLWP)
+ Builder.defineMacro("__LWP__");
+
if (HasMWAITX)
Builder.defineMacro("__MWAITX__");
@@ -4132,6 +4139,7 @@ bool X86TargetInfo::hasFeature(StringRef
.Case("sse4.2", SSELevel >= SSE42)
.Case("sse4a", XOPLevel >= SSE4A)
.Case("tbm", HasTBM)
+ .Case("lwp", HasLWP)
.Case("x86", true)
.Case("x86_32", getTriple().getArch() == llvm::Triple::x86)
.Case("x86_64", getTriple().getArch() == llvm::Triple::x86_64)
@@ -5443,6 +5451,7 @@ public:
.Case("softfloat", SoftFloat)
.Case("thumb", isThumb())
.Case("neon", (FPU & NeonFPU) && !SoftFloat)
+ .Case("vfp", FPU && !SoftFloat)
.Case("hwdiv", HWDiv & HWDivThumb)
.Case("hwdiv-arm", HWDiv & HWDivARM)
.Default(false);
Modified: vendor/clang/dist/lib/CodeGen/BackendUtil.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/CodeGen/BackendUtil.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -185,6 +185,7 @@ static void addSanitizerCoveragePass(con
Opts.Use8bitCounters = CGOpts.SanitizeCoverage8bitCounters;
Opts.TracePC = CGOpts.SanitizeCoverageTracePC;
Opts.TracePCGuard = CGOpts.SanitizeCoverageTracePCGuard;
+ Opts.NoPrune = CGOpts.SanitizeCoverageNoPrune;
PM.add(createSanitizerCoverageModulePass(Opts));
}
@@ -974,10 +975,14 @@ static void runThinLTOBackend(ModuleSumm
// via a WriteIndexesThinBackend.
FunctionImporter::ImportMapTy ImportList;
for (auto &GlobalList : *CombinedIndex) {
+ // Ignore entries for undefined references.
+ if (GlobalList.second.SummaryList.empty())
+ continue;
+
auto GUID = GlobalList.first;
- assert(GlobalList.second.size() == 1 &&
+ assert(GlobalList.second.SummaryList.size() == 1 &&
"Expected individual combined index to have one summary per GUID");
- auto &Summary = GlobalList.second[0];
+ auto &Summary = GlobalList.second.SummaryList[0];
// Skip the summaries for the importing module. These are included to
// e.g. record required linkage changes.
if (Summary->modulePath() == M->getModuleIdentifier())
Modified: vendor/clang/dist/lib/CodeGen/CGBlocks.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGBlocks.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/CodeGen/CGBlocks.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -623,9 +623,13 @@ static void enterBlockScope(CodeGenFunct
// For const-qualified captures, emit clang.arc.use to ensure the captured
// object doesn't get released while we are still depending on its validity
// within the block.
- if (VT.isConstQualified() && VT.getObjCLifetime() == Qualifiers::OCL_Strong)
+ if (VT.isConstQualified() &&
+ VT.getObjCLifetime() == Qualifiers::OCL_Strong &&
+ CGF.CGM.getCodeGenOpts().OptimizationLevel != 0) {
+ assert(CGF.CGM.getLangOpts().ObjCAutoRefCount &&
+ "expected ObjC ARC to be enabled");
destroyer = CodeGenFunction::emitARCIntrinsicUse;
- else if (dtorKind == QualType::DK_objc_strong_lifetime) {
+ } else if (dtorKind == QualType::DK_objc_strong_lifetime) {
destroyer = CodeGenFunction::destroyARCStrongImprecise;
} else {
destroyer = CGF.getDestroyer(dtorKind);
Modified: vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -2751,7 +2751,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(
// Push a clang.arc.use cleanup for each object in RetainableOperands. The
// cleanup will cause the use to appear after the final log call, keeping
- // the object valid while it’s held in the log buffer. Note that if there’s
+ // the object valid while it's held in the log buffer. Note that if there's
// a release cleanup on the object, it will already be active; since
// cleanups are emitted in reverse order, the use will occur before the
// object is released.
Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Mon May 8 17:13:05 2017 (r317950)
+++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp Mon May 8 17:13:11 2017 (r317951)
@@ -658,34 +658,42 @@ void CodeGenFunction::EmitOpenCLKernelMe
GenOpenCLArgMetadata(FD, Fn, CGM, Context, Builder, getContext());
if (const VecTypeHintAttr *A = FD->getAttr<VecTypeHintAttr>()) {
- QualType hintQTy = A->getTypeHint();
- const ExtVectorType *hintEltQTy = hintQTy->getAs<ExtVectorType>();
- bool isSignedInteger =
- hintQTy->isSignedIntegerType() ||
- (hintEltQTy && hintEltQTy->getElementType()->isSignedIntegerType());
- llvm::Metadata *attrMDArgs[] = {
+ QualType HintQTy = A->getTypeHint();
+ const ExtVectorType *HintEltQTy = HintQTy->getAs<ExtVectorType>();
+ bool IsSignedInteger =
+ HintQTy->isSignedIntegerType() ||
+ (HintEltQTy && HintEltQTy->getElementType()->isSignedIntegerType());
+ llvm::Metadata *AttrMDArgs[] = {
llvm::ConstantAsMetadata::get(llvm::UndefValue::get(
CGM.getTypes().ConvertType(A->getTypeHint()))),
llvm::ConstantAsMetadata::get(llvm::ConstantInt::get(
llvm::IntegerType::get(Context, 32),
- llvm::APInt(32, (uint64_t)(isSignedInteger ? 1 : 0))))};
- Fn->setMetadata("vec_type_hint", llvm::MDNode::get(Context, attrMDArgs));
+ llvm::APInt(32, (uint64_t)(IsSignedInteger ? 1 : 0))))};
+ Fn->setMetadata("vec_type_hint", llvm::MDNode::get(Context, AttrMDArgs));
}
if (const WorkGroupSizeHintAttr *A = FD->getAttr<WorkGroupSizeHintAttr>()) {
- llvm::Metadata *attrMDArgs[] = {
+ llvm::Metadata *AttrMDArgs[] = {
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getXDim())),
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getYDim())),
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getZDim()))};
- Fn->setMetadata("work_group_size_hint", llvm::MDNode::get(Context, attrMDArgs));
+ Fn->setMetadata("work_group_size_hint", llvm::MDNode::get(Context, AttrMDArgs));
}
if (const ReqdWorkGroupSizeAttr *A = FD->getAttr<ReqdWorkGroupSizeAttr>()) {
- llvm::Metadata *attrMDArgs[] = {
+ llvm::Metadata *AttrMDArgs[] = {
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getXDim())),
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getYDim())),
llvm::ConstantAsMetadata::get(Builder.getInt32(A->getZDim()))};
- Fn->setMetadata("reqd_work_group_size", llvm::MDNode::get(Context, attrMDArgs));
+ Fn->setMetadata("reqd_work_group_size", llvm::MDNode::get(Context, AttrMDArgs));
+ }
+
+ if (const OpenCLIntelReqdSubGroupSizeAttr *A =
+ FD->getAttr<OpenCLIntelReqdSubGroupSizeAttr>()) {
+ llvm::Metadata *AttrMDArgs[] = {
+ llvm::ConstantAsMetadata::get(Builder.getInt32(A->getSubGroupSize()))};
+ Fn->setMetadata("intel_reqd_sub_group_size",
+ llvm::MDNode::get(Context, AttrMDArgs));
}
}
Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.h
==============================================================================
--- vendor/clang/dist/lib/CodeGen/CodeGenFunction.h Mon May 8 17:13:05 2017 (r317950)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-all
mailing list