[llvm] 3fce5ea - [DWARFLinker] Capitalize type names (NFC)

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 00:18:15 PDT 2020


Author: Jonas Devlieghere
Date: 2020-10-22T00:18:07-07:00
New Revision: 3fce5ea7ce663410d3fb533528158bdab3a3604e

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

LOG: [DWARFLinker] Capitalize type names (NFC)

Make these types conform to the LLVM Coding Standards:

> Type names (including classes, structs, enums, typedefs, etc) should
> be nouns and start with an upper-case letter.

Added: 
    

Modified: 
    llvm/include/llvm/DWARFLinker/DWARFLinker.h
    llvm/include/llvm/DWARFLinker/DWARFStreamer.h
    llvm/lib/DWARFLinker/DWARFLinker.cpp
    llvm/tools/dsymutil/DwarfLinkerForBinary.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/DWARFLinker/DWARFLinker.h b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
index 2fb61b9edf55..bac2be8eb370 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFLinker.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFLinker.h
@@ -221,12 +221,12 @@ class DWARFFile {
 
 typedef std::function<void(const Twine &Warning, StringRef Context,
                            const DWARFDie *DIE)>
-    messageHandler;
+    MessageHandler;
 typedef std::function<ErrorOr<DWARFFile &>(StringRef ContainerName,
                                            StringRef Path)>
-    objFileLoader;
-typedef std::map<std::string, std::string> swiftInterfacesMap;
-typedef std::map<std::string, std::string> objectPrefixMap;
+    ObjectFileLoader;
+typedef std::map<std::string, std::string> SwiftInterfaceMap;
+typedef std::map<std::string, std::string> ObjectPrefixMap;
 
 /// The core of the Dwarf linking logic.
 ///
@@ -295,28 +295,28 @@ class DWARFLinker {
   }
 
   /// Set warning handler which would be used to report warnings.
-  void setWarningHandler(messageHandler Handler) {
+  void setWarningHandler(MessageHandler Handler) {
     Options.WarningHandler = Handler;
   }
 
   /// Set error handler which would be used to report errors.
-  void setErrorHandler(messageHandler Handler) {
+  void setErrorHandler(MessageHandler Handler) {
     Options.ErrorHandler = Handler;
   }
 
   /// Set object files loader which would be used to load
   /// additional objects for splitted dwarf.
-  void setObjFileLoader(objFileLoader Loader) {
+  void setObjFileLoader(ObjectFileLoader Loader) {
     Options.ObjFileLoader = Loader;
   }
 
   /// Set map for Swift interfaces.
-  void setSwiftInterfacesMap(swiftInterfacesMap *Map) {
+  void setSwiftInterfaceMap(SwiftInterfaceMap *Map) {
     Options.ParseableSwiftInterfaces = Map;
   }
 
   /// Set prefix map for objects.
-  void setObjectPrefixMap(objectPrefixMap *Map) {
+  void setObjectPrefixMap(ObjectPrefixMap *Map) {
     Options.ObjectPrefixMap = Map;
   }
 
@@ -783,22 +783,22 @@ class DWARFLinker {
     std::string PrependPath;
 
     // warning handler
-    messageHandler WarningHandler = nullptr;
+    MessageHandler WarningHandler = nullptr;
 
     // error handler
-    messageHandler ErrorHandler = nullptr;
+    MessageHandler ErrorHandler = nullptr;
 
-    objFileLoader ObjFileLoader = nullptr;
+    ObjectFileLoader ObjFileLoader = nullptr;
 
     /// A list of all .swiftinterface files referenced by the debug
     /// info, mapping Module name to path on disk. The entries need to
     /// be uniqued and sorted and there are only few entries expected
     /// per compile unit, which is why this is a std::map.
     /// this is dsymutil specific fag.
-    swiftInterfacesMap *ParseableSwiftInterfaces = nullptr;
+    SwiftInterfaceMap *ParseableSwiftInterfaces = nullptr;
 
     /// A list of remappings to apply to file paths.
-    objectPrefixMap *ObjectPrefixMap = nullptr;
+    ObjectPrefixMap *ObjectPrefixMap = nullptr;
   } Options;
 };
 

diff  --git a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
index de58f5dedf24..326a9dbac0f4 100644
--- a/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
+++ b/llvm/include/llvm/DWARFLinker/DWARFStreamer.h
@@ -44,7 +44,7 @@ class DwarfStreamer : public DwarfEmitter {
 public:
   DwarfStreamer(OutputFileType OutFileType, raw_pwrite_stream &OutFile,
                 std::function<StringRef(StringRef Input)> Translator,
-                bool Minimize, messageHandler Error, messageHandler Warning)
+                bool Minimize, MessageHandler Error, MessageHandler Warning)
       : OutFile(OutFile), OutFileType(OutFileType), Translator(Translator),
         Minimize(Minimize), ErrorHandler(Error), WarningHandler(Warning) {}
 
@@ -210,8 +210,8 @@ class DwarfStreamer : public DwarfEmitter {
                              const CompileUnit &Unit,
                              const std::vector<CompileUnit::AccelInfo> &Names);
 
-  messageHandler ErrorHandler = nullptr;
-  messageHandler WarningHandler = nullptr;
+  MessageHandler ErrorHandler;
+  MessageHandler WarningHandler;
 };
 
 } // end namespace llvm

diff  --git a/llvm/lib/DWARFLinker/DWARFLinker.cpp b/llvm/lib/DWARFLinker/DWARFLinker.cpp
index 2b1227428105..352e65d02609 100644
--- a/llvm/lib/DWARFLinker/DWARFLinker.cpp
+++ b/llvm/lib/DWARFLinker/DWARFLinker.cpp
@@ -207,7 +207,7 @@ static void resolveRelativeObjectPath(SmallVectorImpl<char> &Buf, DWARFDie CU) {
 /// DW_TAG_module blocks.
 static void analyzeImportedModule(
     const DWARFDie &DIE, CompileUnit &CU,
-    swiftInterfacesMap *ParseableSwiftInterfaces,
+    SwiftInterfaceMap *ParseableSwiftInterfaces,
     std::function<void(const Twine &, const DWARFDie &)> ReportWarning) {
   if (CU.getLanguage() != dwarf::DW_LANG_Swift)
     return;
@@ -252,7 +252,7 @@ static bool analyzeContextInfo(
     const DWARFDie &DIE, unsigned ParentIdx, CompileUnit &CU,
     DeclContext *CurrentDeclContext, UniquingStringPool &StringPool,
     DeclContextTree &Contexts, uint64_t ModulesEndOffset,
-    swiftInterfacesMap *ParseableSwiftInterfaces,
+    SwiftInterfaceMap *ParseableSwiftInterfaces,
     std::function<void(const Twine &, const DWARFDie &)> ReportWarning,
     bool InImportedModule = false) {
   unsigned MyIdx = CU.getOrigUnit().getDIEIndex(DIE);
@@ -1940,7 +1940,7 @@ static uint64_t getDwoId(const DWARFDie &CUDie, const DWARFUnit &Unit) {
 }
 
 static std::string remapPath(StringRef Path,
-                             const objectPrefixMap &ObjectPrefixMap) {
+                             const ObjectPrefixMap &ObjectPrefixMap) {
   if (ObjectPrefixMap.empty())
     return Path.str();
 

diff  --git a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
index 3c71567b54bb..c6bd88694db6 100644
--- a/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+++ b/llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
@@ -384,7 +384,7 @@ bool DwarfLinkerForBinary::link(const DebugMap &Map) {
 
         llvm_unreachable("Unhandled DebugMap object");
       });
-  GeneralLinker.setSwiftInterfacesMap(&ParseableSwiftInterfaces);
+  GeneralLinker.setSwiftInterfaceMap(&ParseableSwiftInterfaces);
 
   for (const auto &Obj : Map.objects()) {
     // N_AST objects (swiftmodule files) should get dumped directly into the


        


More information about the llvm-commits mailing list