Index: head/contrib/llvm-project/FREEBSD-Xlist =================================================================== --- head/contrib/llvm-project/FREEBSD-Xlist (revision 362444) +++ head/contrib/llvm-project/FREEBSD-Xlist (revision 362445) @@ -1,1042 +1,1043 @@ # $FreeBSD$ .arcconfig .clang-format .clang-tidy .git-blame-ignore-revs .github/ .gitignore CONTRIBUTING.md README.md clang/.arcconfig clang/.clang-format clang/.clang-tidy clang/.gitignore clang/CMakeLists.txt clang/CODE_OWNERS.TXT clang/INPUTS/ clang/INSTALL.txt clang/ModuleInfo.txt clang/NOTES.txt clang/README.txt clang/bindings/ clang/cmake/ clang/docs/ clang/examples/ clang/include/CMakeLists.txt clang/include/clang/AST/CMakeLists.txt clang/include/clang/Basic/CMakeLists.txt clang/include/clang/Basic/Version.inc.in clang/include/clang/CMakeLists.txt clang/include/clang/Config/ clang/include/clang/Driver/CMakeLists.txt clang/include/clang/Parse/CMakeLists.txt clang/include/clang/Sema/CMakeLists.txt clang/include/clang/Serialization/CMakeLists.txt clang/include/clang/StaticAnalyzer/Checkers/CMakeLists.txt clang/lib/ARCMigrate/CMakeLists.txt clang/lib/AST/CMakeLists.txt clang/lib/ASTMatchers/CMakeLists.txt clang/lib/ASTMatchers/Dynamic/CMakeLists.txt clang/lib/Analysis/CMakeLists.txt clang/lib/Analysis/plugins/CMakeLists.txt clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeLists.txt clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeLists.txt clang/lib/Analysis/plugins/SampleAnalyzer/CMakeLists.txt clang/lib/Basic/CMakeLists.txt clang/lib/CMakeLists.txt clang/lib/CodeGen/CMakeLists.txt clang/lib/CodeGen/README.txt clang/lib/CrossTU/CMakeLists.txt clang/lib/DirectoryWatcher/CMakeLists.txt clang/lib/Driver/CMakeLists.txt clang/lib/Edit/CMakeLists.txt clang/lib/Format/CMakeLists.txt clang/lib/Frontend/CMakeLists.txt clang/lib/Frontend/Rewrite/CMakeLists.txt clang/lib/FrontendTool/CMakeLists.txt clang/lib/Headers/CMakeLists.txt clang/lib/Index/CMakeLists.txt clang/lib/Lex/CMakeLists.txt clang/lib/Parse/CMakeLists.txt clang/lib/Rewrite/CMakeLists.txt clang/lib/Sema/CMakeLists.txt clang/lib/Serialization/CMakeLists.txt clang/lib/StaticAnalyzer/CMakeLists.txt clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt clang/lib/StaticAnalyzer/Core/CMakeLists.txt clang/lib/StaticAnalyzer/Frontend/CMakeLists.txt clang/lib/StaticAnalyzer/README.txt clang/lib/Tooling/ASTDiff/CMakeLists.txt clang/lib/Tooling/CMakeLists.txt clang/lib/Tooling/Core/CMakeLists.txt clang/lib/Tooling/DependencyScanning/CMakeLists.txt clang/lib/Tooling/Inclusions/CMakeLists.txt clang/lib/Tooling/Refactoring/CMakeLists.txt clang/lib/Tooling/Syntax/CMakeLists.txt clang/lib/Tooling/Transformer/CMakeLists.txt clang/runtime/ clang/test/ clang/tools/CMakeLists.txt clang/tools/arcmt-test/ clang/tools/c-arcmt-test/ clang/tools/c-index-test/ clang/tools/clang-check/ clang/tools/clang-diff/ clang/tools/clang-extdef-mapping/ clang/tools/clang-format/CMakeLists.txt clang/tools/clang-format/clang-format-bbedit.applescript clang/tools/clang-format/clang-format-diff.py clang/tools/clang-format/clang-format-sublime.py clang/tools/clang-format/clang-format-test.el clang/tools/clang-format/clang-format.el clang/tools/clang-format/clang-format.py clang/tools/clang-format/fuzzer/ clang/tools/clang-format/git-clang-format clang/tools/clang-format-vs/ clang/tools/clang-fuzzer/ clang/tools/clang-import-test/ clang/tools/clang-offload-bundler/ clang/tools/clang-offload-wrapper/ clang/tools/clang-refactor/ clang/tools/clang-rename/ clang/tools/clang-scan-deps/ clang/tools/clang-shlib/ clang/tools/diag-build/ clang/tools/diagtool/ clang/tools/driver/CMakeLists.txt clang/tools/driver/Info.plist.in clang/tools/libclang/ clang/tools/scan-build/ clang/tools/scan-build-py/ clang/tools/scan-view/ clang/unittests/ clang/utils/ABITest/ clang/utils/CIndex/ clang/utils/CaptureCmd clang/utils/ClangDataFormat.py clang/utils/ClangVisualizers/ clang/utils/CmpDriver clang/utils/FindSpecRefs clang/utils/FuzzTest clang/utils/TableGen/CMakeLists.txt clang/utils/TestUtils/ clang/utils/VtableTest/ clang/utils/analyzer/ clang/utils/bash-autocomplete.sh clang/utils/builtin-defines.c clang/utils/check_cfc/ clang/utils/clangdiag.py clang/utils/convert_arm_neon.py clang/utils/creduce-clang-crash.py clang/utils/find-unused-diagnostics.sh clang/utils/hmaptool/ clang/utils/make-ast-dump-check.sh clang/utils/modfuzz.py clang/utils/perf-training/ clang/utils/token-delta.py clang/utils/valgrind/ clang/www/ clang-tools-extra/ compiler-rt/.arcconfig compiler-rt/.gitignore compiler-rt/CMakeLists.txt compiler-rt/CODE_OWNERS.TXT compiler-rt/cmake/ compiler-rt/docs/ compiler-rt/include/CMakeLists.txt compiler-rt/lib/CMakeLists.txt compiler-rt/lib/asan/.clang-format compiler-rt/lib/asan/CMakeLists.txt compiler-rt/lib/asan/scripts/ compiler-rt/lib/asan/tests/ compiler-rt/lib/builtins/CMakeLists.txt compiler-rt/lib/builtins/Darwin-excludes/ compiler-rt/lib/builtins/macho_embedded/ compiler-rt/lib/cfi/CMakeLists.txt compiler-rt/lib/crt/CMakeLists.txt compiler-rt/lib/dfsan/.clang-format compiler-rt/lib/dfsan/CMakeLists.txt compiler-rt/lib/dfsan/scripts/ compiler-rt/lib/fuzzer/CMakeLists.txt compiler-rt/lib/fuzzer/afl/ compiler-rt/lib/fuzzer/build.sh compiler-rt/lib/fuzzer/dataflow/ compiler-rt/lib/fuzzer/scripts/ compiler-rt/lib/fuzzer/standalone/ compiler-rt/lib/fuzzer/tests/ compiler-rt/lib/gwp_asan/CMakeLists.txt compiler-rt/lib/gwp_asan/scripts/ compiler-rt/lib/gwp_asan/tests/ compiler-rt/lib/hwasan/.clang-format compiler-rt/lib/hwasan/CMakeLists.txt compiler-rt/lib/hwasan/scripts/ compiler-rt/lib/interception/.clang-format compiler-rt/lib/interception/CMakeLists.txt compiler-rt/lib/interception/tests/ compiler-rt/lib/lsan/.clang-format compiler-rt/lib/lsan/CMakeLists.txt compiler-rt/lib/msan/.clang-format compiler-rt/lib/msan/CMakeLists.txt compiler-rt/lib/msan/tests/ compiler-rt/lib/profile/CMakeLists.txt compiler-rt/lib/safestack/.clang-format compiler-rt/lib/safestack/CMakeLists.txt compiler-rt/lib/sanitizer_common/.clang-format compiler-rt/lib/sanitizer_common/.clang-tidy compiler-rt/lib/sanitizer_common/CMakeLists.txt compiler-rt/lib/sanitizer_common/scripts/ compiler-rt/lib/sanitizer_common/tests/ compiler-rt/lib/scudo/CMakeLists.txt compiler-rt/lib/scudo/standalone/CMakeLists.txt compiler-rt/lib/scudo/standalone/benchmarks/ compiler-rt/lib/scudo/standalone/tests/ compiler-rt/lib/stats/CMakeLists.txt compiler-rt/lib/tsan/.clang-format compiler-rt/lib/tsan/CMakeLists.txt compiler-rt/lib/tsan/analyze_libtsan.sh compiler-rt/lib/tsan/check_analyze.sh compiler-rt/lib/tsan/check_cmake.sh compiler-rt/lib/tsan/dd/CMakeLists.txt compiler-rt/lib/tsan/go/build.bat compiler-rt/lib/tsan/go/buildgo.sh compiler-rt/lib/tsan/tests/ compiler-rt/lib/ubsan/CMakeLists.txt compiler-rt/lib/ubsan_minimal/CMakeLists.txt compiler-rt/lib/xray/CMakeLists.txt compiler-rt/lib/xray/tests/ compiler-rt/test/ compiler-rt/tools/ compiler-rt/unittests/ compiler-rt/utils/ compiler-rt/www/ debuginfo-tests/ libc/ libclc/ libcxx/.arcconfig libcxx/.clang-format libcxx/.gitignore libcxx/CMakeLists.txt libcxx/NOTES.TXT libcxx/TODO.TXT libcxx/appveyor-reqs-install.cmd libcxx/appveyor.yml libcxx/benchmarks/ libcxx/cmake/ libcxx/docs/ libcxx/fuzzing/ libcxx/include/CMakeLists.txt libcxx/include/__config_site.in libcxx/include/support/ libcxx/lib/ libcxx/src/CMakeLists.txt libcxx/src/support/solaris/ libcxx/src/support/win32/ libcxx/test/ libcxx/utils/ libcxx/www/ libcxxabi/ libunwind/.arcconfig libunwind/.clang-format libunwind/CMakeLists.txt libunwind/cmake/ libunwind/docs/ libunwind/src/CMakeLists.txt libunwind/test/ lld/CMakeLists.txt lld/COFF/CMakeLists.txt lld/Common/CMakeLists.txt lld/ELF/CMakeLists.txt lld/MinGW/ lld/cmake/ lld/docs/CMakeLists.txt lld/lib/CMakeLists.txt lld/lib/Core/CMakeLists.txt lld/lib/Driver/CMakeLists.txt lld/lib/ReaderWriter/CMakeLists.txt lld/lib/ReaderWriter/MachO/CMakeLists.txt lld/lib/ReaderWriter/YAML/CMakeLists.txt lld/test/ lld/tools/lld/CMakeLists.txt lld/unittests/ lld/utils/ lld/wasm/ lldb/.arcconfig lldb/.clang-format lldb/.gitignore lldb/CMakeLists.txt lldb/CODE_OWNERS.txt lldb/bindings/CMakeLists.txt lldb/cmake/ lldb/docs/.htaccess lldb/docs/CMakeLists.txt lldb/docs/_static/ lldb/docs/conf.py lldb/docs/doxygen-mainpage.dox lldb/docs/doxygen.cfg.in lldb/docs/index.rst lldb/docs/lldb-for-gdb-users.txt lldb/docs/lldb-gdb-remote.txt lldb/docs/lldb-platform-packets.txt lldb/docs/resources/ lldb/docs/status/ lldb/docs/structured_data/ lldb/docs/testsuite/ lldb/docs/use/ lldb/examples/ lldb/include/lldb/Host/android/ lldb/include/lldb/Host/linux/ lldb/include/lldb/Host/macosx/ lldb/include/lldb/Host/windows/ lldb/packages/ lldb/resources/ lldb/scripts/ lldb/source/API/CMakeLists.txt lldb/source/Breakpoint/CMakeLists.txt lldb/source/CMakeLists.txt lldb/source/Commands/CMakeLists.txt lldb/source/Core/CMakeLists.txt lldb/source/DataFormatters/CMakeLists.txt lldb/source/Expression/CMakeLists.txt lldb/source/Host/CMakeLists.txt lldb/source/Host/android/ lldb/source/Host/linux/ lldb/source/Host/macosx/ lldb/source/Host/windows/ lldb/source/Initialization/CMakeLists.txt lldb/source/Interpreter/CMakeLists.txt lldb/source/Plugins/ABI/CMakeLists.txt lldb/source/Plugins/ABI/MacOSX-arm/CMakeLists.txt lldb/source/Plugins/ABI/MacOSX-arm64/CMakeLists.txt lldb/source/Plugins/ABI/MacOSX-i386/CMakeLists.txt lldb/source/Plugins/ABI/SysV-arc/CMakeLists.txt lldb/source/Plugins/ABI/SysV-arm/CMakeLists.txt lldb/source/Plugins/ABI/SysV-arm64/CMakeLists.txt lldb/source/Plugins/ABI/SysV-hexagon/CMakeLists.txt lldb/source/Plugins/ABI/SysV-i386/CMakeLists.txt lldb/source/Plugins/ABI/SysV-mips/CMakeLists.txt lldb/source/Plugins/ABI/SysV-mips64/CMakeLists.txt lldb/source/Plugins/ABI/SysV-ppc/CMakeLists.txt lldb/source/Plugins/ABI/SysV-ppc64/CMakeLists.txt lldb/source/Plugins/ABI/SysV-s390x/CMakeLists.txt lldb/source/Plugins/ABI/SysV-x86_64/CMakeLists.txt lldb/source/Plugins/ABI/Windows-x86_64/CMakeLists.txt lldb/source/Plugins/Architecture/Arm/CMakeLists.txt lldb/source/Plugins/Architecture/CMakeLists.txt lldb/source/Plugins/Architecture/Mips/CMakeLists.txt lldb/source/Plugins/Architecture/PPC64/CMakeLists.txt lldb/source/Plugins/CMakeLists.txt lldb/source/Plugins/Disassembler/CMakeLists.txt lldb/source/Plugins/Disassembler/llvm/CMakeLists.txt lldb/source/Plugins/DynamicLoader/CMakeLists.txt lldb/source/Plugins/DynamicLoader/Darwin-Kernel/ lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/CMakeLists.txt lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/ lldb/source/Plugins/DynamicLoader/POSIX-DYLD/CMakeLists.txt lldb/source/Plugins/DynamicLoader/Static/CMakeLists.txt lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt lldb/source/Plugins/ExpressionParser/CMakeLists.txt lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt lldb/source/Plugins/Instruction/ARM/CMakeLists.txt lldb/source/Plugins/Instruction/ARM64/CMakeLists.txt lldb/source/Plugins/Instruction/CMakeLists.txt lldb/source/Plugins/Instruction/MIPS/CMakeLists.txt lldb/source/Plugins/Instruction/MIPS64/CMakeLists.txt lldb/source/Plugins/Instruction/PPC64/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/MainThreadChecker/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt lldb/source/Plugins/JITLoader/CMakeLists.txt lldb/source/Plugins/JITLoader/GDB/CMakeLists.txt lldb/source/Plugins/Language/CMakeLists.txt lldb/source/Plugins/Language/CPlusPlus/CMakeLists.txt lldb/source/Plugins/Language/ClangCommon/CMakeLists.txt lldb/source/Plugins/Language/ObjC/CMakeLists.txt lldb/source/Plugins/Language/ObjCPlusPlus/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/CPlusPlus/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/Go/ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/RenderScript/CMakeLists.txt lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/CMakeLists.txt lldb/source/Plugins/MemoryHistory/CMakeLists.txt lldb/source/Plugins/MemoryHistory/asan/CMakeLists.txt lldb/source/Plugins/ObjectContainer/BSD-Archive/CMakeLists.txt lldb/source/Plugins/ObjectContainer/CMakeLists.txt lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt lldb/source/Plugins/ObjectFile/CMakeLists.txt lldb/source/Plugins/ObjectFile/ELF/CMakeLists.txt lldb/source/Plugins/ObjectFile/JIT/CMakeLists.txt lldb/source/Plugins/ObjectFile/Mach-O/ lldb/source/Plugins/ObjectFile/PECOFF/ lldb/source/Plugins/OperatingSystem/CMakeLists.txt lldb/source/Plugins/OperatingSystem/Python/CMakeLists.txt lldb/source/Plugins/Platform/Android/ lldb/source/Plugins/Platform/CMakeLists.txt lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt lldb/source/Plugins/Platform/Linux/ lldb/source/Plugins/Platform/MacOSX/ lldb/source/Plugins/Platform/NetBSD/CMakeLists.txt lldb/source/Plugins/Platform/OpenBSD/CMakeLists.txt lldb/source/Plugins/Platform/POSIX/CMakeLists.txt lldb/source/Plugins/Platform/Windows/ lldb/source/Plugins/Platform/gdb-server/CMakeLists.txt lldb/source/Plugins/Process/CMakeLists.txt lldb/source/Plugins/Process/FreeBSD/CMakeLists.txt lldb/source/Plugins/Process/Linux/ lldb/source/Plugins/Process/MacOSX-Kernel/ lldb/source/Plugins/Process/NetBSD/CMakeLists.txt lldb/source/Plugins/Process/POSIX/CMakeLists.txt lldb/source/Plugins/Process/Utility/CMakeLists.txt lldb/source/Plugins/Process/Windows/ lldb/source/Plugins/Process/elf-core/CMakeLists.txt lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt lldb/source/Plugins/Process/mach-core/ lldb/source/Plugins/Process/minidump/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/None/CMakeLists.txt lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt lldb/source/Plugins/StructuredData/CMakeLists.txt lldb/source/Plugins/StructuredData/DarwinLog/CMakeLists.txt lldb/source/Plugins/SymbolFile/Breakpad/CMakeLists.txt lldb/source/Plugins/SymbolFile/CMakeLists.txt lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt lldb/source/Plugins/SymbolFile/PDB/CMakeLists.txt lldb/source/Plugins/SymbolFile/Symtab/CMakeLists.txt lldb/source/Plugins/SymbolVendor/CMakeLists.txt lldb/source/Plugins/SymbolVendor/ELF/CMakeLists.txt lldb/source/Plugins/SymbolVendor/MacOSX/ lldb/source/Plugins/SystemRuntime/ lldb/source/Plugins/UnwindAssembly/CMakeLists.txt lldb/source/Plugins/UnwindAssembly/InstEmulation/CMakeLists.txt lldb/source/Plugins/UnwindAssembly/x86/CMakeLists.txt lldb/source/Symbol/CMakeLists.txt lldb/source/Target/CMakeLists.txt lldb/source/Utility/CMakeLists.txt lldb/test/ lldb/third_party/ lldb/tools/CMakeLists.txt lldb/tools/argdumper/CMakeLists.txt lldb/tools/darwin-debug/ lldb/tools/darwin-threads/ lldb/tools/debugserver/ lldb/tools/driver/CMakeLists.txt lldb/tools/driver/lldb-Info.plist.in lldb/tools/intel-features/ lldb/tools/lldb-instr/CMakeLists.txt lldb/tools/lldb-perf/ lldb/tools/lldb-server/CMakeLists.txt lldb/tools/lldb-test/ lldb/tools/lldb-vscode/ lldb/unittests/ lldb/use_lldb_suite_root.py lldb/utils/TableGen/CMakeLists.txt lldb/utils/lit-cpuid/ lldb/utils/lldb-dotest/ lldb/utils/lui/ lldb/utils/test/ llgo/ llvm/.arcconfig llvm/.clang-format llvm/.clang-tidy llvm/.gitattributes llvm/.gitignore llvm/CMakeLists.txt llvm/CODE_OWNERS.TXT llvm/CREDITS.TXT llvm/LLVMBuild.txt llvm/README.txt llvm/RELEASE_TESTERS.TXT llvm/benchmarks/ llvm/bindings/ llvm/cmake/ llvm/configure llvm/docs/ llvm/examples/ llvm/include/llvm/CMakeLists.txt llvm/include/llvm/Config/ llvm/include/llvm/IR/CMakeLists.txt llvm/include/llvm/Support/CMakeLists.txt llvm/include/llvm/Support/LICENSE.TXT llvm/lib/Analysis/CMakeLists.txt llvm/lib/Analysis/LLVMBuild.txt llvm/lib/Analysis/README.txt llvm/lib/AsmParser/CMakeLists.txt llvm/lib/AsmParser/LLVMBuild.txt llvm/lib/BinaryFormat/CMakeLists.txt llvm/lib/BinaryFormat/LLVMBuild.txt llvm/lib/Bitcode/CMakeLists.txt llvm/lib/Bitcode/LLVMBuild.txt llvm/lib/Bitcode/Reader/CMakeLists.txt llvm/lib/Bitcode/Reader/LLVMBuild.txt llvm/lib/Bitcode/Writer/CMakeLists.txt llvm/lib/Bitcode/Writer/LLVMBuild.txt llvm/lib/Bitstream/CMakeLists.txt llvm/lib/Bitstream/LLVMBuild.txt llvm/lib/Bitstream/Reader/CMakeLists.txt llvm/lib/Bitstream/Reader/LLVMBuild.txt llvm/lib/CMakeLists.txt llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt llvm/lib/CodeGen/AsmPrinter/LLVMBuild.txt llvm/lib/CodeGen/CMakeLists.txt llvm/lib/CodeGen/GlobalISel/CMakeLists.txt llvm/lib/CodeGen/GlobalISel/LLVMBuild.txt llvm/lib/CodeGen/LLVMBuild.txt llvm/lib/CodeGen/MIRParser/CMakeLists.txt llvm/lib/CodeGen/MIRParser/LLVMBuild.txt llvm/lib/CodeGen/README.txt llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt llvm/lib/CodeGen/SelectionDAG/LLVMBuild.txt llvm/lib/DWARFLinker/CMakeLists.txt llvm/lib/DWARFLinker/LLVMBuild.txt llvm/lib/DebugInfo/CMakeLists.txt llvm/lib/DebugInfo/CodeView/CMakeLists.txt llvm/lib/DebugInfo/CodeView/LLVMBuild.txt llvm/lib/DebugInfo/DWARF/CMakeLists.txt llvm/lib/DebugInfo/DWARF/LLVMBuild.txt llvm/lib/DebugInfo/GSYM/CMakeLists.txt llvm/lib/DebugInfo/GSYM/LLVMBuild.txt llvm/lib/DebugInfo/LLVMBuild.txt llvm/lib/DebugInfo/MSF/CMakeLists.txt llvm/lib/DebugInfo/MSF/LLVMBuild.txt llvm/lib/DebugInfo/PDB/CMakeLists.txt llvm/lib/DebugInfo/PDB/LLVMBuild.txt llvm/lib/DebugInfo/Symbolize/CMakeLists.txt llvm/lib/DebugInfo/Symbolize/LLVMBuild.txt llvm/lib/Demangle/CMakeLists.txt llvm/lib/Demangle/LLVMBuild.txt llvm/lib/ExecutionEngine/CMakeLists.txt llvm/lib/ExecutionEngine/IntelJITEvents/CMakeLists.txt llvm/lib/ExecutionEngine/IntelJITEvents/LLVMBuild.txt llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt llvm/lib/ExecutionEngine/Interpreter/LLVMBuild.txt llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt llvm/lib/ExecutionEngine/JITLink/LLVMBuild.txt llvm/lib/ExecutionEngine/LLVMBuild.txt llvm/lib/ExecutionEngine/MCJIT/CMakeLists.txt llvm/lib/ExecutionEngine/MCJIT/LLVMBuild.txt llvm/lib/ExecutionEngine/OProfileJIT/CMakeLists.txt llvm/lib/ExecutionEngine/OProfileJIT/LLVMBuild.txt llvm/lib/ExecutionEngine/Orc/CMakeLists.txt llvm/lib/ExecutionEngine/Orc/LLVMBuild.txt llvm/lib/ExecutionEngine/OrcError/CMakeLists.txt llvm/lib/ExecutionEngine/OrcError/LLVMBuild.txt llvm/lib/ExecutionEngine/PerfJITEvents/CMakeLists.txt llvm/lib/ExecutionEngine/PerfJITEvents/LLVMBuild.txt llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt llvm/lib/ExecutionEngine/RuntimeDyld/LLVMBuild.txt +llvm/lib/Extensions/ llvm/lib/Frontend/CMakeLists.txt llvm/lib/Frontend/LLVMBuild.txt llvm/lib/Frontend/OpenMP/CMakeLists.txt llvm/lib/Frontend/OpenMP/LLVMBuild.txt llvm/lib/FuzzMutate/CMakeLists.txt llvm/lib/FuzzMutate/LLVMBuild.txt llvm/lib/Fuzzer/ llvm/lib/IR/CMakeLists.txt llvm/lib/IR/LLVMBuild.txt llvm/lib/IRReader/CMakeLists.txt llvm/lib/IRReader/LLVMBuild.txt llvm/lib/LLVMBuild.txt llvm/lib/LTO/CMakeLists.txt llvm/lib/LTO/LLVMBuild.txt llvm/lib/LineEditor/CMakeLists.txt llvm/lib/LineEditor/LLVMBuild.txt llvm/lib/Linker/CMakeLists.txt llvm/lib/Linker/LLVMBuild.txt llvm/lib/MC/CMakeLists.txt llvm/lib/MC/LLVMBuild.txt llvm/lib/MC/MCDisassembler/CMakeLists.txt llvm/lib/MC/MCDisassembler/LLVMBuild.txt llvm/lib/MC/MCParser/CMakeLists.txt llvm/lib/MC/MCParser/LLVMBuild.txt llvm/lib/MCA/CMakeLists.txt llvm/lib/MCA/LLVMBuild.txt llvm/lib/Object/CMakeLists.txt llvm/lib/Object/LLVMBuild.txt llvm/lib/ObjectYAML/CMakeLists.txt llvm/lib/ObjectYAML/LLVMBuild.txt llvm/lib/Option/CMakeLists.txt llvm/lib/Option/LLVMBuild.txt llvm/lib/Passes/CMakeLists.txt llvm/lib/Passes/LLVMBuild.txt llvm/lib/ProfileData/CMakeLists.txt llvm/lib/ProfileData/Coverage/CMakeLists.txt llvm/lib/ProfileData/Coverage/LLVMBuild.txt llvm/lib/ProfileData/LLVMBuild.txt llvm/lib/Remarks/CMakeLists.txt llvm/lib/Remarks/LLVMBuild.txt llvm/lib/Support/CMakeLists.txt llvm/lib/Support/LLVMBuild.txt llvm/lib/TableGen/CMakeLists.txt llvm/lib/TableGen/LLVMBuild.txt llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt llvm/lib/Target/AArch64/AsmParser/LLVMBuild.txt llvm/lib/Target/AArch64/CMakeLists.txt llvm/lib/Target/AArch64/Disassembler/CMakeLists.txt llvm/lib/Target/AArch64/Disassembler/LLVMBuild.txt llvm/lib/Target/AArch64/LLVMBuild.txt llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt llvm/lib/Target/AArch64/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/AArch64/TargetInfo/CMakeLists.txt llvm/lib/Target/AArch64/TargetInfo/LLVMBuild.txt llvm/lib/Target/AArch64/Utils/CMakeLists.txt llvm/lib/Target/AArch64/Utils/LLVMBuild.txt llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt llvm/lib/Target/AMDGPU/AsmParser/LLVMBuild.txt llvm/lib/Target/AMDGPU/CMakeLists.txt llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt llvm/lib/Target/AMDGPU/Disassembler/LLVMBuild.txt llvm/lib/Target/AMDGPU/LLVMBuild.txt llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt llvm/lib/Target/AMDGPU/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/AMDGPU/TargetInfo/CMakeLists.txt llvm/lib/Target/AMDGPU/TargetInfo/LLVMBuild.txt llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt llvm/lib/Target/AMDGPU/Utils/LLVMBuild.txt llvm/lib/Target/ARC/CMakeLists.txt llvm/lib/Target/ARC/Disassembler/CMakeLists.txt llvm/lib/Target/ARC/Disassembler/LLVMBuild.txt llvm/lib/Target/ARC/LLVMBuild.txt llvm/lib/Target/ARC/MCTargetDesc/CMakeLists.txt llvm/lib/Target/ARC/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/ARC/TargetInfo/CMakeLists.txt llvm/lib/Target/ARC/TargetInfo/LLVMBuild.txt llvm/lib/Target/ARM/AsmParser/CMakeLists.txt llvm/lib/Target/ARM/AsmParser/LLVMBuild.txt llvm/lib/Target/ARM/CMakeLists.txt llvm/lib/Target/ARM/Disassembler/CMakeLists.txt llvm/lib/Target/ARM/Disassembler/LLVMBuild.txt llvm/lib/Target/ARM/LLVMBuild.txt llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt llvm/lib/Target/ARM/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/ARM/README-Thumb.txt llvm/lib/Target/ARM/README-Thumb2.txt llvm/lib/Target/ARM/README.txt llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt llvm/lib/Target/ARM/TargetInfo/LLVMBuild.txt llvm/lib/Target/ARM/Utils/CMakeLists.txt llvm/lib/Target/ARM/Utils/LLVMBuild.txt llvm/lib/Target/AVR/AsmParser/CMakeLists.txt llvm/lib/Target/AVR/AsmParser/LLVMBuild.txt llvm/lib/Target/AVR/CMakeLists.txt llvm/lib/Target/AVR/Disassembler/CMakeLists.txt llvm/lib/Target/AVR/Disassembler/LLVMBuild.txt llvm/lib/Target/AVR/LLVMBuild.txt llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt llvm/lib/Target/AVR/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/AVR/TargetInfo/CMakeLists.txt llvm/lib/Target/AVR/TargetInfo/LLVMBuild.txt llvm/lib/Target/BPF/AsmParser/CMakeLists.txt llvm/lib/Target/BPF/AsmParser/LLVMBuild.txt llvm/lib/Target/BPF/CMakeLists.txt llvm/lib/Target/BPF/Disassembler/CMakeLists.txt llvm/lib/Target/BPF/Disassembler/LLVMBuild.txt llvm/lib/Target/BPF/LLVMBuild.txt llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt llvm/lib/Target/BPF/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/BPF/TargetInfo/CMakeLists.txt llvm/lib/Target/BPF/TargetInfo/LLVMBuild.txt llvm/lib/Target/CMakeLists.txt llvm/lib/Target/Hexagon/AsmParser/CMakeLists.txt llvm/lib/Target/Hexagon/AsmParser/LLVMBuild.txt llvm/lib/Target/Hexagon/CMakeLists.txt llvm/lib/Target/Hexagon/Disassembler/CMakeLists.txt llvm/lib/Target/Hexagon/Disassembler/LLVMBuild.txt llvm/lib/Target/Hexagon/LLVMBuild.txt llvm/lib/Target/Hexagon/MCTargetDesc/CMakeLists.txt llvm/lib/Target/Hexagon/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/Hexagon/TargetInfo/CMakeLists.txt llvm/lib/Target/Hexagon/TargetInfo/LLVMBuild.txt llvm/lib/Target/LLVMBuild.txt llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt llvm/lib/Target/Lanai/AsmParser/LLVMBuild.txt llvm/lib/Target/Lanai/CMakeLists.txt llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt llvm/lib/Target/Lanai/Disassembler/LLVMBuild.txt llvm/lib/Target/Lanai/LLVMBuild.txt llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt llvm/lib/Target/Lanai/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/Lanai/TargetInfo/CMakeLists.txt llvm/lib/Target/Lanai/TargetInfo/LLVMBuild.txt llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt llvm/lib/Target/MSP430/AsmParser/LLVMBuild.txt llvm/lib/Target/MSP430/CMakeLists.txt llvm/lib/Target/MSP430/Disassembler/CMakeLists.txt llvm/lib/Target/MSP430/Disassembler/LLVMBuild.txt llvm/lib/Target/MSP430/LLVMBuild.txt llvm/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt llvm/lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/MSP430/README.txt llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt llvm/lib/Target/MSP430/TargetInfo/LLVMBuild.txt llvm/lib/Target/Mips/AsmParser/CMakeLists.txt llvm/lib/Target/Mips/AsmParser/LLVMBuild.txt llvm/lib/Target/Mips/CMakeLists.txt llvm/lib/Target/Mips/Disassembler/CMakeLists.txt llvm/lib/Target/Mips/Disassembler/LLVMBuild.txt llvm/lib/Target/Mips/LLVMBuild.txt llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt llvm/lib/Target/Mips/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt llvm/lib/Target/Mips/TargetInfo/LLVMBuild.txt llvm/lib/Target/NVPTX/CMakeLists.txt llvm/lib/Target/NVPTX/LLVMBuild.txt llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt llvm/lib/Target/NVPTX/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/NVPTX/TargetInfo/CMakeLists.txt llvm/lib/Target/NVPTX/TargetInfo/LLVMBuild.txt llvm/lib/Target/PowerPC/AsmParser/CMakeLists.txt llvm/lib/Target/PowerPC/AsmParser/LLVMBuild.txt llvm/lib/Target/PowerPC/CMakeLists.txt llvm/lib/Target/PowerPC/Disassembler/CMakeLists.txt llvm/lib/Target/PowerPC/Disassembler/LLVMBuild.txt llvm/lib/Target/PowerPC/LLVMBuild.txt llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt llvm/lib/Target/PowerPC/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/PowerPC/README.txt llvm/lib/Target/PowerPC/README_ALTIVEC.txt llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt llvm/lib/Target/PowerPC/TargetInfo/LLVMBuild.txt llvm/lib/Target/README.txt llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt llvm/lib/Target/RISCV/AsmParser/LLVMBuild.txt llvm/lib/Target/RISCV/CMakeLists.txt llvm/lib/Target/RISCV/Disassembler/CMakeLists.txt llvm/lib/Target/RISCV/Disassembler/LLVMBuild.txt llvm/lib/Target/RISCV/LLVMBuild.txt llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt llvm/lib/Target/RISCV/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/RISCV/TargetInfo/CMakeLists.txt llvm/lib/Target/RISCV/TargetInfo/LLVMBuild.txt llvm/lib/Target/RISCV/Utils/CMakeLists.txt llvm/lib/Target/RISCV/Utils/LLVMBuild.txt llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt llvm/lib/Target/Sparc/AsmParser/LLVMBuild.txt llvm/lib/Target/Sparc/CMakeLists.txt llvm/lib/Target/Sparc/Disassembler/CMakeLists.txt llvm/lib/Target/Sparc/Disassembler/LLVMBuild.txt llvm/lib/Target/Sparc/LLVMBuild.txt llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt llvm/lib/Target/Sparc/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/Sparc/README.txt llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt llvm/lib/Target/Sparc/TargetInfo/LLVMBuild.txt llvm/lib/Target/SystemZ/AsmParser/CMakeLists.txt llvm/lib/Target/SystemZ/AsmParser/LLVMBuild.txt llvm/lib/Target/SystemZ/CMakeLists.txt llvm/lib/Target/SystemZ/Disassembler/CMakeLists.txt llvm/lib/Target/SystemZ/Disassembler/LLVMBuild.txt llvm/lib/Target/SystemZ/LLVMBuild.txt llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt llvm/lib/Target/SystemZ/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt llvm/lib/Target/SystemZ/TargetInfo/LLVMBuild.txt llvm/lib/Target/VE/CMakeLists.txt llvm/lib/Target/VE/InstPrinter/CMakeLists.txt llvm/lib/Target/VE/InstPrinter/LLVMBuild.txt llvm/lib/Target/VE/LLVMBuild.txt llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt llvm/lib/Target/VE/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/VE/TargetInfo/CMakeLists.txt llvm/lib/Target/VE/TargetInfo/LLVMBuild.txt llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt llvm/lib/Target/WebAssembly/AsmParser/LLVMBuild.txt llvm/lib/Target/WebAssembly/CMakeLists.txt llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt llvm/lib/Target/WebAssembly/Disassembler/LLVMBuild.txt llvm/lib/Target/WebAssembly/LLVMBuild.txt llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt llvm/lib/Target/WebAssembly/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/WebAssembly/TargetInfo/CMakeLists.txt llvm/lib/Target/WebAssembly/TargetInfo/LLVMBuild.txt llvm/lib/Target/X86/AsmParser/CMakeLists.txt llvm/lib/Target/X86/AsmParser/LLVMBuild.txt llvm/lib/Target/X86/CMakeLists.txt llvm/lib/Target/X86/Disassembler/CMakeLists.txt llvm/lib/Target/X86/Disassembler/LLVMBuild.txt llvm/lib/Target/X86/LLVMBuild.txt llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt llvm/lib/Target/X86/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/X86/README-FPStack.txt llvm/lib/Target/X86/README-SSE.txt llvm/lib/Target/X86/README-X86-64.txt llvm/lib/Target/X86/README.txt llvm/lib/Target/X86/TargetInfo/CMakeLists.txt llvm/lib/Target/X86/TargetInfo/LLVMBuild.txt llvm/lib/Target/X86/Utils/CMakeLists.txt llvm/lib/Target/X86/Utils/LLVMBuild.txt llvm/lib/Target/XCore/CMakeLists.txt llvm/lib/Target/XCore/Disassembler/CMakeLists.txt llvm/lib/Target/XCore/Disassembler/LLVMBuild.txt llvm/lib/Target/XCore/LLVMBuild.txt llvm/lib/Target/XCore/MCTargetDesc/CMakeLists.txt llvm/lib/Target/XCore/MCTargetDesc/LLVMBuild.txt llvm/lib/Target/XCore/README.txt llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt llvm/lib/Target/XCore/TargetInfo/LLVMBuild.txt llvm/lib/Testing/CMakeLists.txt llvm/lib/Testing/LLVMBuild.txt llvm/lib/Testing/Support/CMakeLists.txt llvm/lib/Testing/Support/LLVMBuild.txt llvm/lib/TextAPI/CMakeLists.txt llvm/lib/TextAPI/LLVMBuild.txt llvm/lib/ToolDrivers/CMakeLists.txt llvm/lib/ToolDrivers/LLVMBuild.txt llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt llvm/lib/ToolDrivers/llvm-dlltool/LLVMBuild.txt llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt llvm/lib/ToolDrivers/llvm-lib/LLVMBuild.txt llvm/lib/Transforms/AggressiveInstCombine/CMakeLists.txt llvm/lib/Transforms/AggressiveInstCombine/LLVMBuild.txt llvm/lib/Transforms/CFGuard/CMakeLists.txt llvm/lib/Transforms/CFGuard/LLVMBuild.txt llvm/lib/Transforms/CMakeLists.txt llvm/lib/Transforms/Coroutines/CMakeLists.txt llvm/lib/Transforms/Coroutines/LLVMBuild.txt llvm/lib/Transforms/Hello/ llvm/lib/Transforms/IPO/CMakeLists.txt llvm/lib/Transforms/IPO/LLVMBuild.txt llvm/lib/Transforms/InstCombine/CMakeLists.txt llvm/lib/Transforms/InstCombine/LLVMBuild.txt llvm/lib/Transforms/Instrumentation/CMakeLists.txt llvm/lib/Transforms/Instrumentation/LLVMBuild.txt llvm/lib/Transforms/LLVMBuild.txt llvm/lib/Transforms/ObjCARC/CMakeLists.txt llvm/lib/Transforms/ObjCARC/LLVMBuild.txt llvm/lib/Transforms/Scalar/CMakeLists.txt llvm/lib/Transforms/Scalar/LLVMBuild.txt llvm/lib/Transforms/Utils/CMakeLists.txt llvm/lib/Transforms/Utils/LLVMBuild.txt llvm/lib/Transforms/Vectorize/CMakeLists.txt llvm/lib/Transforms/Vectorize/LLVMBuild.txt llvm/lib/WindowsManifest/CMakeLists.txt llvm/lib/WindowsManifest/LLVMBuild.txt llvm/lib/XRay/CMakeLists.txt llvm/lib/XRay/LLVMBuild.txt llvm/llvm.spec.in llvm/projects/ llvm/resources/ llvm/runtimes/ llvm/test/ llvm/tools/CMakeLists.txt llvm/tools/LLVMBuild.txt llvm/tools/bugpoint/CMakeLists.txt llvm/tools/bugpoint/LLVMBuild.txt llvm/tools/bugpoint-passes/ llvm/tools/dsymutil/ llvm/tools/gold/ llvm/tools/llc/CMakeLists.txt llvm/tools/llc/LLVMBuild.txt llvm/tools/lli/CMakeLists.txt llvm/tools/lli/ChildTarget/CMakeLists.txt llvm/tools/lli/ChildTarget/LLVMBuild.txt llvm/tools/lli/LLVMBuild.txt llvm/tools/llvm-ar/CMakeLists.txt llvm/tools/llvm-ar/LLVMBuild.txt llvm/tools/llvm-as/CMakeLists.txt llvm/tools/llvm-as/LLVMBuild.txt llvm/tools/llvm-as-fuzzer/ llvm/tools/llvm-bcanalyzer/CMakeLists.txt llvm/tools/llvm-bcanalyzer/LLVMBuild.txt llvm/tools/llvm-c-test/ llvm/tools/llvm-cat/ llvm/tools/llvm-cfi-verify/ llvm/tools/llvm-config/ llvm/tools/llvm-cov/CMakeLists.txt llvm/tools/llvm-cov/LLVMBuild.txt llvm/tools/llvm-cvtres/ llvm/tools/llvm-cxxdump/CMakeLists.txt llvm/tools/llvm-cxxdump/LLVMBuild.txt llvm/tools/llvm-cxxfilt/CMakeLists.txt llvm/tools/llvm-cxxmap/CMakeLists.txt llvm/tools/llvm-cxxmap/LLVMBuild.txt llvm/tools/llvm-diff/CMakeLists.txt llvm/tools/llvm-diff/LLVMBuild.txt llvm/tools/llvm-dis/CMakeLists.txt llvm/tools/llvm-dis/LLVMBuild.txt llvm/tools/llvm-dwarfdump/CMakeLists.txt llvm/tools/llvm-dwarfdump/LLVMBuild.txt llvm/tools/llvm-dwarfdump/fuzzer/ llvm/tools/llvm-dwp/ llvm/tools/llvm-elfabi/ llvm/tools/llvm-exegesis/ llvm/tools/llvm-extract/CMakeLists.txt llvm/tools/llvm-extract/LLVMBuild.txt llvm/tools/llvm-go/ llvm/tools/llvm-ifs/ llvm/tools/llvm-isel-fuzzer/ llvm/tools/llvm-itanium-demangle-fuzzer/ llvm/tools/llvm-jitlink/ llvm/tools/llvm-jitlistener/ llvm/tools/llvm-link/CMakeLists.txt llvm/tools/llvm-link/LLVMBuild.txt llvm/tools/llvm-lipo/ llvm/tools/llvm-lto/CMakeLists.txt llvm/tools/llvm-lto/LLVMBuild.txt llvm/tools/llvm-lto2/CMakeLists.txt llvm/tools/llvm-lto2/LLVMBuild.txt llvm/tools/llvm-mc/CMakeLists.txt llvm/tools/llvm-mc/LLVMBuild.txt llvm/tools/llvm-mc-assemble-fuzzer/ llvm/tools/llvm-mc-disassemble-fuzzer/ llvm/tools/llvm-mca/CMakeLists.txt llvm/tools/llvm-mca/LLVMBuild.txt llvm/tools/llvm-microsoft-demangle-fuzzer/ llvm/tools/llvm-modextract/CMakeLists.txt llvm/tools/llvm-modextract/LLVMBuild.txt llvm/tools/llvm-mt/ llvm/tools/llvm-nm/CMakeLists.txt llvm/tools/llvm-nm/LLVMBuild.txt llvm/tools/llvm-objcopy/CMakeLists.txt llvm/tools/llvm-objcopy/LLVMBuild.txt llvm/tools/llvm-objdump/CMakeLists.txt llvm/tools/llvm-objdump/LLVMBuild.txt llvm/tools/llvm-opt-fuzzer/ llvm/tools/llvm-opt-report/ llvm/tools/llvm-pdbutil/CMakeLists.txt llvm/tools/llvm-pdbutil/LLVMBuild.txt llvm/tools/llvm-profdata/CMakeLists.txt llvm/tools/llvm-profdata/LLVMBuild.txt llvm/tools/llvm-rc/ llvm/tools/llvm-readobj/CMakeLists.txt llvm/tools/llvm-readobj/LLVMBuild.txt llvm/tools/llvm-reduce/ llvm/tools/llvm-rtdyld/CMakeLists.txt llvm/tools/llvm-rtdyld/LLVMBuild.txt llvm/tools/llvm-shlib/ llvm/tools/llvm-size/ llvm/tools/llvm-special-case-list-fuzzer/ llvm/tools/llvm-split/ llvm/tools/llvm-stress/CMakeLists.txt llvm/tools/llvm-stress/LLVMBuild.txt llvm/tools/llvm-strings/ llvm/tools/llvm-symbolizer/CMakeLists.txt llvm/tools/llvm-undname/ llvm/tools/llvm-xray/CMakeLists.txt llvm/tools/llvm-yaml-numeric-parser-fuzzer/ llvm/tools/lto/ llvm/tools/msbuild/ llvm/tools/obj2yaml/ llvm/tools/opt/CMakeLists.txt llvm/tools/opt/LLVMBuild.txt llvm/tools/opt-viewer/ llvm/tools/remarks-shlib/ llvm/tools/sancov/ llvm/tools/sanstats/ llvm/tools/verify-uselistorder/ llvm/tools/vfabi-demangle-fuzzer/ llvm/tools/xcode-toolchain/ llvm/tools/yaml2obj/ llvm/unittests/ llvm/utils/DSAclean.py llvm/utils/DSAextract.py llvm/utils/FileCheck/ llvm/utils/GenLibDeps.pl llvm/utils/GetRepositoryPath llvm/utils/GetSourceVersion llvm/utils/KillTheDoctor/ llvm/utils/LLVMBuild.txt llvm/utils/LLVMVisualizers/ llvm/utils/Misc/ llvm/utils/PerfectShuffle/ llvm/utils/Reviewing/ llvm/utils/TableGen/CMakeLists.txt llvm/utils/TableGen/GlobalISel/CMakeLists.txt llvm/utils/TableGen/LLVMBuild.txt llvm/utils/TableGen/tdtags llvm/utils/Target/ llvm/utils/UpdateCMakeLists.pl llvm/utils/UpdateTestChecks/ llvm/utils/abtest.py llvm/utils/add_argument_names.py llvm/utils/benchmark/ llvm/utils/bisect llvm/utils/bisect-skip-count llvm/utils/bugpoint/ llvm/utils/bugpoint_gisel_reducer.py llvm/utils/check-each-file llvm/utils/chunk-print-before-all.py llvm/utils/clang-parse-diagnostics-file llvm/utils/codegen-diff llvm/utils/collect_and_build_with_pgo.py llvm/utils/count/ llvm/utils/countloc.sh llvm/utils/create_ladder_graph.py llvm/utils/crosstool/ llvm/utils/demangle_tree.py llvm/utils/docker/ llvm/utils/emacs/ llvm/utils/extract_symbols.py llvm/utils/extract_vplan.py llvm/utils/findmisopt llvm/utils/findoptdiff llvm/utils/findsym.pl llvm/utils/fpcmp/ llvm/utils/gdb-scripts/ llvm/utils/getsrcs.sh llvm/utils/git-svn/ llvm/utils/gn/ llvm/utils/indirect_calls.py llvm/utils/jedit/ llvm/utils/kate/ llvm/utils/lint/ llvm/utils/lit/ llvm/utils/lldbDataFormatters.py llvm/utils/llvm-build/ llvm/utils/llvm-compilers-check llvm/utils/llvm-gisel-cov.py llvm/utils/llvm-lit/ llvm/utils/llvm-locstats/ llvm/utils/llvm-native-gxx llvm/utils/llvm.grm llvm/utils/llvmdo llvm/utils/llvmgrep llvm/utils/not/ llvm/utils/prepare-code-coverage-artifact.py llvm/utils/release/ llvm/utils/sanitizers/ llvm/utils/schedcover.py llvm/utils/shuffle_fuzz.py llvm/utils/shuffle_select_fuzz_tester.py llvm/utils/sort_includes.py llvm/utils/testgen/ llvm/utils/textmate/ llvm/utils/unicode-case-fold.py llvm/utils/unittest/ llvm/utils/update_analyze_test_checks.py llvm/utils/update_cc_test_checks.py llvm/utils/update_llc_test_checks.py llvm/utils/update_mca_test_checks.py llvm/utils/update_mir_test_checks.py llvm/utils/update_test_checks.py llvm/utils/valgrind/ llvm/utils/vim/ llvm/utils/vscode/ llvm/utils/wciia.py llvm/utils/yaml-bench/ mlir/ openmp/.arcconfig openmp/.gitignore openmp/CMakeLists.txt openmp/README.rst openmp/cmake/ openmp/libomptarget/ openmp/runtime/.clang-format openmp/runtime/CMakeLists.txt openmp/runtime/README.txt openmp/runtime/cmake/ openmp/runtime/doc/ openmp/runtime/src/CMakeLists.txt openmp/runtime/test/ openmp/runtime/tools/ openmp/tools/ openmp/www/ parallel-libs/ polly/ pstl/ Index: head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp =================================================================== --- head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp (revision 362444) +++ head/contrib/llvm-project/clang/lib/Sema/SemaTemplate.cpp (revision 362445) @@ -1,10866 +1,10872 @@ //===------- SemaTemplate.cpp - Semantic Analysis for C++ Templates -------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception //===----------------------------------------------------------------------===// // // This file implements semantic analysis for C++ templates. //===----------------------------------------------------------------------===// #include "TreeTransform.h" #include "clang/AST/ASTConsumer.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/AST/TypeVisitor.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/PartialDiagnostic.h" #include "clang/Basic/Stack.h" #include "clang/Basic/TargetInfo.h" #include "clang/Sema/DeclSpec.h" #include "clang/Sema/Lookup.h" #include "clang/Sema/Overload.h" #include "clang/Sema/ParsedTemplate.h" #include "clang/Sema/Scope.h" #include "clang/Sema/SemaInternal.h" #include "clang/Sema/Template.h" #include "clang/Sema/TemplateDeduction.h" #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include using namespace clang; using namespace sema; // Exported for use by Parser. SourceRange clang::getTemplateParamsRange(TemplateParameterList const * const *Ps, unsigned N) { if (!N) return SourceRange(); return SourceRange(Ps[0]->getTemplateLoc(), Ps[N-1]->getRAngleLoc()); } unsigned Sema::getTemplateDepth(Scope *S) const { unsigned Depth = 0; // Each template parameter scope represents one level of template parameter // depth. for (Scope *TempParamScope = S->getTemplateParamParent(); TempParamScope && !Depth; TempParamScope = TempParamScope->getParent()->getTemplateParamParent()) { ++Depth; } // Note that there are template parameters with the given depth. auto ParamsAtDepth = [&](unsigned D) { Depth = std::max(Depth, D + 1); }; // Look for parameters of an enclosing generic lambda. We don't create a // template parameter scope for these. for (FunctionScopeInfo *FSI : getFunctionScopes()) { if (auto *LSI = dyn_cast(FSI)) { if (!LSI->TemplateParams.empty()) { ParamsAtDepth(LSI->AutoTemplateParameterDepth); break; } if (LSI->GLTemplateParameterList) { ParamsAtDepth(LSI->GLTemplateParameterList->getDepth()); break; } } } // Look for parameters of an enclosing terse function template. We don't // create a template parameter scope for these either. for (const InventedTemplateParameterInfo &Info : getInventedParameterInfos()) { if (!Info.TemplateParams.empty()) { ParamsAtDepth(Info.AutoTemplateParameterDepth); break; } } return Depth; } /// \brief Determine whether the declaration found is acceptable as the name /// of a template and, if so, return that template declaration. Otherwise, /// returns null. /// /// Note that this may return an UnresolvedUsingValueDecl if AllowDependent /// is true. In all other cases it will return a TemplateDecl (or null). NamedDecl *Sema::getAsTemplateNameDecl(NamedDecl *D, bool AllowFunctionTemplates, bool AllowDependent) { D = D->getUnderlyingDecl(); if (isa(D)) { if (!AllowFunctionTemplates && isa(D)) return nullptr; return D; } if (CXXRecordDecl *Record = dyn_cast(D)) { // C++ [temp.local]p1: // Like normal (non-template) classes, class templates have an // injected-class-name (Clause 9). The injected-class-name // can be used with or without a template-argument-list. When // it is used without a template-argument-list, it is // equivalent to the injected-class-name followed by the // template-parameters of the class template enclosed in // <>. When it is used with a template-argument-list, it // refers to the specified class template specialization, // which could be the current specialization or another // specialization. if (Record->isInjectedClassName()) { Record = cast(Record->getDeclContext()); if (Record->getDescribedClassTemplate()) return Record->getDescribedClassTemplate(); if (ClassTemplateSpecializationDecl *Spec = dyn_cast(Record)) return Spec->getSpecializedTemplate(); } return nullptr; } // 'using Dependent::foo;' can resolve to a template name. // 'using typename Dependent::foo;' cannot (not even if 'foo' is an // injected-class-name). if (AllowDependent && isa(D)) return D; return nullptr; } void Sema::FilterAcceptableTemplateNames(LookupResult &R, bool AllowFunctionTemplates, bool AllowDependent) { LookupResult::Filter filter = R.makeFilter(); while (filter.hasNext()) { NamedDecl *Orig = filter.next(); if (!getAsTemplateNameDecl(Orig, AllowFunctionTemplates, AllowDependent)) filter.erase(); } filter.done(); } bool Sema::hasAnyAcceptableTemplateNames(LookupResult &R, bool AllowFunctionTemplates, bool AllowDependent, bool AllowNonTemplateFunctions) { for (LookupResult::iterator I = R.begin(), IEnd = R.end(); I != IEnd; ++I) { if (getAsTemplateNameDecl(*I, AllowFunctionTemplates, AllowDependent)) return true; if (AllowNonTemplateFunctions && isa((*I)->getUnderlyingDecl())) return true; } return false; } TemplateNameKind Sema::isTemplateName(Scope *S, CXXScopeSpec &SS, bool hasTemplateKeyword, const UnqualifiedId &Name, ParsedType ObjectTypePtr, bool EnteringContext, TemplateTy &TemplateResult, bool &MemberOfUnknownSpecialization, bool Disambiguation) { assert(getLangOpts().CPlusPlus && "No template names in C!"); DeclarationName TName; MemberOfUnknownSpecialization = false; switch (Name.getKind()) { case UnqualifiedIdKind::IK_Identifier: TName = DeclarationName(Name.Identifier); break; case UnqualifiedIdKind::IK_OperatorFunctionId: TName = Context.DeclarationNames.getCXXOperatorName( Name.OperatorFunctionId.Operator); break; case UnqualifiedIdKind::IK_LiteralOperatorId: TName = Context.DeclarationNames.getCXXLiteralOperatorName(Name.Identifier); break; default: return TNK_Non_template; } QualType ObjectType = ObjectTypePtr.get(); AssumedTemplateKind AssumedTemplate; LookupResult R(*this, TName, Name.getBeginLoc(), LookupOrdinaryName); if (LookupTemplateName(R, S, SS, ObjectType, EnteringContext, MemberOfUnknownSpecialization, SourceLocation(), &AssumedTemplate, Disambiguation)) return TNK_Non_template; if (AssumedTemplate != AssumedTemplateKind::None) { TemplateResult = TemplateTy::make(Context.getAssumedTemplateName(TName)); // Let the parser know whether we found nothing or found functions; if we // found nothing, we want to more carefully check whether this is actually // a function template name versus some other kind of undeclared identifier. return AssumedTemplate == AssumedTemplateKind::FoundNothing ? TNK_Undeclared_template : TNK_Function_template; } if (R.empty()) return TNK_Non_template; NamedDecl *D = nullptr; if (R.isAmbiguous()) { // If we got an ambiguity involving a non-function template, treat this // as a template name, and pick an arbitrary template for error recovery. bool AnyFunctionTemplates = false; for (NamedDecl *FoundD : R) { if (NamedDecl *FoundTemplate = getAsTemplateNameDecl(FoundD)) { if (isa(FoundTemplate)) AnyFunctionTemplates = true; else { D = FoundTemplate; break; } } } // If we didn't find any templates at all, this isn't a template name. // Leave the ambiguity for a later lookup to diagnose. if (!D && !AnyFunctionTemplates) { R.suppressDiagnostics(); return TNK_Non_template; } // If the only templates were function templates, filter out the rest. // We'll diagnose the ambiguity later. if (!D) FilterAcceptableTemplateNames(R); } // At this point, we have either picked a single template name declaration D // or we have a non-empty set of results R containing either one template name // declaration or a set of function templates. TemplateName Template; TemplateNameKind TemplateKind; unsigned ResultCount = R.end() - R.begin(); if (!D && ResultCount > 1) { // We assume that we'll preserve the qualifier from a function // template name in other ways. Template = Context.getOverloadedTemplateName(R.begin(), R.end()); TemplateKind = TNK_Function_template; // We'll do this lookup again later. R.suppressDiagnostics(); } else { if (!D) { D = getAsTemplateNameDecl(*R.begin()); assert(D && "unambiguous result is not a template name"); } if (isa(D)) { // We don't yet know whether this is a template-name or not. MemberOfUnknownSpecialization = true; return TNK_Non_template; } TemplateDecl *TD = cast(D); if (SS.isSet() && !SS.isInvalid()) { NestedNameSpecifier *Qualifier = SS.getScopeRep(); Template = Context.getQualifiedTemplateName(Qualifier, hasTemplateKeyword, TD); } else { Template = TemplateName(TD); } if (isa(TD)) { TemplateKind = TNK_Function_template; // We'll do this lookup again later. R.suppressDiagnostics(); } else { assert(isa(TD) || isa(TD) || isa(TD) || isa(TD) || isa(TD) || isa(TD)); TemplateKind = isa(TD) ? TNK_Var_template : isa(TD) ? TNK_Concept_template : TNK_Type_template; } } TemplateResult = TemplateTy::make(Template); return TemplateKind; } bool Sema::isDeductionGuideName(Scope *S, const IdentifierInfo &Name, SourceLocation NameLoc, ParsedTemplateTy *Template) { CXXScopeSpec SS; bool MemberOfUnknownSpecialization = false; // We could use redeclaration lookup here, but we don't need to: the // syntactic form of a deduction guide is enough to identify it even // if we can't look up the template name at all. LookupResult R(*this, DeclarationName(&Name), NameLoc, LookupOrdinaryName); if (LookupTemplateName(R, S, SS, /*ObjectType*/ QualType(), /*EnteringContext*/ false, MemberOfUnknownSpecialization)) return false; if (R.empty()) return false; if (R.isAmbiguous()) { // FIXME: Diagnose an ambiguity if we find at least one template. R.suppressDiagnostics(); return false; } // We only treat template-names that name type templates as valid deduction // guide names. TemplateDecl *TD = R.getAsSingle(); if (!TD || !getAsTypeTemplateDecl(TD)) return false; if (Template) *Template = TemplateTy::make(TemplateName(TD)); return true; } bool Sema::DiagnoseUnknownTemplateName(const IdentifierInfo &II, SourceLocation IILoc, Scope *S, const CXXScopeSpec *SS, TemplateTy &SuggestedTemplate, TemplateNameKind &SuggestedKind) { // We can't recover unless there's a dependent scope specifier preceding the // template name. // FIXME: Typo correction? if (!SS || !SS->isSet() || !isDependentScopeSpecifier(*SS) || computeDeclContext(*SS)) return false; // The code is missing a 'template' keyword prior to the dependent template // name. NestedNameSpecifier *Qualifier = (NestedNameSpecifier*)SS->getScopeRep(); Diag(IILoc, diag::err_template_kw_missing) << Qualifier << II.getName() << FixItHint::CreateInsertion(IILoc, "template "); SuggestedTemplate = TemplateTy::make(Context.getDependentTemplateName(Qualifier, &II)); SuggestedKind = TNK_Dependent_template_name; return true; } bool Sema::LookupTemplateName(LookupResult &Found, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, bool &MemberOfUnknownSpecialization, SourceLocation TemplateKWLoc, AssumedTemplateKind *ATK, bool Disambiguation) { if (ATK) *ATK = AssumedTemplateKind::None; Found.setTemplateNameLookup(true); // Determine where to perform name lookup MemberOfUnknownSpecialization = false; DeclContext *LookupCtx = nullptr; bool IsDependent = false; if (!ObjectType.isNull()) { // This nested-name-specifier occurs in a member access expression, e.g., // x->B::f, and we are looking into the type of the object. assert(!SS.isSet() && "ObjectType and scope specifier cannot coexist"); LookupCtx = computeDeclContext(ObjectType); IsDependent = !LookupCtx && ObjectType->isDependentType(); assert((IsDependent || !ObjectType->isIncompleteType() || ObjectType->castAs()->isBeingDefined()) && "Caller should have completed object type"); // Template names cannot appear inside an Objective-C class or object type // or a vector type. // // FIXME: This is wrong. For example: // // template using Vec = T __attribute__((ext_vector_type(4))); // Vec vi; // vi.Vec::~Vec(); // // ... should be accepted but we will not treat 'Vec' as a template name // here. The right thing to do would be to check if the name is a valid // vector component name, and look up a template name if not. And similarly // for lookups into Objective-C class and object types, where the same // problem can arise. if (ObjectType->isObjCObjectOrInterfaceType() || ObjectType->isVectorType()) { Found.clear(); return false; } } else if (SS.isSet()) { // This nested-name-specifier occurs after another nested-name-specifier, // so long into the context associated with the prior nested-name-specifier. LookupCtx = computeDeclContext(SS, EnteringContext); IsDependent = !LookupCtx; // The declaration context must be complete. if (LookupCtx && RequireCompleteDeclContext(SS, LookupCtx)) return true; } bool ObjectTypeSearchedInScope = false; bool AllowFunctionTemplatesInLookup = true; if (LookupCtx) { // Perform "qualified" name lookup into the declaration context we // computed, which is either the type of the base of a member access // expression or the declaration context associated with a prior // nested-name-specifier. LookupQualifiedName(Found, LookupCtx); // FIXME: The C++ standard does not clearly specify what happens in the // case where the object type is dependent, and implementations vary. In // Clang, we treat a name after a . or -> as a template-name if lookup // finds a non-dependent member or member of the current instantiation that // is a type template, or finds no such members and lookup in the context // of the postfix-expression finds a type template. In the latter case, the // name is nonetheless dependent, and we may resolve it to a member of an // unknown specialization when we come to instantiate the template. IsDependent |= Found.wasNotFoundInCurrentInstantiation(); } if (!SS.isSet() && (ObjectType.isNull() || Found.empty())) { // C++ [basic.lookup.classref]p1: // In a class member access expression (5.2.5), if the . or -> token is // immediately followed by an identifier followed by a <, the // identifier must be looked up to determine whether the < is the // beginning of a template argument list (14.2) or a less-than operator. // The identifier is first looked up in the class of the object // expression. If the identifier is not found, it is then looked up in // the context of the entire postfix-expression and shall name a class // template. if (S) LookupName(Found, S); if (!ObjectType.isNull()) { // FIXME: We should filter out all non-type templates here, particularly // variable templates and concepts. But the exclusion of alias templates // and template template parameters is a wording defect. AllowFunctionTemplatesInLookup = false; ObjectTypeSearchedInScope = true; } IsDependent |= Found.wasNotFoundInCurrentInstantiation(); } if (Found.isAmbiguous()) return false; if (ATK && !SS.isSet() && ObjectType.isNull() && TemplateKWLoc.isInvalid()) { // C++2a [temp.names]p2: // A name is also considered to refer to a template if it is an // unqualified-id followed by a < and name lookup finds either one or more // functions or finds nothing. // // To keep our behavior consistent, we apply the "finds nothing" part in // all language modes, and diagnose the empty lookup in ActOnCallExpr if we // successfully form a call to an undeclared template-id. bool AllFunctions = getLangOpts().CPlusPlus2a && std::all_of(Found.begin(), Found.end(), [](NamedDecl *ND) { return isa(ND->getUnderlyingDecl()); }); if (AllFunctions || (Found.empty() && !IsDependent)) { // If lookup found any functions, or if this is a name that can only be // used for a function, then strongly assume this is a function // template-id. *ATK = (Found.empty() && Found.getLookupName().isIdentifier()) ? AssumedTemplateKind::FoundNothing : AssumedTemplateKind::FoundFunctions; Found.clear(); return false; } } if (Found.empty() && !IsDependent && !Disambiguation) { // If we did not find any names, and this is not a disambiguation, attempt // to correct any typos. DeclarationName Name = Found.getLookupName(); Found.clear(); // Simple filter callback that, for keywords, only accepts the C++ *_cast DefaultFilterCCC FilterCCC{}; FilterCCC.WantTypeSpecifiers = false; FilterCCC.WantExpressionKeywords = false; FilterCCC.WantRemainingKeywords = false; FilterCCC.WantCXXNamedCasts = true; if (TypoCorrection Corrected = CorrectTypo(Found.getLookupNameInfo(), Found.getLookupKind(), S, &SS, FilterCCC, CTK_ErrorRecovery, LookupCtx)) { if (auto *ND = Corrected.getFoundDecl()) Found.addDecl(ND); FilterAcceptableTemplateNames(Found); if (Found.isAmbiguous()) { Found.clear(); } else if (!Found.empty()) { Found.setLookupName(Corrected.getCorrection()); if (LookupCtx) { std::string CorrectedStr(Corrected.getAsString(getLangOpts())); bool DroppedSpecifier = Corrected.WillReplaceSpecifier() && Name.getAsString() == CorrectedStr; diagnoseTypo(Corrected, PDiag(diag::err_no_member_template_suggest) << Name << LookupCtx << DroppedSpecifier << SS.getRange()); } else { diagnoseTypo(Corrected, PDiag(diag::err_no_template_suggest) << Name); } } } } NamedDecl *ExampleLookupResult = Found.empty() ? nullptr : Found.getRepresentativeDecl(); FilterAcceptableTemplateNames(Found, AllowFunctionTemplatesInLookup); if (Found.empty()) { if (IsDependent) { MemberOfUnknownSpecialization = true; return false; } // If a 'template' keyword was used, a lookup that finds only non-template // names is an error. if (ExampleLookupResult && TemplateKWLoc.isValid()) { Diag(Found.getNameLoc(), diag::err_template_kw_refers_to_non_template) << Found.getLookupName() << SS.getRange(); Diag(ExampleLookupResult->getUnderlyingDecl()->getLocation(), diag::note_template_kw_refers_to_non_template) << Found.getLookupName(); return true; } return false; } if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope && !getLangOpts().CPlusPlus11) { // C++03 [basic.lookup.classref]p1: // [...] If the lookup in the class of the object expression finds a // template, the name is also looked up in the context of the entire // postfix-expression and [...] // // Note: C++11 does not perform this second lookup. LookupResult FoundOuter(*this, Found.getLookupName(), Found.getNameLoc(), LookupOrdinaryName); FoundOuter.setTemplateNameLookup(true); LookupName(FoundOuter, S); // FIXME: We silently accept an ambiguous lookup here, in violation of // [basic.lookup]/1. FilterAcceptableTemplateNames(FoundOuter, /*AllowFunctionTemplates=*/false); NamedDecl *OuterTemplate; if (FoundOuter.empty()) { // - if the name is not found, the name found in the class of the // object expression is used, otherwise } else if (FoundOuter.isAmbiguous() || !FoundOuter.isSingleResult() || !(OuterTemplate = getAsTemplateNameDecl(FoundOuter.getFoundDecl()))) { // - if the name is found in the context of the entire // postfix-expression and does not name a class template, the name // found in the class of the object expression is used, otherwise FoundOuter.clear(); } else if (!Found.isSuppressingDiagnostics()) { // - if the name found is a class template, it must refer to the same // entity as the one found in the class of the object expression, // otherwise the program is ill-formed. if (!Found.isSingleResult() || getAsTemplateNameDecl(Found.getFoundDecl())->getCanonicalDecl() != OuterTemplate->getCanonicalDecl()) { Diag(Found.getNameLoc(), diag::ext_nested_name_member_ref_lookup_ambiguous) << Found.getLookupName() << ObjectType; Diag(Found.getRepresentativeDecl()->getLocation(), diag::note_ambig_member_ref_object_type) << ObjectType; Diag(FoundOuter.getFoundDecl()->getLocation(), diag::note_ambig_member_ref_scope); // Recover by taking the template that we found in the object // expression's type. } } } return false; } void Sema::diagnoseExprIntendedAsTemplateName(Scope *S, ExprResult TemplateName, SourceLocation Less, SourceLocation Greater) { if (TemplateName.isInvalid()) return; DeclarationNameInfo NameInfo; CXXScopeSpec SS; LookupNameKind LookupKind; DeclContext *LookupCtx = nullptr; NamedDecl *Found = nullptr; bool MissingTemplateKeyword = false; // Figure out what name we looked up. if (auto *DRE = dyn_cast(TemplateName.get())) { NameInfo = DRE->getNameInfo(); SS.Adopt(DRE->getQualifierLoc()); LookupKind = LookupOrdinaryName; Found = DRE->getFoundDecl(); } else if (auto *ME = dyn_cast(TemplateName.get())) { NameInfo = ME->getMemberNameInfo(); SS.Adopt(ME->getQualifierLoc()); LookupKind = LookupMemberName; LookupCtx = ME->getBase()->getType()->getAsCXXRecordDecl(); Found = ME->getMemberDecl(); } else if (auto *DSDRE = dyn_cast(TemplateName.get())) { NameInfo = DSDRE->getNameInfo(); SS.Adopt(DSDRE->getQualifierLoc()); MissingTemplateKeyword = true; } else if (auto *DSME = dyn_cast(TemplateName.get())) { NameInfo = DSME->getMemberNameInfo(); SS.Adopt(DSME->getQualifierLoc()); MissingTemplateKeyword = true; } else { llvm_unreachable("unexpected kind of potential template name"); } // If this is a dependent-scope lookup, diagnose that the 'template' keyword // was missing. if (MissingTemplateKeyword) { Diag(NameInfo.getBeginLoc(), diag::err_template_kw_missing) << "" << NameInfo.getName().getAsString() << SourceRange(Less, Greater); return; } // Try to correct the name by looking for templates and C++ named casts. struct TemplateCandidateFilter : CorrectionCandidateCallback { Sema &S; TemplateCandidateFilter(Sema &S) : S(S) { WantTypeSpecifiers = false; WantExpressionKeywords = false; WantRemainingKeywords = false; WantCXXNamedCasts = true; }; bool ValidateCandidate(const TypoCorrection &Candidate) override { if (auto *ND = Candidate.getCorrectionDecl()) return S.getAsTemplateNameDecl(ND); return Candidate.isKeyword(); } std::unique_ptr clone() override { return std::make_unique(*this); } }; DeclarationName Name = NameInfo.getName(); TemplateCandidateFilter CCC(*this); if (TypoCorrection Corrected = CorrectTypo(NameInfo, LookupKind, S, &SS, CCC, CTK_ErrorRecovery, LookupCtx)) { auto *ND = Corrected.getFoundDecl(); if (ND) ND = getAsTemplateNameDecl(ND); if (ND || Corrected.isKeyword()) { if (LookupCtx) { std::string CorrectedStr(Corrected.getAsString(getLangOpts())); bool DroppedSpecifier = Corrected.WillReplaceSpecifier() && Name.getAsString() == CorrectedStr; diagnoseTypo(Corrected, PDiag(diag::err_non_template_in_member_template_id_suggest) << Name << LookupCtx << DroppedSpecifier << SS.getRange(), false); } else { diagnoseTypo(Corrected, PDiag(diag::err_non_template_in_template_id_suggest) << Name, false); } if (Found) Diag(Found->getLocation(), diag::note_non_template_in_template_id_found); return; } } Diag(NameInfo.getLoc(), diag::err_non_template_in_template_id) << Name << SourceRange(Less, Greater); if (Found) Diag(Found->getLocation(), diag::note_non_template_in_template_id_found); } /// ActOnDependentIdExpression - Handle a dependent id-expression that /// was just parsed. This is only possible with an explicit scope /// specifier naming a dependent type. ExprResult Sema::ActOnDependentIdExpression(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool isAddressOfOperand, const TemplateArgumentListInfo *TemplateArgs) { DeclContext *DC = getFunctionLevelDeclContext(); // C++11 [expr.prim.general]p12: // An id-expression that denotes a non-static data member or non-static // member function of a class can only be used: // (...) // - if that id-expression denotes a non-static data member and it // appears in an unevaluated operand. // // If this might be the case, form a DependentScopeDeclRefExpr instead of a // CXXDependentScopeMemberExpr. The former can instantiate to either // DeclRefExpr or MemberExpr depending on lookup results, while the latter is // always a MemberExpr. bool MightBeCxx11UnevalField = getLangOpts().CPlusPlus11 && isUnevaluatedContext(); // Check if the nested name specifier is an enum type. bool IsEnum = false; if (NestedNameSpecifier *NNS = SS.getScopeRep()) IsEnum = dyn_cast_or_null(NNS->getAsType()); if (!MightBeCxx11UnevalField && !isAddressOfOperand && !IsEnum && isa(DC) && cast(DC)->isInstance()) { QualType ThisType = cast(DC)->getThisType(); // Since the 'this' expression is synthesized, we don't need to // perform the double-lookup check. NamedDecl *FirstQualifierInScope = nullptr; return CXXDependentScopeMemberExpr::Create( Context, /*This*/ nullptr, ThisType, /*IsArrow*/ true, /*Op*/ SourceLocation(), SS.getWithLocInContext(Context), TemplateKWLoc, FirstQualifierInScope, NameInfo, TemplateArgs); } return BuildDependentDeclRefExpr(SS, TemplateKWLoc, NameInfo, TemplateArgs); } ExprResult Sema::BuildDependentDeclRefExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs) { // DependentScopeDeclRefExpr::Create requires a valid QualifierLoc NestedNameSpecifierLoc QualifierLoc = SS.getWithLocInContext(Context); if (!QualifierLoc) return ExprError(); return DependentScopeDeclRefExpr::Create( Context, QualifierLoc, TemplateKWLoc, NameInfo, TemplateArgs); } /// Determine whether we would be unable to instantiate this template (because /// it either has no definition, or is in the process of being instantiated). bool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain /*= true*/) { assert(isa(Instantiation) || isa(Instantiation) || isa(Instantiation)); bool IsEntityBeingDefined = false; if (const TagDecl *TD = dyn_cast_or_null(PatternDef)) IsEntityBeingDefined = TD->isBeingDefined(); if (PatternDef && !IsEntityBeingDefined) { NamedDecl *SuggestedDef = nullptr; if (!hasVisibleDefinition(const_cast(PatternDef), &SuggestedDef, /*OnlyNeedComplete*/false)) { // If we're allowed to diagnose this and recover, do so. bool Recover = Complain && !isSFINAEContext(); if (Complain) diagnoseMissingImport(PointOfInstantiation, SuggestedDef, Sema::MissingImportKind::Definition, Recover); return !Recover; } return false; } if (!Complain || (PatternDef && PatternDef->isInvalidDecl())) return true; llvm::Optional Note; QualType InstantiationTy; if (TagDecl *TD = dyn_cast(Instantiation)) InstantiationTy = Context.getTypeDeclType(TD); if (PatternDef) { Diag(PointOfInstantiation, diag::err_template_instantiate_within_definition) << /*implicit|explicit*/(TSK != TSK_ImplicitInstantiation) << InstantiationTy; // Not much point in noting the template declaration here, since // we're lexically inside it. Instantiation->setInvalidDecl(); } else if (InstantiatedFromMember) { if (isa(Instantiation)) { Diag(PointOfInstantiation, diag::err_explicit_instantiation_undefined_member) << /*member function*/ 1 << Instantiation->getDeclName() << Instantiation->getDeclContext(); Note = diag::note_explicit_instantiation_here; } else { assert(isa(Instantiation) && "Must be a TagDecl!"); Diag(PointOfInstantiation, diag::err_implicit_instantiate_member_undefined) << InstantiationTy; Note = diag::note_member_declared_at; } } else { if (isa(Instantiation)) { Diag(PointOfInstantiation, diag::err_explicit_instantiation_undefined_func_template) << Pattern; Note = diag::note_explicit_instantiation_here; } else if (isa(Instantiation)) { Diag(PointOfInstantiation, diag::err_template_instantiate_undefined) << (TSK != TSK_ImplicitInstantiation) << InstantiationTy; Note = diag::note_template_decl_here; } else { assert(isa(Instantiation) && "Must be a VarDecl!"); if (isa(Instantiation)) { Diag(PointOfInstantiation, diag::err_explicit_instantiation_undefined_var_template) << Instantiation; Instantiation->setInvalidDecl(); } else Diag(PointOfInstantiation, diag::err_explicit_instantiation_undefined_member) << /*static data member*/ 2 << Instantiation->getDeclName() << Instantiation->getDeclContext(); Note = diag::note_explicit_instantiation_here; } } if (Note) // Diagnostics were emitted. Diag(Pattern->getLocation(), Note.getValue()); // In general, Instantiation isn't marked invalid to get more than one // error for multiple undefined instantiations. But the code that does // explicit declaration -> explicit definition conversion can't handle // invalid declarations, so mark as invalid in that case. if (TSK == TSK_ExplicitInstantiationDeclaration) Instantiation->setInvalidDecl(); return true; } /// DiagnoseTemplateParameterShadow - Produce a diagnostic complaining /// that the template parameter 'PrevDecl' is being shadowed by a new /// declaration at location Loc. Returns true to indicate that this is /// an error, and false otherwise. void Sema::DiagnoseTemplateParameterShadow(SourceLocation Loc, Decl *PrevDecl) { assert(PrevDecl->isTemplateParameter() && "Not a template parameter"); // C++ [temp.local]p4: // A template-parameter shall not be redeclared within its // scope (including nested scopes). // // Make this a warning when MSVC compatibility is requested. unsigned DiagId = getLangOpts().MSVCCompat ? diag::ext_template_param_shadow : diag::err_template_param_shadow; Diag(Loc, DiagId) << cast(PrevDecl)->getDeclName(); Diag(PrevDecl->getLocation(), diag::note_template_param_here); } /// AdjustDeclIfTemplate - If the given decl happens to be a template, reset /// the parameter D to reference the templated declaration and return a pointer /// to the template declaration. Otherwise, do nothing to D and return null. TemplateDecl *Sema::AdjustDeclIfTemplate(Decl *&D) { if (TemplateDecl *Temp = dyn_cast_or_null(D)) { D = Temp->getTemplatedDecl(); return Temp; } return nullptr; } ParsedTemplateArgument ParsedTemplateArgument::getTemplatePackExpansion( SourceLocation EllipsisLoc) const { assert(Kind == Template && "Only template template arguments can be pack expansions here"); assert(getAsTemplate().get().containsUnexpandedParameterPack() && "Template template argument pack expansion without packs"); ParsedTemplateArgument Result(*this); Result.EllipsisLoc = EllipsisLoc; return Result; } static TemplateArgumentLoc translateTemplateArgument(Sema &SemaRef, const ParsedTemplateArgument &Arg) { switch (Arg.getKind()) { case ParsedTemplateArgument::Type: { TypeSourceInfo *DI; QualType T = SemaRef.GetTypeFromParser(Arg.getAsType(), &DI); if (!DI) DI = SemaRef.Context.getTrivialTypeSourceInfo(T, Arg.getLocation()); return TemplateArgumentLoc(TemplateArgument(T), DI); } case ParsedTemplateArgument::NonType: { Expr *E = static_cast(Arg.getAsExpr()); return TemplateArgumentLoc(TemplateArgument(E), E); } case ParsedTemplateArgument::Template: { TemplateName Template = Arg.getAsTemplate().get(); TemplateArgument TArg; if (Arg.getEllipsisLoc().isValid()) TArg = TemplateArgument(Template, Optional()); else TArg = Template; return TemplateArgumentLoc(TArg, Arg.getScopeSpec().getWithLocInContext( SemaRef.Context), Arg.getLocation(), Arg.getEllipsisLoc()); } } llvm_unreachable("Unhandled parsed template argument"); } /// Translates template arguments as provided by the parser /// into template arguments used by semantic analysis. void Sema::translateTemplateArguments(const ASTTemplateArgsPtr &TemplateArgsIn, TemplateArgumentListInfo &TemplateArgs) { for (unsigned I = 0, Last = TemplateArgsIn.size(); I != Last; ++I) TemplateArgs.addArgument(translateTemplateArgument(*this, TemplateArgsIn[I])); } static void maybeDiagnoseTemplateParameterShadow(Sema &SemaRef, Scope *S, SourceLocation Loc, IdentifierInfo *Name) { NamedDecl *PrevDecl = SemaRef.LookupSingleName( S, Name, Loc, Sema::LookupOrdinaryName, Sema::ForVisibleRedeclaration); if (PrevDecl && PrevDecl->isTemplateParameter()) SemaRef.DiagnoseTemplateParameterShadow(Loc, PrevDecl); } /// Convert a parsed type into a parsed template argument. This is mostly /// trivial, except that we may have parsed a C++17 deduced class template /// specialization type, in which case we should form a template template /// argument instead of a type template argument. ParsedTemplateArgument Sema::ActOnTemplateTypeArgument(TypeResult ParsedType) { TypeSourceInfo *TInfo; QualType T = GetTypeFromParser(ParsedType.get(), &TInfo); if (T.isNull()) return ParsedTemplateArgument(); assert(TInfo && "template argument with no location"); // If we might have formed a deduced template specialization type, convert // it to a template template argument. if (getLangOpts().CPlusPlus17) { TypeLoc TL = TInfo->getTypeLoc(); SourceLocation EllipsisLoc; if (auto PET = TL.getAs()) { EllipsisLoc = PET.getEllipsisLoc(); TL = PET.getPatternLoc(); } CXXScopeSpec SS; if (auto ET = TL.getAs()) { SS.Adopt(ET.getQualifierLoc()); TL = ET.getNamedTypeLoc(); } if (auto DTST = TL.getAs()) { TemplateName Name = DTST.getTypePtr()->getTemplateName(); if (SS.isSet()) Name = Context.getQualifiedTemplateName(SS.getScopeRep(), /*HasTemplateKeyword*/ false, Name.getAsTemplateDecl()); ParsedTemplateArgument Result(SS, TemplateTy::make(Name), DTST.getTemplateNameLoc()); if (EllipsisLoc.isValid()) Result = Result.getTemplatePackExpansion(EllipsisLoc); return Result; } } // This is a normal type template argument. Note, if the type template // argument is an injected-class-name for a template, it has a dual nature // and can be used as either a type or a template. We handle that in // convertTypeTemplateArgumentToTemplate. return ParsedTemplateArgument(ParsedTemplateArgument::Type, ParsedType.get().getAsOpaquePtr(), TInfo->getTypeLoc().getBeginLoc()); } /// ActOnTypeParameter - Called when a C++ template type parameter /// (e.g., "typename T") has been parsed. Typename specifies whether /// the keyword "typename" was used to declare the type parameter /// (otherwise, "class" was used), and KeyLoc is the location of the /// "class" or "typename" keyword. ParamName is the name of the /// parameter (NULL indicates an unnamed template parameter) and /// ParamNameLoc is the location of the parameter name (if any). /// If the type parameter has a default argument, it will be added /// later via ActOnTypeParameterDefault. NamedDecl *Sema::ActOnTypeParameter(Scope *S, bool Typename, SourceLocation EllipsisLoc, SourceLocation KeyLoc, IdentifierInfo *ParamName, SourceLocation ParamNameLoc, unsigned Depth, unsigned Position, SourceLocation EqualLoc, ParsedType DefaultArg, bool HasTypeConstraint) { assert(S->isTemplateParamScope() && "Template type parameter not in template parameter scope!"); bool IsParameterPack = EllipsisLoc.isValid(); TemplateTypeParmDecl *Param = TemplateTypeParmDecl::Create(Context, Context.getTranslationUnitDecl(), KeyLoc, ParamNameLoc, Depth, Position, ParamName, Typename, IsParameterPack, HasTypeConstraint); Param->setAccess(AS_public); if (Param->isParameterPack()) if (auto *LSI = getEnclosingLambda()) LSI->LocalPacks.push_back(Param); if (ParamName) { maybeDiagnoseTemplateParameterShadow(*this, S, ParamNameLoc, ParamName); // Add the template parameter into the current scope. S->AddDecl(Param); IdResolver.AddDecl(Param); } // C++0x [temp.param]p9: // A default template-argument may be specified for any kind of // template-parameter that is not a template parameter pack. if (DefaultArg && IsParameterPack) { Diag(EqualLoc, diag::err_template_param_pack_default_arg); DefaultArg = nullptr; } // Handle the default argument, if provided. if (DefaultArg) { TypeSourceInfo *DefaultTInfo; GetTypeFromParser(DefaultArg, &DefaultTInfo); assert(DefaultTInfo && "expected source information for type"); // Check for unexpanded parameter packs. if (DiagnoseUnexpandedParameterPack(ParamNameLoc, DefaultTInfo, UPPC_DefaultArgument)) return Param; // Check the template argument itself. if (CheckTemplateArgument(Param, DefaultTInfo)) { Param->setInvalidDecl(); return Param; } Param->setDefaultArgument(DefaultTInfo); } return Param; } /// Convert the parser's template argument list representation into our form. static TemplateArgumentListInfo makeTemplateArgumentListInfo(Sema &S, TemplateIdAnnotation &TemplateId) { TemplateArgumentListInfo TemplateArgs(TemplateId.LAngleLoc, TemplateId.RAngleLoc); ASTTemplateArgsPtr TemplateArgsPtr(TemplateId.getTemplateArgs(), TemplateId.NumArgs); S.translateTemplateArguments(TemplateArgsPtr, TemplateArgs); return TemplateArgs; } bool Sema::ActOnTypeConstraint(const CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstr, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc) { ConceptDecl *CD = cast(TypeConstr->Template.get().getAsTemplateDecl()); // C++2a [temp.param]p4: // [...] The concept designated by a type-constraint shall be a type // concept ([temp.concept]). if (!CD->isTypeConcept()) { Diag(TypeConstr->TemplateNameLoc, diag::err_type_constraint_non_type_concept); return true; } bool WereArgsSpecified = TypeConstr->LAngleLoc.isValid(); if (!WereArgsSpecified && CD->getTemplateParameters()->getMinRequiredArguments() > 1) { Diag(TypeConstr->TemplateNameLoc, diag::err_type_constraint_missing_arguments) << CD; return true; } TemplateArgumentListInfo TemplateArgs; if (TypeConstr->LAngleLoc.isValid()) { TemplateArgs = makeTemplateArgumentListInfo(*this, *TypeConstr); } return AttachTypeConstraint( SS.isSet() ? SS.getWithLocInContext(Context) : NestedNameSpecifierLoc(), DeclarationNameInfo(DeclarationName(TypeConstr->Name), TypeConstr->TemplateNameLoc), CD, TypeConstr->LAngleLoc.isValid() ? &TemplateArgs : nullptr, ConstrainedParameter, EllipsisLoc); } template static ExprResult formImmediatelyDeclaredConstraint( Sema &S, NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, ConceptDecl *NamedConcept, SourceLocation LAngleLoc, SourceLocation RAngleLoc, QualType ConstrainedType, SourceLocation ParamNameLoc, ArgumentLocAppender Appender, SourceLocation EllipsisLoc) { TemplateArgumentListInfo ConstraintArgs; ConstraintArgs.addArgument( S.getTrivialTemplateArgumentLoc(TemplateArgument(ConstrainedType), /*NTTPType=*/QualType(), ParamNameLoc)); ConstraintArgs.setRAngleLoc(RAngleLoc); ConstraintArgs.setLAngleLoc(LAngleLoc); Appender(ConstraintArgs); // C++2a [temp.param]p4: // [...] This constraint-expression E is called the immediately-declared // constraint of T. [...] CXXScopeSpec SS; SS.Adopt(NS); ExprResult ImmediatelyDeclaredConstraint = S.CheckConceptTemplateId( SS, /*TemplateKWLoc=*/SourceLocation(), NameInfo, /*FoundDecl=*/NamedConcept, NamedConcept, &ConstraintArgs); if (ImmediatelyDeclaredConstraint.isInvalid() || !EllipsisLoc.isValid()) return ImmediatelyDeclaredConstraint; // C++2a [temp.param]p4: // [...] If T is not a pack, then E is E', otherwise E is (E' && ...). // // We have the following case: // // template concept C1 = true; // template struct s1; // // The constraint: (C1 && ...) return S.BuildCXXFoldExpr(/*LParenLoc=*/SourceLocation(), ImmediatelyDeclaredConstraint.get(), BO_LAnd, EllipsisLoc, /*RHS=*/nullptr, /*RParenLoc=*/SourceLocation(), /*NumExpansions=*/None); } /// Attach a type-constraint to a template parameter. /// \returns true if an error occured. This can happen if the /// immediately-declared constraint could not be formed (e.g. incorrect number /// of arguments for the named concept). bool Sema::AttachTypeConstraint(NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, ConceptDecl *NamedConcept, const TemplateArgumentListInfo *TemplateArgs, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc) { // C++2a [temp.param]p4: // [...] If Q is of the form C, then let E' be // C. Otherwise, let E' be C. [...] const ASTTemplateArgumentListInfo *ArgsAsWritten = TemplateArgs ? ASTTemplateArgumentListInfo::Create(Context, *TemplateArgs) : nullptr; QualType ParamAsArgument(ConstrainedParameter->getTypeForDecl(), 0); ExprResult ImmediatelyDeclaredConstraint = formImmediatelyDeclaredConstraint( *this, NS, NameInfo, NamedConcept, TemplateArgs ? TemplateArgs->getLAngleLoc() : SourceLocation(), TemplateArgs ? TemplateArgs->getRAngleLoc() : SourceLocation(), ParamAsArgument, ConstrainedParameter->getLocation(), [&] (TemplateArgumentListInfo &ConstraintArgs) { if (TemplateArgs) for (const auto &ArgLoc : TemplateArgs->arguments()) ConstraintArgs.addArgument(ArgLoc); }, EllipsisLoc); if (ImmediatelyDeclaredConstraint.isInvalid()) return true; ConstrainedParameter->setTypeConstraint(NS, NameInfo, /*FoundDecl=*/NamedConcept, NamedConcept, ArgsAsWritten, ImmediatelyDeclaredConstraint.get()); return false; } bool Sema::AttachTypeConstraint(AutoTypeLoc TL, NonTypeTemplateParmDecl *NTTP, SourceLocation EllipsisLoc) { if (NTTP->getType() != TL.getType() || TL.getAutoKeyword() != AutoTypeKeyword::Auto) { Diag(NTTP->getTypeSourceInfo()->getTypeLoc().getBeginLoc(), diag::err_unsupported_placeholder_constraint) << NTTP->getTypeSourceInfo()->getTypeLoc().getSourceRange(); return true; } // FIXME: Concepts: This should be the type of the placeholder, but this is // unclear in the wording right now. DeclRefExpr *Ref = BuildDeclRefExpr(NTTP, NTTP->getType(), VK_RValue, NTTP->getLocation()); if (!Ref) return true; ExprResult ImmediatelyDeclaredConstraint = formImmediatelyDeclaredConstraint( *this, TL.getNestedNameSpecifierLoc(), TL.getConceptNameInfo(), TL.getNamedConcept(), TL.getLAngleLoc(), TL.getRAngleLoc(), BuildDecltypeType(Ref, NTTP->getLocation()), NTTP->getLocation(), [&] (TemplateArgumentListInfo &ConstraintArgs) { for (unsigned I = 0, C = TL.getNumArgs(); I != C; ++I) ConstraintArgs.addArgument(TL.getArgLoc(I)); }, EllipsisLoc); if (ImmediatelyDeclaredConstraint.isInvalid() || !ImmediatelyDeclaredConstraint.isUsable()) return true; NTTP->setPlaceholderTypeConstraint(ImmediatelyDeclaredConstraint.get()); return false; } /// Check that the type of a non-type template parameter is /// well-formed. /// /// \returns the (possibly-promoted) parameter type if valid; /// otherwise, produces a diagnostic and returns a NULL type. QualType Sema::CheckNonTypeTemplateParameterType(TypeSourceInfo *&TSI, SourceLocation Loc) { if (TSI->getType()->isUndeducedType()) { // C++17 [temp.dep.expr]p3: // An id-expression is type-dependent if it contains // - an identifier associated by name lookup with a non-type // template-parameter declared with a type that contains a // placeholder type (7.1.7.4), TSI = SubstAutoTypeSourceInfo(TSI, Context.DependentTy); } return CheckNonTypeTemplateParameterType(TSI->getType(), Loc); } QualType Sema::CheckNonTypeTemplateParameterType(QualType T, SourceLocation Loc) { // We don't allow variably-modified types as the type of non-type template // parameters. if (T->isVariablyModifiedType()) { Diag(Loc, diag::err_variably_modified_nontype_template_param) << T; return QualType(); } // C++ [temp.param]p4: // // A non-type template-parameter shall have one of the following // (optionally cv-qualified) types: // // -- integral or enumeration type, if (T->isIntegralOrEnumerationType() || // -- pointer to object or pointer to function, T->isPointerType() || // -- reference to object or reference to function, T->isReferenceType() || // -- pointer to member, T->isMemberPointerType() || // -- std::nullptr_t. T->isNullPtrType() || // Allow use of auto in template parameter declarations. T->isUndeducedType()) { // C++ [temp.param]p5: The top-level cv-qualifiers on the template-parameter // are ignored when determining its type. return T.getUnqualifiedType(); } // C++ [temp.param]p8: // // A non-type template-parameter of type "array of T" or // "function returning T" is adjusted to be of type "pointer to // T" or "pointer to function returning T", respectively. if (T->isArrayType() || T->isFunctionType()) return Context.getDecayedType(T); // If T is a dependent type, we can't do the check now, so we // assume that it is well-formed. Note that stripping off the // qualifiers here is not really correct if T turns out to be // an array type, but we'll recompute the type everywhere it's // used during instantiation, so that should be OK. (Using the // qualified type is equally wrong.) if (T->isDependentType()) return T.getUnqualifiedType(); Diag(Loc, diag::err_template_nontype_parm_bad_type) << T; return QualType(); } NamedDecl *Sema::ActOnNonTypeTemplateParameter(Scope *S, Declarator &D, unsigned Depth, unsigned Position, SourceLocation EqualLoc, Expr *Default) { TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S); // Check that we have valid decl-specifiers specified. auto CheckValidDeclSpecifiers = [this, &D] { // C++ [temp.param] // p1 // template-parameter: // ... // parameter-declaration // p2 // ... A storage class shall not be specified in a template-parameter // declaration. // [dcl.typedef]p1: // The typedef specifier [...] shall not be used in the decl-specifier-seq // of a parameter-declaration const DeclSpec &DS = D.getDeclSpec(); auto EmitDiag = [this](SourceLocation Loc) { Diag(Loc, diag::err_invalid_decl_specifier_in_nontype_parm) << FixItHint::CreateRemoval(Loc); }; if (DS.getStorageClassSpec() != DeclSpec::SCS_unspecified) EmitDiag(DS.getStorageClassSpecLoc()); if (DS.getThreadStorageClassSpec() != TSCS_unspecified) EmitDiag(DS.getThreadStorageClassSpecLoc()); // [dcl.inline]p1: // The inline specifier can be applied only to the declaration or // definition of a variable or function. if (DS.isInlineSpecified()) EmitDiag(DS.getInlineSpecLoc()); // [dcl.constexpr]p1: // The constexpr specifier shall be applied only to the definition of a // variable or variable template or the declaration of a function or // function template. if (DS.hasConstexprSpecifier()) EmitDiag(DS.getConstexprSpecLoc()); // [dcl.fct.spec]p1: // Function-specifiers can be used only in function declarations. if (DS.isVirtualSpecified()) EmitDiag(DS.getVirtualSpecLoc()); if (DS.hasExplicitSpecifier()) EmitDiag(DS.getExplicitSpecLoc()); if (DS.isNoreturnSpecified()) EmitDiag(DS.getNoreturnSpecLoc()); }; CheckValidDeclSpecifiers(); if (TInfo->getType()->isUndeducedType()) { Diag(D.getIdentifierLoc(), diag::warn_cxx14_compat_template_nontype_parm_auto_type) << QualType(TInfo->getType()->getContainedAutoType(), 0); } assert(S->isTemplateParamScope() && "Non-type template parameter not in template parameter scope!"); bool Invalid = false; QualType T = CheckNonTypeTemplateParameterType(TInfo, D.getIdentifierLoc()); if (T.isNull()) { T = Context.IntTy; // Recover with an 'int' type. Invalid = true; } CheckFunctionOrTemplateParamDeclarator(S, D); IdentifierInfo *ParamName = D.getIdentifier(); bool IsParameterPack = D.hasEllipsis(); NonTypeTemplateParmDecl *Param = NonTypeTemplateParmDecl::Create( Context, Context.getTranslationUnitDecl(), D.getBeginLoc(), D.getIdentifierLoc(), Depth, Position, ParamName, T, IsParameterPack, TInfo); Param->setAccess(AS_public); if (AutoTypeLoc TL = TInfo->getTypeLoc().getContainedAutoTypeLoc()) if (TL.isConstrained()) if (AttachTypeConstraint(TL, Param, D.getEllipsisLoc())) Invalid = true; if (Invalid) Param->setInvalidDecl(); if (Param->isParameterPack()) if (auto *LSI = getEnclosingLambda()) LSI->LocalPacks.push_back(Param); if (ParamName) { maybeDiagnoseTemplateParameterShadow(*this, S, D.getIdentifierLoc(), ParamName); // Add the template parameter into the current scope. S->AddDecl(Param); IdResolver.AddDecl(Param); } // C++0x [temp.param]p9: // A default template-argument may be specified for any kind of // template-parameter that is not a template parameter pack. if (Default && IsParameterPack) { Diag(EqualLoc, diag::err_template_param_pack_default_arg); Default = nullptr; } // Check the well-formedness of the default template argument, if provided. if (Default) { // Check for unexpanded parameter packs. if (DiagnoseUnexpandedParameterPack(Default, UPPC_DefaultArgument)) return Param; TemplateArgument Converted; ExprResult DefaultRes = CheckTemplateArgument(Param, Param->getType(), Default, Converted); if (DefaultRes.isInvalid()) { Param->setInvalidDecl(); return Param; } Default = DefaultRes.get(); Param->setDefaultArgument(Default); } return Param; } /// ActOnTemplateTemplateParameter - Called when a C++ template template /// parameter (e.g. T in template