svn commit: r319782 - in vendor/clang/dist: bindings/python/clang bindings/python/tests/cindex docs include/clang-c include/clang/AST include/clang/ASTMatchers include/clang/ASTMatchers/Dynamic inc...
Dimitry Andric
dim at FreeBSD.org
Sat Jun 10 13:44:27 UTC 2017
Author: dim
Date: Sat Jun 10 13:44:22 2017
New Revision: 319782
URL: https://svnweb.freebsd.org/changeset/base/319782
Log:
Vendor import of clang trunk r305145:
https://llvm.org/svn/llvm-project/cfe/trunk@305145
Added:
vendor/clang/dist/test/Analysis/nullability-notes.m
vendor/clang/dist/test/CodeGen/arm-target-attr.c (contents, props changed)
vendor/clang/dist/test/CodeGen/arm-thumb-mode-target-feature.c (contents, props changed)
vendor/clang/dist/test/CodeGen/mips-madd4.c (contents, props changed)
vendor/clang/dist/test/CodeGen/neon-aapcs-align.c (contents, props changed)
vendor/clang/dist/test/CodeGenCXX/clang-sections-tentative.c (contents, props changed)
vendor/clang/dist/test/CodeGenCXX/clang-sections.cpp (contents, props changed)
vendor/clang/dist/test/CodeGenObjC/sections.m
vendor/clang/dist/test/FixIt/fixit-format-darwin.m
vendor/clang/dist/test/Headers/ms-cppoperkey.cpp (contents, props changed)
vendor/clang/dist/test/Headers/ms-cppoperkey1.cpp (contents, props changed)
vendor/clang/dist/test/Headers/ms-cppoperkey2.cpp (contents, props changed)
vendor/clang/dist/test/Index/pipe-size.cl
vendor/clang/dist/test/Index/singe-file-parse.m
vendor/clang/dist/test/Modules/Inputs/crash-typo-correction-visibility/
vendor/clang/dist/test/Modules/Inputs/crash-typo-correction-visibility/module.h (contents, props changed)
vendor/clang/dist/test/Modules/Inputs/crash-typo-correction-visibility/module.modulemap
vendor/clang/dist/test/Modules/crash-typo-correction-visibility.cpp (contents, props changed)
vendor/clang/dist/test/Modules/preprocess-build-diamond.m
vendor/clang/dist/test/Modules/preprocess-build.cpp (contents, props changed)
vendor/clang/dist/test/Sema/ext_vector_ops.c (contents, props changed)
vendor/clang/dist/test/Sema/pragma-clang-section.c (contents, props changed)
vendor/clang/dist/test/SemaCXX/PR27037.cpp (contents, props changed)
Modified:
vendor/clang/dist/bindings/python/clang/cindex.py
vendor/clang/dist/bindings/python/tests/cindex/test_type.py
vendor/clang/dist/docs/ClangFormatStyleOptions.rst
vendor/clang/dist/docs/LanguageExtensions.rst
vendor/clang/dist/docs/LibASTMatchersReference.html
vendor/clang/dist/include/clang-c/Index.h
vendor/clang/dist/include/clang/AST/Decl.h
vendor/clang/dist/include/clang/AST/ExternalASTMerger.h
vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h
vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h
vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Diagnostics.h
vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Parser.h
vendor/clang/dist/include/clang/ASTMatchers/Dynamic/VariantValue.h
vendor/clang/dist/include/clang/Basic/Attr.td
vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td
vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td
vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td
vendor/clang/dist/include/clang/Basic/LangOptions.h
vendor/clang/dist/include/clang/Basic/SourceManager.h
vendor/clang/dist/include/clang/Driver/Options.td
vendor/clang/dist/include/clang/Edit/EditedSource.h
vendor/clang/dist/include/clang/Frontend/ASTUnit.h
vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
vendor/clang/dist/include/clang/Frontend/CompilerInstance.h
vendor/clang/dist/include/clang/Frontend/FrontendAction.h
vendor/clang/dist/include/clang/Frontend/FrontendActions.h
vendor/clang/dist/include/clang/Frontend/PreprocessorOutputOptions.h
vendor/clang/dist/include/clang/Lex/ModuleLoader.h
vendor/clang/dist/include/clang/Lex/Preprocessor.h
vendor/clang/dist/include/clang/Lex/PreprocessorOptions.h
vendor/clang/dist/include/clang/Parse/Parser.h
vendor/clang/dist/include/clang/Rewrite/Frontend/FrontendActions.h
vendor/clang/dist/include/clang/Sema/Overload.h
vendor/clang/dist/include/clang/Sema/Sema.h
vendor/clang/dist/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
vendor/clang/dist/include/clang/Tooling/Tooling.h
vendor/clang/dist/lib/AST/ASTContext.cpp
vendor/clang/dist/lib/AST/ASTImporter.cpp
vendor/clang/dist/lib/AST/CMakeLists.txt
vendor/clang/dist/lib/AST/Decl.cpp
vendor/clang/dist/lib/AST/DeclObjC.cpp
vendor/clang/dist/lib/AST/ODRHash.cpp
vendor/clang/dist/lib/AST/StmtProfile.cpp
vendor/clang/dist/lib/AST/Type.cpp
vendor/clang/dist/lib/ASTMatchers/Dynamic/Diagnostics.cpp
vendor/clang/dist/lib/ASTMatchers/Dynamic/Marshallers.h
vendor/clang/dist/lib/ASTMatchers/Dynamic/Parser.cpp
vendor/clang/dist/lib/ASTMatchers/Dynamic/Registry.cpp
vendor/clang/dist/lib/ASTMatchers/Dynamic/VariantValue.cpp
vendor/clang/dist/lib/Basic/SourceManager.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/CGCXXABI.cpp
vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp
vendor/clang/dist/lib/CodeGen/CGDecl.cpp
vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp
vendor/clang/dist/lib/CodeGen/CGException.cpp
vendor/clang/dist/lib/CodeGen/CGExpr.cpp
vendor/clang/dist/lib/CodeGen/CGObjC.cpp
vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp
vendor/clang/dist/lib/CodeGen/CGOpenMPRuntime.cpp
vendor/clang/dist/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp
vendor/clang/dist/lib/CodeGen/CodeGenFunction.cpp
vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp
vendor/clang/dist/lib/CodeGen/ItaniumCXXABI.cpp
vendor/clang/dist/lib/CodeGen/MicrosoftCXXABI.cpp
vendor/clang/dist/lib/Driver/CMakeLists.txt
vendor/clang/dist/lib/Driver/Driver.cpp
vendor/clang/dist/lib/Driver/SanitizerArgs.cpp
vendor/clang/dist/lib/Driver/ToolChains/Arch/Mips.cpp
vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp
vendor/clang/dist/lib/Driver/ToolChains/Linux.cpp
vendor/clang/dist/lib/Driver/ToolChains/MSVC.cpp
vendor/clang/dist/lib/Edit/EditedSource.cpp
vendor/clang/dist/lib/Format/ContinuationIndenter.cpp
vendor/clang/dist/lib/Format/TokenAnnotator.cpp
vendor/clang/dist/lib/Format/WhitespaceManager.cpp
vendor/clang/dist/lib/Frontend/ASTMerge.cpp
vendor/clang/dist/lib/Frontend/ASTUnit.cpp
vendor/clang/dist/lib/Frontend/CompilerInstance.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/Rewrite/CMakeLists.txt
vendor/clang/dist/lib/Frontend/Rewrite/FrontendActions.cpp
vendor/clang/dist/lib/FrontendTool/ExecuteCompilerInvocation.cpp
vendor/clang/dist/lib/Headers/avxintrin.h
vendor/clang/dist/lib/Headers/bmiintrin.h
vendor/clang/dist/lib/Headers/emmintrin.h
vendor/clang/dist/lib/Headers/xmmintrin.h
vendor/clang/dist/lib/Lex/PPDirectives.cpp
vendor/clang/dist/lib/Lex/Pragma.cpp
vendor/clang/dist/lib/Lex/Preprocessor.cpp
vendor/clang/dist/lib/Parse/ParseDeclCXX.cpp
vendor/clang/dist/lib/Parse/ParsePragma.cpp
vendor/clang/dist/lib/Sema/SemaAttr.cpp
vendor/clang/dist/lib/Sema/SemaCodeComplete.cpp
vendor/clang/dist/lib/Sema/SemaDecl.cpp
vendor/clang/dist/lib/Sema/SemaDeclCXX.cpp
vendor/clang/dist/lib/Sema/SemaExpr.cpp
vendor/clang/dist/lib/Sema/SemaExprCXX.cpp
vendor/clang/dist/lib/Sema/SemaLookup.cpp
vendor/clang/dist/lib/Sema/SemaOverload.cpp
vendor/clang/dist/lib/Sema/SemaStmt.cpp
vendor/clang/dist/lib/Sema/SemaTemplate.cpp
vendor/clang/dist/lib/Sema/SemaTemplateDeduction.cpp
vendor/clang/dist/lib/Sema/SemaTemplateInstantiate.cpp
vendor/clang/dist/lib/Sema/SemaTemplateInstantiateDecl.cpp
vendor/clang/dist/lib/Sema/SemaType.cpp
vendor/clang/dist/lib/Serialization/ASTReader.cpp
vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp
vendor/clang/dist/lib/Serialization/ASTWriter.cpp
vendor/clang/dist/lib/Serialization/ASTWriterDecl.cpp
vendor/clang/dist/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
vendor/clang/dist/lib/StaticAnalyzer/Core/BugReporter.cpp
vendor/clang/dist/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
vendor/clang/dist/test/CXX/dcl.dcl/dcl.spec/dcl.fct.spec/p4.cpp
vendor/clang/dist/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p4.cpp
vendor/clang/dist/test/CXX/drs/dr13xx.cpp
vendor/clang/dist/test/CXX/temp/temp.decls/temp.mem/p5.cpp
vendor/clang/dist/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p4.cpp
vendor/clang/dist/test/CodeGen/arm-long-calls.c
vendor/clang/dist/test/CodeGen/arm-no-movt.c
vendor/clang/dist/test/CodeGen/arm-target-features.c
vendor/clang/dist/test/CodeGen/captured-statements.c
vendor/clang/dist/test/CodeGenCXX/captured-statements.cpp
vendor/clang/dist/test/CodeGenObjC/exceptions-asm-attribute.m
vendor/clang/dist/test/CodeGenObjC/image-info.m
vendor/clang/dist/test/CodeGenObjC/metadata-symbols-64.m
vendor/clang/dist/test/CodeGenObjC/metadata_symbols.m
vendor/clang/dist/test/CodeGenObjC/non-lazy-classes.m
vendor/clang/dist/test/Driver/baremetal.cpp
vendor/clang/dist/test/Driver/cl-link.c
vendor/clang/dist/test/Driver/fsanitize-coverage.c
vendor/clang/dist/test/Driver/fsanitize.c
vendor/clang/dist/test/FixIt/fixit.c
vendor/clang/dist/test/Modules/preprocess-module.cpp
vendor/clang/dist/test/Modules/requires-coroutines.mm
vendor/clang/dist/test/Modules/requires-gnuinlineasm.m
vendor/clang/dist/test/Modules/requires.m
vendor/clang/dist/test/Modules/requires.mm
vendor/clang/dist/test/Preprocessor/init.c
vendor/clang/dist/test/Sema/2010-05-31-palignr.c
vendor/clang/dist/test/SemaCXX/cxx0x-cursory-default-delete.cpp
vendor/clang/dist/test/SemaCXX/cxx1y-generic-lambdas-capturing.cpp
vendor/clang/dist/test/SemaCXX/cxx1z-class-template-argument-deduction.cpp
vendor/clang/dist/test/SemaCXX/cxx1z-noexcept-function-type.cpp
vendor/clang/dist/test/SemaTemplate/deduction.cpp
vendor/clang/dist/test/SemaTemplate/dependent-template-recover.cpp
vendor/clang/dist/test/SemaTemplate/temp_arg_type.cpp
vendor/clang/dist/tools/c-index-test/c-index-test.c
vendor/clang/dist/tools/clang-check/ClangCheck.cpp
vendor/clang/dist/tools/clang-format/ClangFormat.cpp
vendor/clang/dist/tools/clang-offload-bundler/ClangOffloadBundler.cpp
vendor/clang/dist/tools/driver/cc1as_main.cpp
vendor/clang/dist/tools/libclang/CIndex.cpp
vendor/clang/dist/tools/libclang/CXType.cpp
vendor/clang/dist/tools/libclang/libclang.exports
vendor/clang/dist/unittests/ASTMatchers/Dynamic/ParserTest.cpp
vendor/clang/dist/unittests/ASTMatchers/Dynamic/RegistryTest.cpp
vendor/clang/dist/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp
vendor/clang/dist/unittests/Basic/SourceManagerTest.cpp
vendor/clang/dist/unittests/Format/FormatTestComments.cpp
vendor/clang/dist/unittests/Format/FormatTestJS.cpp
vendor/clang/dist/unittests/Frontend/FrontendActionTest.cpp
vendor/clang/dist/unittests/Lex/LexerTest.cpp
vendor/clang/dist/unittests/Lex/PPCallbacksTest.cpp
vendor/clang/dist/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
vendor/clang/dist/unittests/Tooling/CommentHandlerTest.cpp
vendor/clang/dist/unittests/Tooling/ToolingTest.cpp
Modified: vendor/clang/dist/bindings/python/clang/cindex.py
==============================================================================
--- vendor/clang/dist/bindings/python/clang/cindex.py Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/bindings/python/clang/cindex.py Sat Jun 10 13:44:22 2017 (r319782)
@@ -2162,6 +2162,12 @@ class Type(Structure):
return conf.lib.clang_isFunctionTypeVariadic(self)
+ def get_address_space(self):
+ return conf.lib.clang_getAddressSpace(self)
+
+ def get_typedef_name(self):
+ return conf.lib.clang_getTypedefName(self)
+
def is_pod(self):
"""Determine whether this Type represents plain old data (POD)."""
return conf.lib.clang_isPODType(self)
@@ -3664,6 +3670,11 @@ functionList = [
[Cursor],
Type,
Type.from_result),
+
+ ("clang_getTypedefName",
+ [Type],
+ _CXString,
+ _CXString.from_result),
("clang_getTypeKindSpelling",
[c_uint],
Modified: vendor/clang/dist/bindings/python/tests/cindex/test_type.py
==============================================================================
--- vendor/clang/dist/bindings/python/tests/cindex/test_type.py Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/bindings/python/tests/cindex/test_type.py Sat Jun 10 13:44:22 2017 (r319782)
@@ -37,37 +37,44 @@ def test_a_struct():
assert not fields[0].type.is_const_qualified()
assert fields[0].type.kind == TypeKind.INT
assert fields[0].type.get_canonical().kind == TypeKind.INT
+ assert fields[0].type.get_typedef_name() == ''
assert fields[1].spelling == 'b'
assert not fields[1].type.is_const_qualified()
assert fields[1].type.kind == TypeKind.TYPEDEF
assert fields[1].type.get_canonical().kind == TypeKind.INT
assert fields[1].type.get_declaration().spelling == 'I'
+ assert fields[1].type.get_typedef_name() == 'I'
assert fields[2].spelling == 'c'
assert not fields[2].type.is_const_qualified()
assert fields[2].type.kind == TypeKind.LONG
assert fields[2].type.get_canonical().kind == TypeKind.LONG
+ assert fields[2].type.get_typedef_name() == ''
assert fields[3].spelling == 'd'
assert not fields[3].type.is_const_qualified()
assert fields[3].type.kind == TypeKind.ULONG
assert fields[3].type.get_canonical().kind == TypeKind.ULONG
+ assert fields[3].type.get_typedef_name() == ''
assert fields[4].spelling == 'e'
assert not fields[4].type.is_const_qualified()
assert fields[4].type.kind == TypeKind.LONG
assert fields[4].type.get_canonical().kind == TypeKind.LONG
+ assert fields[4].type.get_typedef_name() == ''
assert fields[5].spelling == 'f'
assert fields[5].type.is_const_qualified()
assert fields[5].type.kind == TypeKind.INT
assert fields[5].type.get_canonical().kind == TypeKind.INT
+ assert fields[5].type.get_typedef_name() == ''
assert fields[6].spelling == 'g'
assert not fields[6].type.is_const_qualified()
assert fields[6].type.kind == TypeKind.POINTER
assert fields[6].type.get_pointee().kind == TypeKind.INT
+ assert fields[6].type.get_typedef_name() == ''
assert fields[7].spelling == 'h'
assert not fields[7].type.is_const_qualified()
@@ -75,6 +82,7 @@ def test_a_struct():
assert fields[7].type.get_pointee().kind == TypeKind.POINTER
assert fields[7].type.get_pointee().get_pointee().kind == TypeKind.POINTER
assert fields[7].type.get_pointee().get_pointee().get_pointee().kind == TypeKind.INT
+ assert fields[7].type.get_typedef_name() == ''
def test_references():
"""Ensure that a Type maintains a reference to a TranslationUnit."""
@@ -404,3 +412,12 @@ def test_decay():
assert a.kind == TypeKind.INCOMPLETEARRAY
assert a.element_type.kind == TypeKind.INT
assert a.get_canonical().kind == TypeKind.INCOMPLETEARRAY
+
+def test_addrspace():
+ """Ensure the address space can be queried"""
+ tu = get_tu('__attribute__((address_space(2))) int testInteger = 3;', 'c')
+
+ testInteger = get_cursor(tu, 'testInteger')
+
+ assert testInteger is not None, "Could not find testInteger."
+ assert testInteger.type.get_address_space() == 2
Modified: vendor/clang/dist/docs/ClangFormatStyleOptions.rst
==============================================================================
--- vendor/clang/dist/docs/ClangFormatStyleOptions.rst Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/docs/ClangFormatStyleOptions.rst Sat Jun 10 13:44:22 2017 (r319782)
@@ -894,7 +894,7 @@ the configuration (without a prefix: ``Auto``).
? firstValue
: SecondValueVeryVeryVeryVeryLong;
- true:
+ false:
veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongDescription ?
firstValue :
SecondValueVeryVeryVeryVeryLong;
Modified: vendor/clang/dist/docs/LanguageExtensions.rst
==============================================================================
--- vendor/clang/dist/docs/LanguageExtensions.rst Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/docs/LanguageExtensions.rst Sat Jun 10 13:44:22 2017 (r319782)
@@ -2521,3 +2521,45 @@ whether or not an attribute is supported by the pragma
The attributes are applied to all matching declarations individually, even when
the attribute is semantically incorrect. The attributes that aren't applied to
any declaration are not verified semantically.
+
+Specifying section names for global objects (#pragma clang section)
+===================================================================
+
+The ``#pragma clang section`` directive provides a means to assign section-names
+to global variables, functions and static variables.
+
+The section names can be specified as:
+
+.. code-block:: c++
+
+ #pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText"
+
+The section names can be reverted back to default name by supplying an empty
+string to the section kind, for example:
+
+.. code-block:: c++
+
+ #pragma clang section bss="" data="" text="" rodata=""
+
+The ``#pragma clang section`` directive obeys the following rules:
+
+* The pragma applies to all global variable, statics and function declarations
+ from the pragma to the end of the translation unit.
+
+* The pragma clang section is enabled automatically, without need of any flags.
+
+* This feature is only defined to work sensibly for ELF targets.
+
+* If section name is specified through _attribute_((section("myname"))), then
+ the attribute name gains precedence.
+
+* Global variables that are initialized to zero will be placed in the named
+ bss section, if one is present.
+
+* The ``#pragma clang section`` directive does not does try to infer section-kind
+ from the name. For example, naming a section "``.bss.mySec``" does NOT mean
+ it will be a bss section name.
+
+* The decision about which section-kind applies to each global is taken in the back-end.
+ Once the section-kind is known, appropriate section name, as specified by the user using
+ ``#pragma clang section`` directive, is applied to that global.
Modified: vendor/clang/dist/docs/LibASTMatchersReference.html
==============================================================================
--- vendor/clang/dist/docs/LibASTMatchersReference.html Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/docs/LibASTMatchersReference.html Sat Jun 10 13:44:22 2017 (r319782)
@@ -1859,17 +1859,36 @@ Example matches a || b (matcher = binaryOperator(hasOp
</pre></td></tr>
-<tr><td>Matcher<CXXBoolLiteral></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT Value</td></tr>
-<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value of type ValueT.
-Example matches true (matcher = cxxBoolLiteral(equals(true)))
- true
+Given
+ f('false, 3.14, 42);
+characterLiteral(equals(0))
+ matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+ match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+ match 3.14
+integerLiteral(equals(42))
+ matches 42
-Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals5')"><a name="equals5Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals5"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals11')"><a name="equals11Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals11"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>></td><td class="name" onclick="toggle('equals8')"><a name="equals8Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals8"><pre></pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>></td><td class="name" onclick="toggle('isCatchAll0')"><a name="isCatchAll0Anchor">isCatchAll</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isCatchAll0"><pre>Matches a C++ catch statement that has a catch-all handler.
@@ -2296,16 +2315,35 @@ Example: matches the implicit cast around 0
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals3')"><a name="equals3Anchor">equals</a></td><td>ValueT Value</td></tr>
-<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value.
+<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value of type ValueT.
-Example matches true (matcher = cxxBoolLiteral(equals(true)))
- true
+Given
+ f('false, 3.14, 42);
+characterLiteral(equals(0))
+ matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+ match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+ match 3.14
+integerLiteral(equals(42))
+ matches 42
-Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals4')"><a name="equals4Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals4"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals10')"><a name="equals10Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals10"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals7')"><a name="equals7Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals7"><pre></pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ClassTemplateSpecializationDecl.html">ClassTemplateSpecializationDecl</a>></td><td class="name" onclick="toggle('templateArgumentCountIs0')"><a name="templateArgumentCountIs0Anchor">templateArgumentCountIs</a></td><td>unsigned N</td></tr>
<tr><td colspan="4" class="doc" id="templateArgumentCountIs0"><pre>Matches if the number of template arguments equals N.
@@ -2533,16 +2571,27 @@ fieldDecl(isBitField())
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals1')"><a name="equals1Anchor">equals</a></td><td>ValueT Value</td></tr>
-<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value.
+<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value of type ValueT.
-Example matches true (matcher = cxxBoolLiteral(equals(true)))
- true
+Given
+ f('false, 3.14, 42);
+characterLiteral(equals(0))
+ matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+ match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+ match 3.14
+integerLiteral(equals(42))
+ matches 42
-Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals12')"><a name="equals12Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals12"><pre></pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasDynamicExceptionSpec0')"><a name="hasDynamicExceptionSpec0Anchor">hasDynamicExceptionSpec</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="hasDynamicExceptionSpec0"><pre>Matches functions that have a dynamic exception specification.
@@ -2805,14 +2854,33 @@ functionProtoType(parameterCountIs(3))
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals0')"><a name="equals0Anchor">equals</a></td><td>ValueT Value</td></tr>
-<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value.
+<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value of type ValueT.
-Example matches true (matcher = cxxBoolLiteral(equals(true)))
- true
+Given
+ f('false, 3.14, 42);
+characterLiteral(equals(0))
+ matches 'cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+ match false
+floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+ match 3.14
+integerLiteral(equals(42))
+ matches 42
-Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
+Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>,
Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>>
</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals6')"><a name="equals6Anchor">equals</a></td><td>bool Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals6"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals13')"><a name="equals13Anchor">equals</a></td><td>double Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals13"><pre></pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals9')"><a name="equals9Anchor">equals</a></td><td>unsigned Value</td></tr>
+<tr><td colspan="4" class="doc" id="equals9"><pre></pre></td></tr>
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>></td><td class="name" onclick="toggle('isArrow0')"><a name="isArrow0Anchor">isArrow</a></td><td></td></tr>
Modified: vendor/clang/dist/include/clang-c/Index.h
==============================================================================
--- vendor/clang/dist/include/clang-c/Index.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang-c/Index.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -32,7 +32,7 @@
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 41
+#define CINDEX_VERSION_MINOR 43
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -1234,7 +1234,12 @@ enum CXTranslationUnit_Flags {
* purposes of an IDE, this is undesirable behavior and as much information
* as possible should be reported. Use this flag to enable this behavior.
*/
- CXTranslationUnit_KeepGoing = 0x200
+ CXTranslationUnit_KeepGoing = 0x200,
+
+ /**
+ * \brief Sets the preprocessor in a mode for parsing a single file only.
+ */
+ CXTranslationUnit_SingleFileParse = 0x400
};
/**
@@ -3415,6 +3420,16 @@ CINDEX_LINKAGE unsigned clang_isVolatileQualifiedType(
* different level.
*/
CINDEX_LINKAGE unsigned clang_isRestrictQualifiedType(CXType T);
+
+/**
+ * \brief Returns the address space of the given type.
+ */
+CINDEX_LINKAGE unsigned clang_getAddressSpace(CXType T);
+
+/**
+ * \brief Returns the typedef name of the given type.
+ */
+CINDEX_LINKAGE CXString clang_getTypedefName(CXType CT);
/**
* \brief For pointer types, returns the type of the pointee.
Modified: vendor/clang/dist/include/clang/AST/Decl.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/Decl.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/AST/Decl.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -851,6 +851,7 @@ class VarDecl : public DeclaratorDecl, public Redeclar
class NonParmVarDeclBitfields {
friend class VarDecl;
+ friend class ImplicitParamDecl;
friend class ASTDeclReader;
unsigned : NumVarDeclBits;
@@ -894,6 +895,10 @@ class VarDecl : public DeclaratorDecl, public Redeclar
/// declared in the same block scope. This controls whether we should merge
/// the type of this declaration with its previous declaration.
unsigned PreviousDeclInSameBlockScope : 1;
+
+ /// Defines kind of the ImplicitParamDecl: 'this', 'self', 'vtt', '_cmd' or
+ /// something else.
+ unsigned ImplicitParamKind : 3;
};
union {
@@ -1376,20 +1381,50 @@ class VarDecl : public DeclaratorDecl, public Redeclar
class ImplicitParamDecl : public VarDecl {
void anchor() override;
+
public:
+ /// Defines the kind of the implicit parameter: is this an implicit parameter
+ /// with pointer to 'this', 'self', '_cmd', virtual table pointers, captured
+ /// context or something else.
+ enum ImplicitParamKind : unsigned {
+ ObjCSelf, /// Parameter for Objective-C 'self' argument
+ ObjCCmd, /// Parameter for Objective-C '_cmd' argument
+ CXXThis, /// Parameter for C++ 'this' argument
+ CXXVTT, /// Parameter for C++ virtual table pointers
+ CapturedContext, /// Parameter for captured context
+ Other, /// Other implicit parameter
+ };
+
+ /// Create implicit parameter.
static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation IdLoc, IdentifierInfo *Id,
- QualType T);
+ QualType T, ImplicitParamKind ParamKind);
+ static ImplicitParamDecl *Create(ASTContext &C, QualType T,
+ ImplicitParamKind ParamKind);
static ImplicitParamDecl *CreateDeserialized(ASTContext &C, unsigned ID);
ImplicitParamDecl(ASTContext &C, DeclContext *DC, SourceLocation IdLoc,
- IdentifierInfo *Id, QualType Type)
- : VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
- /*tinfo*/ nullptr, SC_None) {
+ IdentifierInfo *Id, QualType Type,
+ ImplicitParamKind ParamKind)
+ : VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
+ /*TInfo=*/nullptr, SC_None) {
+ NonParmVarDeclBits.ImplicitParamKind = ParamKind;
setImplicit();
}
+ ImplicitParamDecl(ASTContext &C, QualType Type, ImplicitParamKind ParamKind)
+ : VarDecl(ImplicitParam, C, /*DC=*/nullptr, SourceLocation(),
+ SourceLocation(), /*Id=*/nullptr, Type,
+ /*TInfo=*/nullptr, SC_None) {
+ NonParmVarDeclBits.ImplicitParamKind = ParamKind;
+ setImplicit();
+ }
+
+ /// Returns the implicit parameter kind.
+ ImplicitParamKind getParameterKind() const {
+ return static_cast<ImplicitParamKind>(NonParmVarDeclBits.ImplicitParamKind);
+ }
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K == ImplicitParam; }
@@ -1829,14 +1864,15 @@ class FunctionDecl : public DeclaratorDecl, public Dec
return getBody(Definition);
}
- /// isThisDeclarationADefinition - Returns whether this specific
- /// declaration of the function is also a definition. This does not
- /// determine whether the function has been defined (e.g., in a
- /// previous definition); for that information, use isDefined. Note
- /// that this returns false for a defaulted function unless that function
- /// has been implicitly defined (possibly as deleted).
+ /// Returns whether this specific declaration of the function is also a
+ /// definition that does not contain uninstantiated body.
+ ///
+ /// This does not determine whether the function has been defined (e.g., in a
+ /// previous definition); for that information, use isDefined.
+ ///
bool isThisDeclarationADefinition() const {
- return IsDeleted || Body || IsLateTemplateParsed;
+ return IsDeleted || IsDefaulted || Body || IsLateTemplateParsed ||
+ hasDefiningAttr();
}
/// doesThisDeclarationHaveABody - Returns whether this specific
Modified: vendor/clang/dist/include/clang/AST/ExternalASTMerger.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/AST/ExternalASTMerger.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -45,6 +45,8 @@ class ExternalASTMerger : public ExternalASTSource { (
llvm::function_ref<bool(Decl::Kind)> IsKindWeWant,
SmallVectorImpl<Decl *> &Result) override;
+ using ExternalASTSource::CompleteType;
+
void CompleteType(TagDecl *Tag) override;
};
Modified: vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h
==============================================================================
--- vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/AST/RecursiveASTVisitor.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -1021,8 +1021,12 @@ DEF_TRAVERSE_TYPE(DeducedTemplateSpecializationType, {
DEF_TRAVERSE_TYPE(RecordType, {})
DEF_TRAVERSE_TYPE(EnumType, {})
DEF_TRAVERSE_TYPE(TemplateTypeParmType, {})
-DEF_TRAVERSE_TYPE(SubstTemplateTypeParmType, {})
-DEF_TRAVERSE_TYPE(SubstTemplateTypeParmPackType, {})
+DEF_TRAVERSE_TYPE(SubstTemplateTypeParmType, {
+ TRY_TO(TraverseType(T->getReplacementType()));
+})
+DEF_TRAVERSE_TYPE(SubstTemplateTypeParmPackType, {
+ TRY_TO(TraverseTemplateArgument(T->getArgumentPack()));
+})
DEF_TRAVERSE_TYPE(TemplateSpecializationType, {
TRY_TO(TraverseTemplateName(T->getTemplateName()));
@@ -1249,8 +1253,12 @@ DEF_TRAVERSE_TYPELOC(DeducedTemplateSpecializationType
DEF_TRAVERSE_TYPELOC(RecordType, {})
DEF_TRAVERSE_TYPELOC(EnumType, {})
DEF_TRAVERSE_TYPELOC(TemplateTypeParmType, {})
-DEF_TRAVERSE_TYPELOC(SubstTemplateTypeParmType, {})
-DEF_TRAVERSE_TYPELOC(SubstTemplateTypeParmPackType, {})
+DEF_TRAVERSE_TYPELOC(SubstTemplateTypeParmType, {
+ TRY_TO(TraverseType(TL.getTypePtr()->getReplacementType()));
+})
+DEF_TRAVERSE_TYPELOC(SubstTemplateTypeParmPackType, {
+ TRY_TO(TraverseTemplateArgument(TL.getTypePtr()->getArgumentPack()));
+})
// FIXME: use the loc for the template name?
DEF_TRAVERSE_TYPELOC(TemplateSpecializationType, {
Modified: vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/ASTMatchers/ASTMatchers.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -3806,14 +3806,22 @@ AST_MATCHER_P(CompoundStmt, statementCountIs, unsigned
return Node.size() == N;
}
-/// \brief Matches literals that are equal to the given value.
+/// \brief Matches literals that are equal to the given value of type ValueT.
///
-/// Example matches true (matcher = cxxBoolLiteral(equals(true)))
+/// Given
/// \code
-/// true
+/// f('\0', false, 3.14, 42);
/// \endcode
+/// characterLiteral(equals(0))
+/// matches '\0'
+/// cxxBoolLiteral(equals(false)) and cxxBoolLiteral(equals(0))
+/// match false
+/// floatLiteral(equals(3.14)) and floatLiteral(equals(314e-2))
+/// match 3.14
+/// integerLiteral(equals(42))
+/// matches 42
///
-/// Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteral>,
+/// Usable as: Matcher<CharacterLiteral>, Matcher<CXXBoolLiteralExpr>,
/// Matcher<FloatingLiteral>, Matcher<IntegerLiteral>
template <typename ValueT>
internal::PolymorphicMatcherWithParam1<internal::ValueEqualsMatcher, ValueT>
@@ -3821,6 +3829,34 @@ equals(const ValueT &Value) {
return internal::PolymorphicMatcherWithParam1<
internal::ValueEqualsMatcher,
ValueT>(Value);
+}
+
+AST_POLYMORPHIC_MATCHER_P_OVERLOAD(equals,
+ AST_POLYMORPHIC_SUPPORTED_TYPES(CharacterLiteral,
+ CXXBoolLiteralExpr,
+ IntegerLiteral),
+ bool, Value, 0) {
+ return internal::ValueEqualsMatcher<NodeType, ParamT>(Value)
+ .matchesNode(Node);
+}
+
+AST_POLYMORPHIC_MATCHER_P_OVERLOAD(equals,
+ AST_POLYMORPHIC_SUPPORTED_TYPES(CharacterLiteral,
+ CXXBoolLiteralExpr,
+ IntegerLiteral),
+ unsigned, Value, 1) {
+ return internal::ValueEqualsMatcher<NodeType, ParamT>(Value)
+ .matchesNode(Node);
+}
+
+AST_POLYMORPHIC_MATCHER_P_OVERLOAD(equals,
+ AST_POLYMORPHIC_SUPPORTED_TYPES(CharacterLiteral,
+ CXXBoolLiteralExpr,
+ FloatingLiteral,
+ IntegerLiteral),
+ double, Value, 2) {
+ return internal::ValueEqualsMatcher<NodeType, ParamT>(Value)
+ .matchesNode(Node);
}
/// \brief Matches the operator Name of operator expressions (binary or
Modified: vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Diagnostics.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Diagnostics.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Diagnostics.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -76,7 +76,7 @@ class Diagnostics { (public)
ET_ParserInvalidToken = 106,
ET_ParserMalformedBindExpr = 107,
ET_ParserTrailingCode = 108,
- ET_ParserUnsignedError = 109,
+ ET_ParserNumberError = 109,
ET_ParserOverloadedType = 110
};
Modified: vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Parser.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Parser.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/ASTMatchers/Dynamic/Parser.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -19,8 +19,10 @@
/// \code
/// Grammar for the expressions supported:
/// <Expression> := <Literal> | <NamedValue> | <MatcherExpression>
-/// <Literal> := <StringLiteral> | <Unsigned>
+/// <Literal> := <StringLiteral> | <Boolean> | <Double> | <Unsigned>
/// <StringLiteral> := "quoted string"
+/// <Boolean> := true | false
+/// <Double> := [0-9]+.[0-9]* | [0-9]+.[0-9]*[eE][-+]?[0-9]+
/// <Unsigned> := [0-9]+
/// <NamedValue> := <Identifier>
/// <MatcherExpression> := <Identifier>(<ArgumentList>) |
Modified: vendor/clang/dist/include/clang/ASTMatchers/Dynamic/VariantValue.h
==============================================================================
--- vendor/clang/dist/include/clang/ASTMatchers/Dynamic/VariantValue.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/ASTMatchers/Dynamic/VariantValue.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -35,6 +35,8 @@ class ArgKind {
public:
enum Kind {
AK_Matcher,
+ AK_Boolean,
+ AK_Double,
AK_Unsigned,
AK_String
};
@@ -241,6 +243,8 @@ struct VariantMatcher::TypedMatcherOps final : Variant
/// copy/assignment.
///
/// Supported types:
+/// - \c bool
+// - \c double
/// - \c unsigned
/// - \c llvm::StringRef
/// - \c VariantMatcher (\c DynTypedMatcher / \c Matcher<T>)
@@ -253,14 +257,29 @@ class VariantValue { (public)
VariantValue &operator=(const VariantValue &Other);
/// \brief Specific constructors for each supported type.
+ VariantValue(bool Boolean);
+ VariantValue(double Double);
VariantValue(unsigned Unsigned);
VariantValue(StringRef String);
VariantValue(const VariantMatcher &Matchers);
+ /// \brief Constructs an \c unsigned value (disambiguation from bool).
+ VariantValue(int Signed) : VariantValue(static_cast<unsigned>(Signed)) {}
+
/// \brief Returns true iff this is not an empty value.
explicit operator bool() const { return hasValue(); }
bool hasValue() const { return Type != VT_Nothing; }
+ /// \brief Boolean value functions.
+ bool isBoolean() const;
+ bool getBoolean() const;
+ void setBoolean(bool Boolean);
+
+ /// \brief Double value functions.
+ bool isDouble() const;
+ double getDouble() const;
+ void setDouble(double Double);
+
/// \brief Unsigned value functions.
bool isUnsigned() const;
unsigned getUnsigned() const;
@@ -303,6 +322,8 @@ class VariantValue { (public)
/// \brief All supported value types.
enum ValueType {
VT_Nothing,
+ VT_Boolean,
+ VT_Double,
VT_Unsigned,
VT_String,
VT_Matcher
@@ -311,6 +332,8 @@ class VariantValue { (public)
/// \brief All supported value types.
union AllValues {
unsigned Unsigned;
+ double Double;
+ bool Boolean;
std::string *String;
VariantMatcher *Matcher;
};
Modified: vendor/clang/dist/include/clang/Basic/Attr.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/Attr.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/Attr.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -1683,6 +1683,42 @@ def Section : InheritableAttr {
let Documentation = [SectionDocs];
}
+def PragmaClangBSSSection : InheritableAttr {
+ // This attribute has no spellings as it is only ever created implicitly.
+ let Spellings = [];
+ let Args = [StringArgument<"Name">];
+ let Subjects = SubjectList<[GlobalVar], ErrorDiag,
+ "ExpectedFunctionMethodOrGlobalVar">;
+ let Documentation = [Undocumented];
+}
+
+def PragmaClangDataSection : InheritableAttr {
+ // This attribute has no spellings as it is only ever created implicitly.
+ let Spellings = [];
+ let Args = [StringArgument<"Name">];
+ let Subjects = SubjectList<[GlobalVar], ErrorDiag,
+ "ExpectedFunctionMethodOrGlobalVar">;
+ let Documentation = [Undocumented];
+}
+
+def PragmaClangRodataSection : InheritableAttr {
+ // This attribute has no spellings as it is only ever created implicitly.
+ let Spellings = [];
+ let Args = [StringArgument<"Name">];
+ let Subjects = SubjectList<[GlobalVar], ErrorDiag,
+ "ExpectedFunctionMethodOrGlobalVar">;
+ let Documentation = [Undocumented];
+}
+
+def PragmaClangTextSection : InheritableAttr {
+ // This attribute has no spellings as it is only ever created implicitly.
+ let Spellings = [];
+ let Args = [StringArgument<"Name">];
+ let Subjects = SubjectList<[Function], ErrorDiag,
+ "ExpectedFunctionMethodOrGlobalVar">;
+ let Documentation = [Undocumented];
+}
+
def Sentinel : InheritableAttr {
let Spellings = [GCC<"sentinel">];
let Args = [DefaultIntArgument<"Sentinel", 0>,
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticFrontendKinds.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -196,6 +196,7 @@ def err_no_submodule_suggest : Error<
"no submodule named %0 in module '%1'; did you mean '%2'?">;
def warn_missing_submodule : Warning<"missing submodule '%0'">,
InGroup<IncompleteUmbrella>;
+def note_module_import_here : Note<"module imported here">;
def err_module_cannot_create_includes : Error<
"cannot create includes file for module %0: %1">;
def warn_module_config_macro_undef : Warning<
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -527,6 +527,10 @@ def err_pp_module_end_without_module_begin : Error<
"'#pragma clang module end'">;
def note_pp_module_begin_here : Note<
"entering module '%0' due to this pragma">;
+def err_pp_module_build_pth : Error<
+ "'#pragma clang module build' not supported in pretokenized header">;
+def err_pp_module_build_missing_end : Error<
+ "no matching '#pragma clang module endbuild' for this '#pragma clang module build'">;
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/DiagnosticParseKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -887,9 +887,18 @@ def warn_pragma_expected_rparen : Warning<
"missing ')' after '#pragma %0' - ignoring">, InGroup<IgnoredPragmas>;
def warn_pragma_expected_identifier : Warning<
"expected identifier in '#pragma %0' - ignored">, InGroup<IgnoredPragmas>;
+
+// '#pragma clang section' related errors
+def err_pragma_expected_clang_section_name : Error<
+ "expected one of [bss|data|rodata|text] section kind in '#pragma %0'">;
+def err_pragma_clang_section_expected_equal : Error<
+ "expected '=' following '#pragma clang section %select{invalid|bss|data|rodata|text}0'">;
+def err_pragma_clang_section_expected_name_or_clear : Error<
+ "expected section name or '\"\"' following '#pragma clang section %select{invalid|bss|data|rodata|text}0'">;
def warn_pragma_expected_section_name : Warning<
"expected a string literal for the section name in '#pragma %0' - ignored">,
InGroup<IgnoredPragmas>;
+
def warn_pragma_expected_section_push_pop_or_name : Warning<
"expected push, pop or a string literal for the section name in '#pragma %0' - ignored">,
InGroup<IgnoredPragmas>;
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -5613,6 +5613,11 @@ def err_enumerator_does_not_exist : Error<
def note_enum_specialized_here : Note<
"enum %0 was explicitly specialized here">;
+def err_specialization_not_primary_template : Error<
+ "cannot reference member of primary template because deduced class "
+ "template specialization %0 is %select{instantiated from a partial|"
+ "an explicit}1 specialization">;
+
def err_member_redeclared : Error<"class member cannot be redeclared">;
def ext_member_redeclared : ExtWarn<"class member cannot be redeclared">,
InGroup<RedeclaredClassMember>;
Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td
==============================================================================
--- vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/DiagnosticSerializationKinds.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -174,6 +174,15 @@ def note_module_odr_violation_mismatch_decl_diff : Not
"method %2 with %ordinal3 parameter of type %4%select{| decayed from %6}5|"
"method %2 with %ordinal3 parameter named %4}1">;
+def err_module_odr_violation_mismatch_decl_unknown : Error<
+ "%q0 %select{with definition in module '%2'|defined here}1 has different "
+ "definitions in different modules; first difference is this "
+ "%select{||||static assert|field|method|unexpected decl}3">;
+def note_module_odr_violation_mismatch_decl_unknown : Note<
+ "but in '%0' found "
+ "%select{||||different static assert|different field|different method|"
+ "another unexpected decl}1">;
+
def warn_duplicate_module_file_extension : Warning<
"duplicate module file extension block name '%0'">,
InGroup<ModuleFileExtension>;
Modified: vendor/clang/dist/include/clang/Basic/LangOptions.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/LangOptions.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/LangOptions.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -58,6 +58,7 @@ class LangOptions : public LangOptionsBase { (public)
SOB_Trapping // -ftrapv
};
+ // FIXME: Unify with TUKind.
enum CompilingModuleKind {
CMK_None, ///< Not compiling a module interface at all.
CMK_ModuleMap, ///< Compiling a module from a module map.
Modified: vendor/clang/dist/include/clang/Basic/SourceManager.h
==============================================================================
--- vendor/clang/dist/include/clang/Basic/SourceManager.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Basic/SourceManager.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -722,6 +722,10 @@ class SourceManager : public RefCountedBase<SourceMana
void clearIDTables();
+ /// Initialize this source manager suitably to replay the compilation
+ /// described by \p Old. Requires that \p Old outlive \p *this.
+ void initializeForReplay(const SourceManager &Old);
+
DiagnosticsEngine &getDiagnostics() const { return Diag; }
FileManager &getFileManager() const { return FileMgr; }
Modified: vendor/clang/dist/include/clang/Driver/Options.td
==============================================================================
--- vendor/clang/dist/include/clang/Driver/Options.td Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Driver/Options.td Sat Jun 10 13:44:22 2017 (r319782)
@@ -932,6 +932,10 @@ def frewrite_includes : Flag<["-"], "frewrite-includes
Flags<[CC1Option]>;
def fno_rewrite_includes : Flag<["-"], "fno-rewrite-includes">, Group<f_Group>;
+def frewrite_imports : Flag<["-"], "frewrite-imports">, Group<f_Group>,
+ Flags<[CC1Option]>;
+def fno_rewrite_imports : Flag<["-"], "fno-rewrite-imports">, Group<f_Group>;
+
def frewrite_map_file : Separate<["-"], "frewrite-map-file">,
Group<f_Group>,
Flags<[ DriverOption, CC1Option ]>;
@@ -2001,6 +2005,10 @@ def mdspr2 : Flag<["-"], "mdspr2">, Group<m_Group>;
def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group<m_Group>;
def msingle_float : Flag<["-"], "msingle-float">, Group<m_Group>;
def mdouble_float : Flag<["-"], "mdouble-float">, Group<m_Group>;
+def mmadd4 : Flag<["-"], "mmadd4">, Group<m_Group>,
+ HelpText<"Enable the generation of 4-operand madd.s, madd.d and related instructions.">;
+def mno_madd4 : Flag<["-"], "mno-madd4">, Group<m_Group>,
+ HelpText<"Disable the generation of 4-operand madd.s, madd.d and related instructions.">;
def mmsa : Flag<["-"], "mmsa">, Group<m_Group>,
HelpText<"Enable MSA ASE (MIPS only)">;
def mno_msa : Flag<["-"], "mno-msa">, Group<m_Group>,
Modified: vendor/clang/dist/include/clang/Edit/EditedSource.h
==============================================================================
--- vendor/clang/dist/include/clang/Edit/EditedSource.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Edit/EditedSource.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -41,9 +41,11 @@ class EditedSource {
typedef std::map<FileOffset, FileEdit> FileEditsTy;
FileEditsTy FileEdits;
- llvm::DenseMap<unsigned, llvm::TinyPtrVector<IdentifierInfo*>>
+ // Location of argument use inside the macro body
+ typedef std::pair<IdentifierInfo*, SourceLocation> MacroArgUse;
+ llvm::DenseMap<unsigned, SmallVector<MacroArgUse, 2>>
ExpansionToArgMap;
- SmallVector<std::pair<SourceLocation, IdentifierInfo*>, 2>
+ SmallVector<std::pair<SourceLocation, MacroArgUse>, 2>
CurrCommitMacroArgExps;
IdentifierTable IdentTable;
@@ -84,7 +86,7 @@ class EditedSource {
FileEditsTy::iterator getActionForOffset(FileOffset Offs);
void deconstructMacroArgLoc(SourceLocation Loc,
SourceLocation &ExpansionLoc,
- IdentifierInfo *&II);
+ MacroArgUse &ArgUse);
void startingCommit();
void finishedCommit();
Modified: vendor/clang/dist/include/clang/Frontend/ASTUnit.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/ASTUnit.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Frontend/ASTUnit.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -51,8 +51,10 @@ class DiagnosticsEngine;
class FileEntry;
class FileManager;
class HeaderSearch;
+class InputKind;
class MemoryBufferCache;
class Preprocessor;
+class PreprocessorOptions;
class PCHContainerOperations;
class PCHContainerReader;
class TargetInfo;
@@ -65,7 +67,7 @@ class FileSystem;
/// \brief Utility class for loading a ASTContext from an AST file.
///
-class ASTUnit : public ModuleLoader {
+class ASTUnit {
public:
struct StandaloneFixIt {
std::pair<unsigned, unsigned> RemoveRange;
@@ -96,6 +98,7 @@ class ASTUnit : public ModuleLoader { (private)
IntrusiveRefCntPtr<ASTContext> Ctx;
std::shared_ptr<TargetOptions> TargetOpts;
std::shared_ptr<HeaderSearchOptions> HSOpts;
+ std::shared_ptr<PreprocessorOptions> PPOpts;
IntrusiveRefCntPtr<ASTReader> Reader;
bool HadModuleLoaderFatalFailure;
@@ -116,10 +119,13 @@ class ASTUnit : public ModuleLoader { (private)
/// LoadFromCommandLine available.
std::shared_ptr<CompilerInvocation> Invocation;
+ /// Fake module loader: the AST unit doesn't need to load any modules.
+ TrivialModuleLoader ModuleLoader;
+
// OnlyLocalDecls - when true, walking this AST should only visit declarations
// that come from the AST itself, not from included precompiled headers.
// FIXME: This is temporary; eventually, CIndex will always do this.
- bool OnlyLocalDecls;
+ bool OnlyLocalDecls;
/// \brief Whether to capture any diagnostics produced.
bool CaptureDiagnostics;
@@ -185,6 +191,14 @@ class ASTUnit : public ModuleLoader { (private)
/// some number of calls.
unsigned PreambleRebuildCounter;
+ /// \brief Cache pairs "filename - source location"
+ ///
+ /// Cache contains only source locations from preamble so it is
+ /// guaranteed that they stay valid when the SourceManager is recreated.
+ /// This cache is used when loading preambule to increase performance
+ /// of that loading. It must be cleared when preamble is recreated.
+ llvm::StringMap<SourceLocation> PreambleSrcLocCache;
+
public:
class PreambleData {
const FileEntry *File;
@@ -305,9 +319,6 @@ class ASTUnit : public ModuleLoader { (private)
/// (likely to change while trying to use them).
bool UserFilesAreVolatile : 1;
- /// \brief The language options used when we load an AST file.
- LangOptions ASTFileLangOpts;
-
static void ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
ASTUnit &AST, bool CaptureDiagnostics);
@@ -488,7 +499,7 @@ class ASTUnit : public ModuleLoader { (private)
};
friend class ConcurrencyCheck;
- ~ASTUnit() override;
+ ~ASTUnit();
bool isMainFileAST() const { return MainFileIsAST; }
@@ -518,10 +529,20 @@ class ASTUnit : public ModuleLoader { (private)
}
const LangOptions &getLangOpts() const {
- assert(LangOpts && " ASTUnit does not have language options");
+ assert(LangOpts && "ASTUnit does not have language options");
return *LangOpts;
}
+
+ const HeaderSearchOptions &getHeaderSearchOpts() const {
+ assert(HSOpts && "ASTUnit does not have header search options");
+ return *HSOpts;
+ }
+ const PreprocessorOptions &getPreprocessorOpts() const {
+ assert(PPOpts && "ASTUnit does not have preprocessor options");
+ return *PPOpts;
+ }
+
const FileManager &getFileManager() const { return *FileMgr; }
FileManager &getFileManager() { return *FileMgr; }
@@ -702,6 +723,9 @@ class ASTUnit : public ModuleLoader { (private)
/// \brief Determine what kind of translation unit this AST represents.
TranslationUnitKind getTranslationUnitKind() const { return TUKind; }
+ /// \brief Determine the input kind this AST unit represents.
+ InputKind getInputKind() const;
+
/// \brief A mapping from a file name to the memory buffer that stores the
/// remapped contents of that file.
typedef std::pair<std::string, llvm::MemoryBuffer *> RemappedFile;
@@ -858,6 +882,7 @@ class ASTUnit : public ModuleLoader { (private)
bool CacheCodeCompletionResults = false,
bool IncludeBriefCommentsInCodeCompletion = false,
bool AllowPCHWithCompilerErrors = false, bool SkipFunctionBodies = false,
+ bool SingleFileParse = false,
bool UserFilesAreVolatile = false, bool ForSerialization = false,
llvm::Optional<StringRef> ModuleFormat = llvm::None,
std::unique_ptr<ASTUnit> *ErrAST = nullptr,
@@ -923,21 +948,6 @@ class ASTUnit : public ModuleLoader { (private)
///
/// \returns True if an error occurred, false otherwise.
bool serialize(raw_ostream &OS);
-
- ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path,
- Module::NameVisibilityKind Visibility,
- bool IsInclusionDirective) override {
- // ASTUnit doesn't know how to load modules (not that this matters).
- return ModuleLoadResult();
- }
-
- void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility,
- SourceLocation ImportLoc) override {}
-
- GlobalModuleIndex *loadGlobalModuleIndex(SourceLocation TriggerLoc) override
- { return nullptr; }
- bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override
- { return 0; }
};
} // namespace clang
Modified: vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Frontend/CodeGenOptions.def Sat Jun 10 13:44:22 2017 (r319782)
@@ -29,7 +29,8 @@ CODEGENOPT(Name, Bits, Default)
#endif
CODEGENOPT(DisableIntegratedAS, 1, 0) ///< -no-integrated-as
-CODEGENOPT(CompressDebugSections, 1, 0) ///< -Wa,-compress-debug-sections
+ENUM_CODEGENOPT(CompressDebugSections, llvm::DebugCompressionType, 2,
+ llvm::DebugCompressionType::None)
CODEGENOPT(RelaxELFRelocations, 1, 0) ///< -Wa,--mrelax-relocations
CODEGENOPT(AsmVerbose , 1, 0) ///< -dA, -fverbose-asm.
CODEGENOPT(PreserveAsmComments, 1, 1) ///< -dA, -fno-preserve-as-comments.
Modified: vendor/clang/dist/include/clang/Frontend/CompilerInstance.h
==============================================================================
--- vendor/clang/dist/include/clang/Frontend/CompilerInstance.h Sat Jun 10 13:44:13 2017 (r319781)
+++ vendor/clang/dist/include/clang/Frontend/CompilerInstance.h Sat Jun 10 13:44:22 2017 (r319782)
@@ -136,6 +136,13 @@ class CompilerInstance : public ModuleLoader {
/// along with the module map
llvm::DenseMap<const IdentifierInfo *, Module *> KnownModules;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-vendor
mailing list