[clang] bfd69ad - [LinkerWrapper] Ignore OFK_None kinds for building registration code

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 07:47:12 PST 2022


Author: Joseph Huber
Date: 2022-11-29T09:46:51-06:00
New Revision: bfd69ad59672e67d60e71d66df7ef878c18a7bb8

URL: https://github.com/llvm/llvm-project/commit/bfd69ad59672e67d60e71d66df7ef878c18a7bb8
DIFF: https://github.com/llvm/llvm-project/commit/bfd69ad59672e67d60e71d66df7ef878c18a7bb8.diff

LOG: [LinkerWrapper] Ignore OFK_None kinds for building registration code

Summary:
The linker wrapper uses this metadata to determine which registration
code to emit, e.g. CUDA, HIP or OpenMP. If we encounter an OFK_None we
should just ignore it.

Added: 
    

Modified: 
    clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 5e0c0f92e6f53..554527c314ea7 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -1153,7 +1153,8 @@ linkAndWrapDeviceFiles(SmallVectorImpl<OffloadFile> &LinkerInputFiles,
 
     DenseSet<OffloadKind> ActiveOffloadKinds;
     for (const auto &File : Input)
-      ActiveOffloadKinds.insert(File.getBinary()->getOffloadKind());
+      if (File.getBinary()->getOffloadKind() != OFK_None)
+        ActiveOffloadKinds.insert(File.getBinary()->getOffloadKind());
 
     // First link and remove all the input files containing bitcode.
     SmallVector<StringRef> InputFiles;


        


More information about the cfe-commits mailing list