[lld] b0b1f45 - [LLD][ELF] Follow the common pattern in a message about an undefined vtable symbol.

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 21:40:49 PDT 2020


Author: Igor Kudrin
Date: 2020-04-02T11:39:03+07:00
New Revision: b0b1f451ae693703acf7fb73ba5a772aaa070d67

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

LOG: [LLD][ELF] Follow the common pattern in a message about an undefined vtable symbol.

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 61812ab40205..41a0cea96aa1 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -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);

diff  --git a/lld/test/ELF/undef.s b/lld/test/ELF/undef.s
index 2e5ed25dec49..db444e361527 100644
--- a/lld/test/ELF/undef.s
+++ b/lld/test/ELF/undef.s
@@ -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
 


        


More information about the llvm-commits mailing list