[lld] [lld-macho] Make ObjC category checker print the source file name of … (PR #80221)

Kyungwoo Lee via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 07:54:24 PST 2024


================
@@ -237,12 +237,24 @@ void ObjcCategoryChecker::parseMethods(const ConcatInputSection *methodsIsec,
     StringRef newCatName =
         getReferentString(*containerIsec->getRelocAt(catLayout.nameOffset));
 
+    auto formatObjAndSrcFileName = [](const InputSection *section) {
+      lld::macho::InputFile *inputFile = section->getFile();
+      std::string result = toString(inputFile);
+
+      auto objFile = dyn_cast_or_null<ObjFile>(inputFile);
+      if (objFile && objFile->compileUnit) {
+        result += " (" + objFile->sourceFile() + ")";
+      }
----------------
kyulee-com wrote:

nit. can you drop {} in the single line case per convention/consistency?

https://github.com/llvm/llvm-project/pull/80221


More information about the llvm-commits mailing list