Add a file magic for CL.exe's object file created with /GL.
authorRui Ueyama <ruiu@google.com>
Tue, 15 Nov 2016 00:54:54 +0000 (00:54 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 15 Nov 2016 00:54:54 +0000 (00:54 +0000)
commit2d02166b430737a7ca910bfe72946b4119673da2
tree0d5a50c0cbed9d402c16a176e328bca5472a7f78
parent07a6ae96fb0b309845ff0664b5b4aa21f7eb5327
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
llvm/include/llvm/Support/COFF.h
llvm/include/llvm/Support/FileSystem.h
llvm/lib/Object/ObjectFile.cpp
llvm/lib/Support/Path.cpp