aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/Binary.cpp
diff options
context:
space:
mode:
authorMichael Spencer <bigcheesegs@gmail.com>2024-01-16 15:32:43 -0800
committerGitHub <noreply@github.com>2024-01-16 15:32:43 -0800
commit894c22406f68af6574a62a40ec49e058344c324b (patch)
tree03c8f4059a9bd5b7a9c00c41eede487a3adf8dcd /llvm/lib/Object/Binary.cpp
parente9e3e9d23dd4e06ed5d9adb156ced4ab3a1f34bc (diff)
downloadllvm-894c22406f68af6574a62a40ec49e058344c324b.zip
llvm-894c22406f68af6574a62a40ec49e058344c324b.tar.gz
llvm-894c22406f68af6574a62a40ec49e058344c324b.tar.bz2
[clang][Driver] Don't ignore -gmodules .gch files (#77711)
A previous commit (82f75ed) made clang ignore .gch files that were not Clang AST files. This broke `-gmodules`, which embeds the Clang AST into an object file containing debug info. This changes the probing to detect any file format recognized by `llvm::identify_magic()` as potentially containing a Clang AST. Previous PR: https://github.com/llvm/llvm-project/pull/69204
Diffstat (limited to 'llvm/lib/Object/Binary.cpp')
-rw-r--r--llvm/lib/Object/Binary.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Object/Binary.cpp b/llvm/lib/Object/Binary.cpp
index 0b9d954..2dfae8a 100644
--- a/llvm/lib/Object/Binary.cpp
+++ b/llvm/lib/Object/Binary.cpp
@@ -84,6 +84,7 @@ Expected<std::unique_ptr<Binary>> object::createBinary(MemoryBufferRef Buffer,
// PDB does not support the Binary interface.
return errorCodeToError(object_error::invalid_file_type);
case file_magic::unknown:
+ case file_magic::clang_ast:
case file_magic::cuda_fatbinary:
case file_magic::coff_cl_gl_object:
case file_magic::dxcontainer_object: