r355419 - Allow bundle size to be 0 in clang-offload-bundler

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 09:52:32 PST 2019


Author: yaxunl
Date: Tue Mar  5 09:52:32 2019
New Revision: 355419

URL: http://llvm.org/viewvc/llvm-project?rev=355419&view=rev
Log:
Allow bundle size to be 0 in clang-offload-bundler

HIP uses clang-offload-bundler to create fat binary. The bundle for host is empty.
Currently clang-offload-bundler checks if the bundle size is 0 when unbundling.
If so it will exit without unbundling the remaining bundles. This causes
clang-offload-bundler not being able to unbundle fat binaries generated for HIP.

This patch allows bundles size to be 0 when clang-offload-bundler unbundles
input files.

Differential Revision: https://reviews.llvm.org/D58057

Modified:
    cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp

Modified: cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp?rev=355419&r1=355418&r2=355419&view=diff
==============================================================================
--- cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp (original)
+++ cfe/trunk/tools/clang-offload-bundler/ClangOffloadBundler.cpp Tue Mar  5 09:52:32 2019
@@ -292,7 +292,7 @@ public:
       ReadChars += TripleSize;
 
       // Check if the offset and size make sense.
-      if (!Size || !Offset || Offset + Size > FC.size())
+      if (!Offset || Offset + Size > FC.size())
         return;
 
       assert(BundlesInfo.find(Triple) == BundlesInfo.end() &&




More information about the cfe-commits mailing list