summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-11-15 00:54:54 +0000
committerRui Ueyama <ruiu@google.com>2016-11-15 00:54:54 +0000
commit2d02166b430737a7ca910bfe72946b4119673da2 (patch)
tree0d5a50c0cbed9d402c16a176e328bca5472a7f78 /llvm/include
parent07a6ae96fb0b309845ff0664b5b4aa21f7eb5327 (diff)
downloadbcm5719-llvm-2d02166b430737a7ca910bfe72946b4119673da2.tar.gz
bcm5719-llvm-2d02166b430737a7ca910bfe72946b4119673da2.zip
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
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Support/COFF.h5
-rw-r--r--llvm/include/llvm/Support/FileSystem.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/COFF.h b/llvm/include/llvm/Support/COFF.h
index 1ca781b981e..19223306bd0 100644
--- a/llvm/include/llvm/Support/COFF.h
+++ b/llvm/include/llvm/Support/COFF.h
@@ -41,6 +41,11 @@ namespace COFF {
'\xaf', '\x20', '\xfa', '\xf6', '\x6a', '\xa4', '\xdc', '\xb8',
};
+ static const char ClGlObjMagic[] = {
+ '\x38', '\xfe', '\xb3', '\x0c', '\xa5', '\xd9', '\xab', '\x4d',
+ '\xac', '\x9b', '\xd6', '\xb6', '\x22', '\x26', '\x53', '\xc2',
+ };
+
// Sizes in bytes of various things in the COFF format.
enum {
Header16Size = 20,
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index 04838e0a5a5..8503aa35ca7 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -258,6 +258,7 @@ struct file_magic {
macho_dsym_companion, ///< Mach-O dSYM companion file
macho_kext_bundle, ///< Mach-O kext bundle file
macho_universal_binary, ///< Mach-O universal binary
+ coff_cl_gl_object, ///< Microsoft cl.exe's intermediate code file
coff_object, ///< COFF object file
coff_import_library, ///< COFF import library
pecoff_executable, ///< PECOFF executable file
OpenPOWER on IntegriCloud