Skip to content

Commit aa71625

Browse files
authored
Merge branch 'main' into AtomicWriteLowering
2 parents 96b5a59 + a7672fe commit aa71625

File tree

442 files changed

+9543
-5828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

442 files changed

+9543
-5828
lines changed

clang-tools-extra/clang-include-fixer/IncludeFixer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ bool IncludeFixerActionFactory::runInvocation(
9090

9191
// Set up Clang.
9292
CompilerInstance Compiler(std::move(Invocation), std::move(PCHContainerOps));
93+
Compiler.setVirtualFileSystem(Files->getVirtualFileSystemPtr());
9394
Compiler.setFileManager(Files);
9495

9596
// Create the compiler's actual diagnostics engine. We want to drop all

clang/docs/OpenMPSupport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ implementation.
256256
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
257257
| device | device-specific environment variables | :none:`unclaimed` | |
258258
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
259-
| device | omp_target_is_accessible routine | :part:`In Progress` | https://github.com/llvm/llvm-project/pull/138294 |
259+
| device | omp_target_is_accessible routine | :good:`done` | https://github.com/llvm/llvm-project/pull/138294 |
260260
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
261261
| device | omp_get_mapped_ptr routine | :good:`done` | D141545 |
262262
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ Bug Fixes to Attribute Support
447447
- Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with
448448
``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520)
449449
- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075)
450+
- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905)
450451

451452
Bug Fixes to C++ Support
452453
^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ def SYCLKernel : InheritableAttr {
16231623
let Documentation = [SYCLKernelDocs];
16241624
}
16251625

1626-
def DeviceKernel : DeclOrTypeAttr {
1626+
def DeviceKernel : InheritableAttr {
16271627
let Spellings = [Clang<"device_kernel">,
16281628
Clang<"nvptx_kernel">, Clang<"amdgpu_kernel">,
16291629
CustomKeyword<"__kernel">, CustomKeyword<"kernel">];

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,6 +4126,9 @@ def warn_missing_sdksettings_for_availability_checking : Warning<
41264126
"%0 availability is ignored without a valid 'SDKSettings.json' in the SDK">,
41274127
InGroup<DiagGroup<"ignored-availability-without-sdk-settings">>;
41284128

4129+
def err_hidden_device_kernel
4130+
: Error<"%0 is specified as a device kernel but it is not externally visible">;
4131+
41294132
// Thread Safety Attributes
41304133
def warn_thread_attribute_ignored : Warning<
41314134
"ignoring %0 attribute because its argument is invalid">,

clang/include/clang/Frontend/ASTUnit.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,11 @@ class ASTUnit {
499499
return *PPOpts;
500500
}
501501

502+
IntrusiveRefCntPtr<llvm::vfs::FileSystem> getVirtualFileSystemPtr() {
503+
// FIXME: Don't defer VFS ownership to the FileManager.
504+
return FileMgr->getVirtualFileSystemPtr();
505+
}
506+
502507
const FileManager &getFileManager() const { return *FileMgr; }
503508
FileManager &getFileManager() { return *FileMgr; }
504509
IntrusiveRefCntPtr<FileManager> getFileManagerPtr() { return FileMgr; }

clang/include/clang/Frontend/CompilerInstance.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class CompilerInstance : public ModuleLoader {
460460
FileMgr.resetWithoutRelease();
461461
}
462462

463-
/// Replace the current file manager and virtual file system.
463+
/// Replace the current file manager.
464464
void setFileManager(IntrusiveRefCntPtr<FileManager> Value);
465465

466466
/// @}

clang/include/clang/Sema/Sema.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,15 +1321,11 @@ class Sema final : public SemaBase {
13211321

13221322
/// Callback to the parser to parse templated functions when needed.
13231323
typedef void LateTemplateParserCB(void *P, LateParsedTemplate &LPT);
1324-
typedef void LateTemplateParserCleanupCB(void *P);
13251324
LateTemplateParserCB *LateTemplateParser;
1326-
LateTemplateParserCleanupCB *LateTemplateParserCleanup;
13271325
void *OpaqueParser;
13281326

1329-
void SetLateTemplateParser(LateTemplateParserCB *LTP,
1330-
LateTemplateParserCleanupCB *LTPCleanup, void *P) {
1327+
void SetLateTemplateParser(LateTemplateParserCB *LTP, void *P) {
13311328
LateTemplateParser = LTP;
1332-
LateTemplateParserCleanup = LTPCleanup;
13331329
OpaqueParser = P;
13341330
}
13351331

clang/lib/AST/ASTConcept.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void ConstraintSatisfaction::Profile(llvm::FoldingSetNodeID &ID,
8686
ID.AddPointer(ConstraintOwner);
8787
ID.AddInteger(TemplateArgs.size());
8888
for (auto &Arg : TemplateArgs)
89-
C.getCanonicalTemplateArgument(Arg).Profile(ID, C);
89+
Arg.Profile(ID, C);
9090
}
9191

9292
ConceptReference *

clang/lib/AST/TypePrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,9 +2147,6 @@ void TypePrinter::printAttributedAfter(const AttributedType *T,
21472147
}
21482148
case attr::AArch64VectorPcs: OS << "aarch64_vector_pcs"; break;
21492149
case attr::AArch64SVEPcs: OS << "aarch64_sve_pcs"; break;
2150-
case attr::DeviceKernel:
2151-
OS << T->getAttr()->getSpelling();
2152-
break;
21532150
case attr::IntelOclBicc:
21542151
OS << "inteloclbicc";
21552152
break;

0 commit comments

Comments
 (0)