[Lldb-commits] [lldb] b2e2eec - [lldb][NFC] clang-format some files as preparation for https://reviews.llvm.org/D114627

Andy Yankovsky via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 9 03:39:22 PST 2021


Author: Lasse Folger
Date: 2021-12-09T12:38:00+01:00
New Revision: b2e2eece9aa8db4bcc47c7fed0a9b999a3d96baf

URL: https://github.com/llvm/llvm-project/commit/b2e2eece9aa8db4bcc47c7fed0a9b999a3d96baf
DIFF: https://github.com/llvm/llvm-project/commit/b2e2eece9aa8db4bcc47c7fed0a9b999a3d96baf.diff

LOG: [lldb][NFC] clang-format some files as preparation for https://reviews.llvm.org/D114627

Reviewed By: werat

Differential Revision: https://reviews.llvm.org/D115110

Added: 
    

Modified: 
    lldb/include/lldb/Core/Module.h
    lldb/include/lldb/Symbol/SymbolFile.h
    lldb/source/Core/Module.cpp
    lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/source/Symbol/SymbolFile.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Core/Module.h b/lldb/include/lldb/Core/Module.h
index b80f4fd9b85a7..acc11c777dbf3 100644
--- a/lldb/include/lldb/Core/Module.h
+++ b/lldb/include/lldb/Core/Module.h
@@ -21,8 +21,8 @@
 #include "lldb/Utility/ConstString.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Status.h"
-#include "lldb/Utility/XcodeSDK.h"
 #include "lldb/Utility/UUID.h"
+#include "lldb/Utility/XcodeSDK.h"
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-forward.h"
@@ -128,7 +128,7 @@ class Module : public std::enable_shared_from_this<Module>,
   Module(const ModuleSpec &module_spec);
 
   template <typename ObjFilePlugin, typename... Args>
