aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2020-04-15 11:35:35 -0700
committerSam Clegg <sbc@chromium.org>2020-04-15 12:33:33 -0700
commit2a68573a3550faaad91c852c11a68c5f480a0aa6 (patch)
tree06fbc734643f9dcb8e297597e6ebba15238cf0a2 /llvm/lib/Object/IRObjectFile.cpp
parent5f87415efc1e57587272944a5f9b6745e4474660 (diff)
downloadllvm-2a68573a3550faaad91c852c11a68c5f480a0aa6.zip
llvm-2a68573a3550faaad91c852c11a68c5f480a0aa6.tar.gz
llvm-2a68573a3550faaad91c852c11a68c5f480a0aa6.tar.bz2
Enable finding bitcode in wasm objects
This commit fixes using functions in `IRObjectFile` to load bitcode from wasm objects by recognizing the file magic for wasm and also inheriting the default implementation of classifying sections as bitcode. Patch By: alexcrichton Differential Revision: https://reviews.llvm.org/D78199
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index 636f152..931e842 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -94,6 +94,7 @@ IRObjectFile::findBitcodeInMemBuffer(MemoryBufferRef Object) {
return Object;
case file_magic::elf_relocatable:
case file_magic::macho_object:
+ case file_magic::wasm_object:
case file_magic::coff_object: {
Expected<std::unique_ptr<ObjectFile>> ObjFile =
ObjectFile::createObjectFile(Object, Type);