aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-27 19:50:45 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-27 19:50:54 +0000
commit08e8dd7b9db7bb4a9de26d44c1cbfd24e869c014 (patch)
tree041e72e32710b1e742516d8c9f1575bf0116d3e3 /llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
parent4b4fe385e49bd883fd183b5f21c1ea486c722e61 (diff)
Diffstat (limited to 'llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp')
-rw-r--r--llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp b/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
index e77c82e0fad9..a6466be37513 100644
--- a/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
+++ b/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
@@ -292,7 +292,7 @@ using DebugInfoBits = SmallString<10000>;
static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
ObjectFile &InputFile,
DebugInfoBits &LinkedDebugInfoBits) {
- if (dyn_cast<ELFObjectFile<ELF32LE>>(&InputFile)) {
+ if (isa<ELFObjectFile<ELF32LE>>(&InputFile)) {
Expected<ELFObjectFile<ELF32LE>> MemFile = ELFObjectFile<ELF32LE>::create(
MemoryBufferRef(LinkedDebugInfoBits, ""));
if (!MemFile)
@@ -300,7 +300,7 @@ static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
return Err;
- } else if (dyn_cast<ELFObjectFile<ELF64LE>>(&InputFile)) {
+ } else if (isa<ELFObjectFile<ELF64LE>>(&InputFile)) {
Expected<ELFObjectFile<ELF64LE>> MemFile = ELFObjectFile<ELF64LE>::create(
MemoryBufferRef(LinkedDebugInfoBits, ""));
if (!MemFile)
@@ -308,7 +308,7 @@ static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
return Err;
- } else if (dyn_cast<ELFObjectFile<ELF32BE>>(&InputFile)) {
+ } else if (isa<ELFObjectFile<ELF32BE>>(&InputFile)) {
Expected<ELFObjectFile<ELF32BE>> MemFile = ELFObjectFile<ELF32BE>::create(
MemoryBufferRef(LinkedDebugInfoBits, ""));
if (!MemFile)
@@ -316,7 +316,7 @@ static Error addSectionsFromLinkedData(objcopy::ConfigManager &Config,
if (Error Err = setConfigToAddNewDebugSections(Config, *MemFile))
return Err;
- } else if (dyn_cast<ELFObjectFile<ELF64BE>>(&InputFile)) {
+ } else if (isa<ELFObjectFile<ELF64BE>>(&InputFile)) {
Expected<ELFObjectFile<ELF64BE>> MemFile = ELFObjectFile<ELF64BE>::create(
MemoryBufferRef(LinkedDebugInfoBits, ""));
if (!MemFile)
@@ -426,16 +426,14 @@ static Error applyCLOptions(const struct Options &Opts, ObjectFile &InputFile) {
DebugInfoBits LinkedDebugInfo;
raw_svector_ostream OutStream(LinkedDebugInfo);
- if (linkDebugInfo(InputFile, Opts, OutStream)) {
- if (Error Err =
- saveLinkedDebugInfo(Opts, InputFile, std::move(LinkedDebugInfo)))
- return Err;
+ if (Error Err = linkDebugInfo(InputFile, Opts, OutStream))
+ return Err;
- return Error::success();
- }
+ if (Error Err =
+ saveLinkedDebugInfo(Opts, InputFile, std::move(LinkedDebugInfo)))
+ return Err;
- return createStringError(std::errc::invalid_argument,
- "possible broken debug info");
+ return Error::success();
} else if (Opts.BuildSeparateDebugFile) {
if (Error Err = splitDebugIntoSeparateFile(Opts, InputFile))
return Err;