[clang] 55cb84d - [OpenMP] Unrecognized objects should not be considered failure

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 18:22:47 PST 2022


Author: Joseph Huber
Date: 2022-02-22T21:22:18-05:00
New Revision: 55cb84d9fbea1ead9434de519e1b4e1d2d803048

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

LOG: [OpenMP] Unrecognized objects should not be considered failure

Summary:
This patch removes the error we recieve when attempting to extract
offloading sections. We shouldn't consider this a failure because
extracting bitcode isn't necessarily required.

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 4aca707348b2d..60a5a0fab59f6 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -517,7 +517,7 @@ extractFromBuffer(std::unique_ptr<MemoryBuffer> Buffer,
     return extractFromArchive(*LibFile->get(), DeviceFiles);
   }
   default:
-    return errorCodeToError(object_error::invalid_file_type);
+    return None;
   }
 }
 
@@ -1227,8 +1227,7 @@ int main(int argc, const char **argv) {
     if (Optional<std::string> Library = searchLibrary(Arg, LibraryPaths))
       Filename = *Library;
 
-    if ((sys::path::extension(Filename) == ".o" ||
-         sys::path::extension(Filename) == ".a")) {
+    if (sys::fs::exists(Filename) && !sys::fs::is_directory(Filename)) {
       ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
           MemoryBuffer::getFileOrSTDIN(Filename);
       if (std::error_code EC = BufferOrErr.getError())


        


More information about the cfe-commits mailing list