[PATCH] D45467: COFF: Friendlier undefined symbol errors.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 16 21:21:59 PDT 2018


ruiu added inline comments.


================
Comment at: lld/COFF/Chunks.h:195
 
+  ArrayRef<coff_relocation> relocs() const { return Relocs; }
+
----------------
Now we probably should just export Relocs instead of defining an accessor for it.


================
Comment at: lld/COFF/PDB.cpp:1218
+    DenseMap<uint32_t, uint32_t> Secrels;
+    for (auto &R : DbgC->relocs()) {
+      if (R.Type != SecrelReloc)
----------------
auto -> coff_relocation


================
Comment at: lld/COFF/PDB.cpp:1300-1301
+  uint32_t LineNumber;
+  for (const auto &Entry : Lines) {
+    for (auto &LN : Entry.LineNumbers) {
+      if (LN.Offset > OffsetInLinetable) {
----------------
Can you use real types instead of auto?


================
Comment at: lld/COFF/SymbolTable.cpp:199-201
+        OS << "undefined symbol: " + Sym->getName();
+        printSymbolLocations(OS, File, SymIndex);
+        errorOrWarn(OS.str());
----------------
Something like this is I think more straightforward

  errorOrWarn("undefined symbol: " + Sym->getName() + getSymbolLocations(File, SymIndex));


https://reviews.llvm.org/D45467





More information about the llvm-commits mailing list