[llvm] [llvm-profgen] Support COFF binary (PR #83972)
Haohai Wen via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 5 21:57:27 PST 2024
================
@@ -211,9 +212,12 @@ void ProfiledBinary::load() {
OwningBinary<Binary> OBinary = unwrapOrError(createBinary(Path), Path);
Binary &ExeBinary = *OBinary.getBinary();
- auto *Obj = dyn_cast<ELFObjectFileBase>(&ExeBinary);
- if (!Obj)
- exitWithError("not a valid Elf image", Path);
+ auto *ELFObj = dyn_cast<ELFObjectFileBase>(&ExeBinary);
+ IsCOFF = isa<COFFObjectFile>(&ExeBinary);
+ if (!ELFObj && !IsCOFF)
+ exitWithError("not a valid Elf/COFF image", Path);
----------------
HaohaiWen wrote:
Good caught. Thanks.
https://github.com/llvm/llvm-project/pull/83972
More information about the llvm-commits
mailing list