[LLD][ELF] Follow the common pattern in a message about an undefined vtable symbol.
authorIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 31 Mar 2020 10:36:23 +0000 (17:36 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Thu, 2 Apr 2020 04:39:03 +0000 (11:39 +0700)
In most cases, LLD prints its multiline diagnostic messages starting
additional lines with ">>> ". That greatly helps external tools to parse
the output, simplifying combining several lines of the log back into one
message. The patch fixes the only message I found that does not follow
the common pattern.

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

lld/ELF/Relocations.cpp
lld/test/ELF/undef.s

index 61812ab..41a0cea 100644 (file)
@@ -901,8 +901,9 @@ static void reportUndefinedSymbol(const UndefinedDiag &undef,
   }
 
   if (sym.getName().startswith("_ZTV"))
-    msg += "\nthe vtable symbol may be undefined because the class is missing "
-           "its key function (see https://lld.llvm.org/missingkeyfunction)";
+    msg +=
+        "\n>>> the vtable symbol may be undefined because the class is missing "
+        "its key function (see https://lld.llvm.org/missingkeyfunction)";
 
   if (undef.isWarning)
     warn(msg);
index 2e5ed25..db444e3 100644 (file)
@@ -25,7 +25,7 @@
 # CHECK:      error: undefined symbol: vtable for Foo 
 # CHECK-NEXT: >>> referenced by undef.s
 # CHECK-NEXT: >>>               {{.*}}:(.text+0x15)
-# CHECK-NEXT: the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
+# CHECK-NEXT: >>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
 
 # Check that this symbol isn't demangled