Add a file magic for CL.exe's object file created with /GL.

This patch makes it possible to identify object files created by CL.exe
with /GL option. Such file contains Microsoft proprietary intermediate
code instead of target machine code to do LTO.

I need this to print out user-friendly error message from LLD.

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

llvm-svn: 286919
This commit is contained in:
Rui Ueyama
2016-11-15 00:54:54 +00:00
parent 07a6ae96fb
commit 2d02166b43
4 changed files with 14 additions and 11 deletions

View File

@@ -78,6 +78,7 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, sys::fs::file_magic Type) {
switch (Type) {
case sys::fs::file_magic::unknown:
case sys::fs::file_magic::bitcode:
case sys::fs::file_magic::coff_cl_gl_object:
case sys::fs::file_magic::archive:
case sys::fs::file_magic::macho_universal_binary:
case sys::fs::file_magic::windows_resource: