[PATCH] D55951: [LLD][COFF] Fix file/line retrieval when a undefined symbol is to be printed
    Reid Kleckner via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Dec 21 12:13:56 PST 2018
    
    
  
rnk added inline comments.
================
Comment at: COFF/PDB.cpp:1739
+  Optional<uint32_t> NameIndex;
+  Optional<uint32_t> LineNumber;
   for (LineColumnEntry &Entry : Lines) {
----------------
I think zero initializing these both is better than using Optional. The string table index 0 gives the empty string, right? It seems nicer to use that and avoid the extra conditional branches. I guess you'd still need the branch in the loop to say, if we don't have a filename so far but we have an entry, use the next entry. Although, the branchless way to write that is to pull the first filename string table index from the first line table entry if it exists.
Repository:
  rLLD LLVM Linker
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55951/new/
https://reviews.llvm.org/D55951
    
    
More information about the llvm-commits
mailing list