[PATCH] D68975: [LLD] [COFF] Try to report source locations for duplicate symbols

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 03:00:08 PDT 2019


ruiu added inline comments.
Herald added a subscriber: ormris.


================
Comment at: lld/COFF/InputFiles.cpp:792
 
+Optional<std::pair<StringRef, uint32_t>>
+ObjFile::getVariableLocation(StringRef var) {
----------------
Please add a comment saying that this is using DWARF debug info instead of PDB, which is not very common.


================
Comment at: lld/COFF/InputFiles.cpp:794-795
+ObjFile::getVariableLocation(StringRef var) {
+  if (!config->mingw)
+    return None;
+  if (!dwarf) {
----------------
You can let clang-cl to generate DWARF and use lld-link to link the object files, so this doesn't have to be mingw-specific?


================
Comment at: lld/COFF/InputFiles.cpp:818
+
+void ObjFile::initializeDwarf() {
+  for (std::unique_ptr<DWARFUnit> &cu : dwarf->compile_units()) {
----------------
I'd add a comment saying this function initializes `dwarf`, `lineTables` and `variableLoc` members..


================
Comment at: lld/COFF/SymbolTable.cpp:563
+
+void SymbolTable::reportDuplicate(Symbol *existing, InputFile *newFile,
+                                  SectionChunk *newSc,
----------------
Can you add a comment with an example output?


Repository:
  rLLD LLVM Linker

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68975/new/

https://reviews.llvm.org/D68975





More information about the llvm-commits mailing list