aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp
diff options
context:
space:
mode:
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;