-  static lldb::ModuleSP CreateModuleFromObjectFile(Args &&... args) {
+  static lldb::ModuleSP CreateModuleFromObjectFile(Args &&...args) {
     // Must create a module and place it into a shared pointer before we can
     // create an object file since it has a std::weak_ptr back to the module,
     // so we need to control the creation carefully in this static function
@@ -255,8 +255,7 @@ class Module : public std::enable_shared_from_this<Module>,
   ///     Returns a valid symbol pointer if a symbol was found,
   ///     nullptr otherwise.
   const Symbol *FindFirstSymbolWithNameAndType(
-      ConstString name,
-      lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
+      ConstString name, lldb::SymbolType symbol_type = lldb::eSymbolTypeAny);
 
   void FindSymbolsWithNameAndType(ConstString name,
                                   lldb::SymbolType symbol_type,
@@ -439,12 +438,13 @@ class Module : public std::enable_shared_from_this<Module>,
   ///
   /// \param searched_symbol_files
   ///     Prevents one file from being visited multiple times.
-  void FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
-                 llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
-                 TypeMap &types);
+  void
+  FindTypes(llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
+            llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
+            TypeMap &types);
 
-  lldb::TypeSP FindFirstType(const SymbolContext &sc,
-                             ConstString type_name, bool exact_match);
+  lldb::TypeSP FindFirstType(const SymbolContext &sc, ConstString type_name,
+                             bool exact_match);
 
   /// Find types by name that are in a namespace. This function is used by the
   /// expression parser when searches need to happen in an exact namespace
@@ -788,8 +788,7 @@ class Module : public std::enable_shared_from_this<Module>,
       const FileSpec &file_spec, uint32_t line, bool check_inlines,
       lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list);
 
-  void SetFileSpecAndObjectName(const FileSpec &file,
-                                ConstString object_name);
+  void SetFileSpecAndObjectName(const FileSpec &file, ConstString object_name);
 
   bool GetIsDynamicLinkEditor();
 
@@ -876,7 +875,7 @@ class Module : public std::enable_shared_from_this<Module>,
   /// The value is returned as a reference to allow it to be updated by the
   /// ElapsedTime RAII object.
   StatsDuration &GetSymtabParseTime() { return m_symtab_parse_time; }
-  
+
   /// Accessor for the symbol table index time metric.
   ///
   /// The value is returned as a reference to allow it to be updated by the
@@ -949,27 +948,27 @@ class Module : public std::enable_shared_from_this<Module>,
 protected:
   // Member Variables
   mutable std::recursive_mutex m_mutex; ///< A mutex to keep this object happy
-                                        ///in multi-threaded environments.
+                                        /// in multi-threaded environments.
 
   /// The modification time for this module when it was created.
   llvm::sys::TimePoint<> m_mod_time;
 
-  ArchSpec m_arch;      ///< The architecture for this module.
+  ArchSpec m_arch; ///< The architecture for this module.
   UUID m_uuid; ///< Each module is assumed to have a unique identifier to help
-               ///match it up to debug symbols.
+               /// match it up to debug symbols.
   FileSpec m_file; ///< The file representation on disk for this module (if
-                   ///there is one).
+                   /// there is one).
   FileSpec m_platform_file; ///< The path to the module on the platform on which
-                            ///it is being debugged
+                            /// it is being debugged
   FileSpec m_remote_install_file; ///< If set when debugging on remote
-                                  ///platforms, this module will be installed at
-                                  ///this location
+                                  /// platforms, this module will be installed
+                                  /// at this location
   FileSpec m_symfile_spec;   ///< If this path is valid, then this is the file
-                             ///that _will_ be used as the symbol file for this
-                             ///module
+                             /// that _will_ be used as the symbol file for this
+                             /// module
   ConstString m_object_name; ///< The name an object within this module that is
-                             ///selected, or empty of the module is represented
-                             ///by \a m_file.
+                             /// selected, or empty of the module is represented
+                             /// by \a m_file.
   uint64_t m_object_offset = 0;
   llvm::sys::TimePoint<> m_object_mod_time;
 
@@ -979,8 +978,8 @@ class Module : public std::enable_shared_from_this<Module>,
   lldb::DataBufferSP m_data_sp;
 
   lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file
-                                   ///parser for this module as it may or may
-                                   ///not be shared with the SymbolFile
+                                   /// parser for this module as it may or may
+                                   /// not be shared with the SymbolFile
   llvm::Optional<UnwindTable> m_unwind_table; ///< Table of FuncUnwinders
                                               /// objects created for this
                                               /// Module's functions
@@ -988,11 +987,11 @@ class Module : public std::enable_shared_from_this<Module>,
       m_symfile_up; ///< A pointer to the symbol vendor for this module.
   std::vector<lldb::SymbolVendorUP>
       m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and
-                      ///changes the symbol file,
+                      /// changes the symbol file,
   ///< we need to keep all old symbol files around in case anyone has type
-  ///references to them
-  TypeSystemMap m_type_system_map;   ///< A map of any type systems associated
-                                     ///with this module
+  /// references to them
+  TypeSystemMap m_type_system_map; ///< A map of any type systems associated
+                                   /// with this module
   /// Module specific source remappings for when you have debug info for a
   /// module that doesn't match where the sources currently are.
   PathMappingList m_source_mappings =

diff  --git a/lldb/include/lldb/Symbol/SymbolFile.h b/lldb/include/lldb/Symbol/SymbolFile.h
index 9ab63cac56dda..7c0365483c123 100644
--- a/lldb/include/lldb/Symbol/SymbolFile.h
+++ b/lldb/include/lldb/Symbol/SymbolFile.h
@@ -181,7 +181,6 @@ class SymbolFile : public PluginInterface {
   virtual size_t ParseVariablesForContext(const SymbolContext &sc) = 0;
   virtual Type *ResolveTypeUID(lldb::user_id_t type_uid) = 0;
 
-
   /// The characteristics of an array type.
   struct ArrayInfo {
     int64_t first_index = 0;
@@ -318,19 +317,14 @@ class SymbolFile : public PluginInterface {
   ///
   /// \returns 0.0 if no information has been parsed or if there is
   /// no computational cost to parsing the debug information.
-  virtual StatsDuration GetDebugInfoParseTime() {
-    return StatsDuration(0.0);
-  }
+  virtual StatsDuration GetDebugInfoParseTime() { return StatsDuration(0.0); }
 
   /// Return the time it took to index the debug information in the object
   /// file.
   ///
   /// \returns 0.0 if the file doesn't need to be indexed or if it
   /// hasn't been indexed yet, or a valid duration if it has.
-  virtual StatsDuration GetDebugInfoIndexTime() {
-    return StatsDuration(0.0);
-  }
-
+  virtual StatsDuration GetDebugInfoIndexTime() { return StatsDuration(0.0); }
 
 protected:
   void AssertModuleLock();

diff  --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index dbec8250223cf..5822c9841cdde 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -233,8 +233,8 @@ Module::Module(const ModuleSpec &module_spec)
 Module::Module(const FileSpec &file_spec, const ArchSpec &arch,
                const ConstString *object_name, lldb::offset_t object_offset,
                const llvm::sys::TimePoint<> &object_mod_time)
-    : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)), m_arch(arch),
-      m_file(file_spec), m_object_offset(object_offset),
+    : m_mod_time(FileSystem::Instance().GetModificationTime(file_spec)),
+      m_arch(arch), m_file(file_spec), m_object_offset(object_offset),
       m_object_mod_time(object_mod_time), m_file_has_changed(false),
       m_first_file_changed_log(false) {
   // Scope for locker below...
@@ -559,9 +559,8 @@ uint32_t Module::ResolveSymbolContextForAddress(
             // that the symbol has been resolved.
             if (so_addr.GetOffset() ==
                     addr_range.GetBaseAddress().GetOffset() ||
-                so_addr.GetOffset() ==
-                    addr_range.GetBaseAddress().GetOffset() +
-                        addr_range.GetByteSize()) {
+                so_addr.GetOffset() == addr_range.GetBaseAddress().GetOffset() +
+                                           addr_range.GetByteSize()) {
               resolved_flags |= flags;
             }
           } else {
@@ -765,8 +764,7 @@ void Module::LookupInfo::Prune(SymbolContextList &sc_list,
       // pull anything out
       ConstString mangled_name(sc.GetFunctionName(Mangled::ePreferMangled));
       ConstString full_name(sc.GetFunctionName());
-      if (mangled_name != m_name && full_name != m_name)
-      {
+      if (mangled_name != m_name && full_name != m_name) {
         CPlusPlusLanguage::MethodName cpp_method(full_name);
         if (cpp_method.IsValid()) {
           if (cpp_method.GetContext().empty()) {
@@ -959,8 +957,8 @@ void Module::FindTypesInNamespace(ConstString type_name,
   }
 }
 
-lldb::TypeSP Module::FindFirstType(const SymbolContext &sc,
-                                   ConstString name, bool exact_match) {
+lldb::TypeSP Module::FindFirstType(const SymbolContext &sc, ConstString name,
+                                   bool exact_match) {
   TypeList type_list;
   llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
   FindTypes(name, exact_match, 1, searched_symbol_files, type_list);
@@ -1331,9 +1329,8 @@ void Module::SymbolIndicesToSymbolContextList(
   }
 }
 
-void Module::FindFunctionSymbols(ConstString name,
-                                   uint32_t name_type_mask,
-                                   SymbolContextList &sc_list) {
+void Module::FindFunctionSymbols(ConstString name, uint32_t name_type_mask,
+                                 SymbolContextList &sc_list) {
   LLDB_SCOPED_TIMERF("Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)",
                      name.AsCString(), name_type_mask);
   if (Symtab *symtab = GetSymtab())
@@ -1341,8 +1338,8 @@ void Module::FindFunctionSymbols(ConstString name,
 }
 
 void Module::FindSymbolsWithNameAndType(ConstString name,
-                                          SymbolType symbol_type,
-                                          SymbolContextList &sc_list) {
+                                        SymbolType symbol_type,
+                                        SymbolContextList &sc_list) {
   // No need to protect this call using m_mutex all other method calls are
   // already thread safe.
   if (Symtab *symtab = GetSymtab()) {
@@ -1604,14 +1601,16 @@ bool Module::FindSourceFile(const FileSpec &orig_spec,
   return false;
 }
 
-llvm::Optional<std::string> Module::RemapSourceFile(llvm::StringRef path) const {
+llvm::Optional<std::string>
+Module::RemapSourceFile(llvm::StringRef path) const {
   std::lock_guard<std::recursive_mutex> guard(m_mutex);
   if (auto remapped = m_source_mappings.RemapPath(path))
     return remapped->GetPath();
   return {};
 }
 
-void Module::RegisterXcodeSDK(llvm::StringRef sdk_name, llvm::StringRef sysroot) {
+void Module::RegisterXcodeSDK(llvm::StringRef sdk_name,
+                              llvm::StringRef sysroot) {
   XcodeSDK sdk(sdk_name.str());
   llvm::StringRef sdk_path(HostInfo::GetXcodeSDKPath(sdk));
   if (sdk_path.empty())

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 8c20244a6c446..8c995ef2eb2a1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1097,7 +1097,8 @@ bool SymbolFileDWARF::ParseImportedModules(
       if (const char *include_path = module_die.GetAttributeValueAsString(
               DW_AT_LLVM_include_path, nullptr)) {
         FileSpec include_spec(include_path, dwarf_cu->GetPathStyle());
-        MakeAbsoluteAndRemap(include_spec, *dwarf_cu, m_objfile_sp->GetModule());
+        MakeAbsoluteAndRemap(include_spec, *dwarf_cu,
+                             m_objfile_sp->GetModule());
         module.search_path = ConstString(include_spec.GetPath());
       }
       if (const char *sysroot = dwarf_cu->DIE().GetAttributeValueAsString(
@@ -1924,7 +1925,7 @@ void SymbolFileDWARF::ResolveFunctionAndBlock(lldb::addr_t file_vm_addr,
       block_die = function_die.LookupDeepestBlock(file_vm_addr);
   }
 
-  if (!sc.function || ! lookup_block)
+  if (!sc.function || !lookup_block)
     return;
 
   Block &block = sc.function->GetBlock(true);
@@ -2319,7 +2320,8 @@ void SymbolFileDWARF::FindFunctions(ConstString name,
   if (log) {
     GetObjectFile()->GetModule()->LogMessage(
         log,
-        "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, sc_list)",
+        "SymbolFileDWARF::FindFunctions (name=\"%s\", name_type_mask=0x%x, "
+        "sc_list)",
         name.GetCString(), name_type_mask);
   }
 
@@ -2352,8 +2354,7 @@ void SymbolFileDWARF::FindFunctions(ConstString name,
         log,
         "SymbolFileDWARF::FindFunctions (name=\"%s\", "
         "name_type_mask=0x%x, include_inlines=%d, sc_list) => %u",
-        name.GetCString(), name_type_mask, include_inlines,
-        num_matches);
+        name.GetCString(), name_type_mask, include_inlines, num_matches);
   }
 }
 

diff  --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 271ce7be1eeaf..e81ce28cb86ea 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -253,8 +253,8 @@ class SymbolFileDWARF : public lldb_private::SymbolFile,
       ExternalTypeModuleMap;
 
   /// Return the list of Clang modules imported by this SymbolFile.
-  const ExternalTypeModuleMap& getExternalTypeModules() const {
-      return m_external_type_modules;
+  const ExternalTypeModuleMap &getExternalTypeModules() const {
+    return m_external_type_modules;
   }
 
   virtual DWARFDIE GetDIE(const DIERef &die_ref);
@@ -328,7 +328,6 @@ class SymbolFileDWARF : public lldb_private::SymbolFile,
     return m_parse_time;
   }
 
-
 protected:
   typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
       DIEToTypePtr;
@@ -428,9 +427,10 @@ class SymbolFileDWARF : public lldb_private::SymbolFile,
   virtual lldb::TypeSP
   FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx);
 
-  virtual lldb::TypeSP FindCompleteObjCDefinitionTypeForDIE(
-      const DWARFDIE &die, lldb_private::ConstString type_name,
-      bool must_be_implementation);
+  virtual lldb::TypeSP
+  FindCompleteObjCDefinitionTypeForDIE(const DWARFDIE &die,
+                                       lldb_private::ConstString type_name,
+                                       bool must_be_implementation);
 
   lldb_private::Symbol *
   GetObjCClassSymbol(lldb_private::ConstString objc_class_name);

diff  --git a/lldb/source/Symbol/SymbolFile.cpp b/lldb/source/Symbol/SymbolFile.cpp
index 53f8dd68c8b70..557c556991372 100644
--- a/lldb/source/Symbol/SymbolFile.cpp
+++ b/lldb/source/Symbol/SymbolFile.cpp
@@ -147,9 +147,11 @@ void SymbolFile::AssertModuleLock() {
   // We assert that we have to module lock by trying to acquire the lock from a
   // 
diff erent thread. Note that we must abort if the result is true to
   // guarantee correctness.
-  assert(std::async(std::launch::async,
-                    [this] { return this->GetModuleMutex().try_lock(); })
-                 .get() == false &&
+  assert(std::async(
+             std::launch::async,
+             [this] {
+               return this->GetModuleMutex().try_lock();
+             }).get() == false &&
          "Module is not locked");
 #endif
 }


        


More information about the lldb-commits mailing list