mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
COFF: Set parent name for bitcode files.
Differential Revision: http://reviews.llvm.org/D10983 llvm-svn: 241713
This commit is contained in:
@@ -221,17 +221,19 @@ ErrorOr<std::unique_ptr<InputFile>> Lazy::getMember() {
|
||||
return std::unique_ptr<InputFile>(nullptr);
|
||||
|
||||
file_magic Magic = identify_magic(MBRef.getBuffer());
|
||||
if (Magic == file_magic::bitcode)
|
||||
return std::unique_ptr<InputFile>(new BitcodeFile(MBRef));
|
||||
if (Magic == file_magic::coff_import_library)
|
||||
return std::unique_ptr<InputFile>(new ImportFile(MBRef));
|
||||
|
||||
if (Magic != file_magic::coff_object) {
|
||||
std::unique_ptr<InputFile> Obj;
|
||||
if (Magic == file_magic::coff_object) {
|
||||
Obj.reset(new ObjectFile(MBRef));
|
||||
} else if (Magic == file_magic::bitcode) {
|
||||
Obj.reset(new BitcodeFile(MBRef));
|
||||
} else {
|
||||
llvm::errs() << File->getName() << ": unknown file type\n";
|
||||
return make_error_code(LLDError::InvalidFile);
|
||||
}
|
||||
|
||||
std::unique_ptr<InputFile> Obj(new ObjectFile(MBRef));
|
||||
Obj->setParentName(File->getName());
|
||||
return std::move(Obj);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
; RUN: lld -flavor link2 /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.obj
|
||||
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
|
||||
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
|
||||
; RUN: lld -flavor link2 /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.lib
|
||||
; RUN: lld -flavor link2 /out:%T/main.exe /entry:main /include:f2 /subsystem:console %T/main.lto.obj %T/foo.lto.lib /verbose 2>&1 | FileCheck -check-prefix=VERBOSE %s
|
||||
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-11 %s
|
||||
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-11 %s
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
; RUN: llvm-readobj -file-headers %T/main.exe | FileCheck -check-prefix=HEADERS-10 %s
|
||||
; RUN: llvm-objdump -d %T/main.exe | FileCheck -check-prefix=TEXT-10 %s
|
||||
|
||||
; VERBOSE: foo.lto.lib({{.*}}foo.lto.obj)
|
||||
|
||||
; HEADERS-11: AddressOfEntryPoint: 0x1000
|
||||
; TEXT-11: Disassembly of section .text:
|
||||
; TEXT-11-NEXT: .text:
|
||||
|
||||
Reference in New Issue
Block a user