diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Symbol/SymbolFile.cpp | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.bz2 |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/source/Symbol/SymbolFile.cpp')
-rw-r--r-- | lldb/source/Symbol/SymbolFile.cpp | 218 |
1 files changed, 106 insertions, 112 deletions
diff --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp index 808dfd3..8d8b606 100644 --- a/lldb/source/Symbol/SymbolFile.cpp +++ b/lldb/source/Symbol/SymbolFile.cpp @@ -9,7 +9,6 @@ #include "lldb/Symbol/SymbolFile.h" -#include "lldb/lldb-private.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -18,141 +17,136 @@ #include "lldb/Symbol/TypeMap.h" #include "lldb/Symbol/TypeSystem.h" #include "lldb/Symbol/VariableList.h" +#include "lldb/lldb-private.h" using namespace lldb_private; -SymbolFile* -SymbolFile::FindPlugin (ObjectFile* obj_file) -{ - std::unique_ptr<SymbolFile> best_symfile_ap; - if (obj_file != nullptr) - { - - // We need to test the abilities of this section list. So create what it would - // be with this new obj_file. - lldb::ModuleSP module_sp(obj_file->GetModule()); - if (module_sp) - { - // Default to the main module section list. - ObjectFile *module_obj_file = module_sp->GetObjectFile(); - if (module_obj_file != obj_file) - { - // Make sure the main object file's sections are created - module_obj_file->GetSectionList(); - obj_file->CreateSections (*module_sp->GetUnifiedSectionList()); - } - } +SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) { + std::unique_ptr<SymbolFile> best_symfile_ap; + if (obj_file != nullptr) { + + // We need to test the abilities of this section list. So create what it + // would + // be with this new obj_file. + lldb::ModuleSP module_sp(obj_file->GetModule()); + if (module_sp) { + // Default to the main module section list. + ObjectFile *module_obj_file = module_sp->GetObjectFile(); + if (module_obj_file != obj_file) { + // Make sure the main object file's sections are created + module_obj_file->GetSectionList(); + obj_file->CreateSections(*module_sp->GetUnifiedSectionList()); + } + } - // TODO: Load any plug-ins in the appropriate plug-in search paths and - // iterate over all of them to find the best one for the job. - - uint32_t best_symfile_abilities = 0; - - SymbolFileCreateInstance create_callback; - for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex(idx)) != nullptr; ++idx) - { - std::unique_ptr<SymbolFile> curr_symfile_ap(create_callback(obj_file)); - - if (curr_symfile_ap.get()) - { - const uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities(); - if (sym_file_abilities > best_symfile_abilities) - { - best_symfile_abilities = sym_file_abilities; - best_symfile_ap.reset (curr_symfile_ap.release()); - // If any symbol file parser has all of the abilities, then - // we should just stop looking. - if ((kAllAbilities & sym_file_abilities) == kAllAbilities) - break; - } - } - } - if (best_symfile_ap.get()) - { - // Let the winning symbol file parser initialize itself more - // completely now that it has been chosen - best_symfile_ap->InitializeObject(); + // TODO: Load any plug-ins in the appropriate plug-in search paths and + // iterate over all of them to find the best one for the job. + + uint32_t best_symfile_abilities = 0; + + SymbolFileCreateInstance create_callback; + for (uint32_t idx = 0; + (create_callback = PluginManager::GetSymbolFileCreateCallbackAtIndex( + idx)) != nullptr; + ++idx) { + std::unique_ptr<SymbolFile> curr_symfile_ap(create_callback(obj_file)); + + if (curr_symfile_ap.get()) { + const uint32_t sym_file_abilities = curr_symfile_ap->GetAbilities(); + if (sym_file_abilities > best_symfile_abilities) { + best_symfile_abilities = sym_file_abilities; + best_symfile_ap.reset(curr_symfile_ap.release()); + // If any symbol file parser has all of the abilities, then + // we should just stop looking. + if ((kAllAbilities & sym_file_abilities) == kAllAbilities) + break; } + } } - return best_symfile_ap.release(); + if (best_symfile_ap.get()) { + // Let the winning symbol file parser initialize itself more + // completely now that it has been chosen + best_symfile_ap->InitializeObject(); + } + } + return best_symfile_ap.release(); } -TypeList * -SymbolFile::GetTypeList () -{ - if (m_obj_file) - return m_obj_file->GetModule()->GetTypeList(); - return nullptr; +TypeList *SymbolFile::GetTypeList() { + if (m_obj_file) + return m_obj_file->GetModule()->GetTypeList(); + return nullptr; } -TypeSystem * -SymbolFile::GetTypeSystemForLanguage (lldb::LanguageType language) -{ - TypeSystem *type_system = m_obj_file->GetModule()->GetTypeSystemForLanguage(language); - if (type_system) - type_system->SetSymbolFile(this); - return type_system; +TypeSystem *SymbolFile::GetTypeSystemForLanguage(lldb::LanguageType language) { + TypeSystem *type_system = + m_obj_file->GetModule()->GetTypeSystemForLanguage(language); + if (type_system) + type_system->SetSymbolFile(this); + return type_system; } -uint32_t -SymbolFile::ResolveSymbolContext (const FileSpec& file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList& sc_list) -{ - return 0; +uint32_t SymbolFile::ResolveSymbolContext(const FileSpec &file_spec, + uint32_t line, bool check_inlines, + uint32_t resolve_scope, + SymbolContextList &sc_list) { + return 0; } - -uint32_t -SymbolFile::FindGlobalVariables (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, VariableList& variables) -{ - if (!append) - variables.Clear(); - return 0; +uint32_t SymbolFile::FindGlobalVariables( + const ConstString &name, const CompilerDeclContext *parent_decl_ctx, + bool append, uint32_t max_matches, VariableList &variables) { + if (!append) + variables.Clear(); + return 0; } - -uint32_t -SymbolFile::FindGlobalVariables (const RegularExpression& regex, bool append, uint32_t max_matches, VariableList& variables) -{ - if (!append) - variables.Clear(); - return 0; +uint32_t SymbolFile::FindGlobalVariables(const RegularExpression ®ex, + bool append, uint32_t max_matches, + VariableList &variables) { + if (!append) + variables.Clear(); + return 0; } -uint32_t -SymbolFile::FindFunctions (const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool include_inlines, bool append, SymbolContextList& sc_list) -{ - if (!append) - sc_list.Clear(); - return 0; +uint32_t SymbolFile::FindFunctions(const ConstString &name, + const CompilerDeclContext *parent_decl_ctx, + uint32_t name_type_mask, + bool include_inlines, bool append, + SymbolContextList &sc_list) { + if (!append) + sc_list.Clear(); + return 0; } -uint32_t -SymbolFile::FindFunctions (const RegularExpression& regex, bool include_inlines, bool append, SymbolContextList& sc_list) -{ - if (!append) - sc_list.Clear(); - return 0; +uint32_t SymbolFile::FindFunctions(const RegularExpression ®ex, + bool include_inlines, bool append, + SymbolContextList &sc_list) { + if (!append) + sc_list.Clear(); + return 0; } -void -SymbolFile::GetMangledNamesForFunction(const std::string &scope_qualified_name, std::vector<ConstString> &mangled_names) -{ - return; +void SymbolFile::GetMangledNamesForFunction( + const std::string &scope_qualified_name, + std::vector<ConstString> &mangled_names) { + return; } -uint32_t -SymbolFile::FindTypes (const SymbolContext& sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, uint32_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap& types) -{ - if (!append) - types.Clear(); - return 0; +uint32_t SymbolFile::FindTypes( + const SymbolContext &sc, const ConstString &name, + const CompilerDeclContext *parent_decl_ctx, bool append, + uint32_t max_matches, + llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, + TypeMap &types) { + if (!append) + types.Clear(); + return 0; } - -size_t -SymbolFile::FindTypes (const std::vector<CompilerContext> &context, bool append, TypeMap& types) -{ - if (!append) - types.Clear(); - return 0; +size_t SymbolFile::FindTypes(const std::vector<CompilerContext> &context, + bool append, TypeMap &types) { + if (!append) + types.Clear(); + return 0; } |