[Lldb-commits] [lldb] 226d52b - [lldb/DWARF] Replace C style casts with static_cast<> (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 5 21:25:04 PST 2020
Author: Jonas Devlieghere
Date: 2020-03-05T21:24:51-08:00
New Revision: 226d52b1faadbe4a770d5738ac9d2c5bbc110d3d
URL: https://github.com/llvm/llvm-project/commit/226d52b1faadbe4a770d5738ac9d2c5bbc110d3d
DIFF: https://github.com/llvm/llvm-project/commit/226d52b1faadbe4a770d5738ac9d2c5bbc110d3d.diff
LOG: [lldb/DWARF] Replace C style casts with static_cast<> (NFC)
Using static_cast instead of C style casts better conveys the code's
intent, is a tad more safe and stands out more.
Added:
Modified:
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
Removed:
################################################################################
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 8d0ac23ef9e3..76e064ee81ee 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -3638,9 +3638,9 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
}
DWARFASTParserClang *src_dwarf_ast_parser =
- (DWARFASTParserClang *)SymbolFileDWARF::GetDWARFParser(*src_die.GetCU());
+ static_cast<DWARFASTParserClang *>(SymbolFileDWARF::GetDWARFParser(*src_die.GetCU()));
DWARFASTParserClang *dst_dwarf_ast_parser =
- (DWARFASTParserClang *)SymbolFileDWARF::GetDWARFParser(*dst_die.GetCU());
+ static_cast<DWARFASTParserClang *>(SymbolFileDWARF::GetDWARFParser(*dst_die.GetCU()));
// Now do the work of linking the DeclContexts and Types.
if (fast_path) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index c27b5c4c3495..1e149d89153a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3867,7 +3867,7 @@ SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
lldb::ModuleSP module_sp(m_debug_map_module_wp.lock());
if (module_sp) {
m_debug_map_symfile =
- (SymbolFileDWARFDebugMap *)module_sp->GetSymbolFile();
+ static_cast<SymbolFileDWARFDebugMap *>(module_sp->GetSymbolFile());
}
}
return m_debug_map_symfile;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index a06c40f9b72d..a177a56d5e13 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -529,7 +529,7 @@ SymbolFileDWARF *
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file) {
if (sym_file &&
sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
- return (SymbolFileDWARF *)sym_file;
+ return static_cast<SymbolFileDWARF *>(sym_file);
return nullptr;
}
More information about the lldb-commits
mailing list