diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2019-03-05 17:52:32 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2019-03-05 17:52:32 +0000 |
commit | 071949c3afaec7ec57cd68d8fcc2b93a69a584a6 (patch) | |
tree | a9e974092ae2aabfe919aa718ef85ac4b2ea3389 | |
parent | 1af5bd54a8273398d33c840b8a26852ff3be73f7 (diff) | |
download | bcm5719-llvm-071949c3afaec7ec57cd68d8fcc2b93a69a584a6.tar.gz bcm5719-llvm-071949c3afaec7ec57cd68d8fcc2b93a69a584a6.zip |
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
llvm-svn: 355419
-rw-r--r-- | clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp index 005450d4e0f..4e7cdd6c913 100644 --- a/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp +++ b/clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp @@ -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() && |