[PATCH] D39459: Rename SymbolBody -> Symbol.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 1 01:31:43 PDT 2017


grimar added a comment.

I reviewed first few files and I think for me naming is confusing.
Since there is no Bodies anymore it seems to me naming is odd.
Probably it can not be solved by mechanical change.
Leaved few comments, I think the rest files have the same issue.



================
Comment at: lld/COFF/Chunks.cpp:254
     // info.
-    SymbolBody *Body = File->getSymbolBody(Rel.SymbolTableIndex);
+    Symbol *Body = File->getSymbol(Rel.SymbolTableIndex);
     Defined *Sym = cast<Defined>(Body);
----------------
I think `Body` is odd name for Symbol.


================
Comment at: lld/COFF/Chunks.cpp:255
+    Symbol *Body = File->getSymbol(Rel.SymbolTableIndex);
     Defined *Sym = cast<Defined>(Body);
     Chunk *C = Sym->getChunk();
----------------
And `Sym` is odd name for ... Defined.


================
Comment at: lld/COFF/Chunks.cpp:331
       continue;
-    SymbolBody *Body = File->getSymbolBody(Rel.SymbolTableIndex);
+    Symbol *Body = File->getSymbol(Rel.SymbolTableIndex);
     if (isa<DefinedAbsolute>(Body))
----------------
The same.


================
Comment at: lld/COFF/InputFiles.cpp:189
 
-    SymbolBody *Body = nullptr;
+    Symbol *Body = nullptr;
     if (Sym.isUndefined()) {
----------------
Same.


================
Comment at: lld/COFF/InputFiles.h:166
   // List of all symbols referenced or defined by this file.
-  std::vector<SymbolBody *> SymbolBodies;
+  std::vector<Symbol *> SymbolBodies;
 
----------------
`SymbolBodies` does not look as good name now.


================
Comment at: lld/COFF/InputFiles.h:172
   // symbols in the real symbol table) are filled with null pointers.
-  std::vector<SymbolBody *> SparseSymbolBodies;
+  std::vector<Symbol *> SparseSymbolBodies;
 };
----------------
The same as above.


================
Comment at: lld/COFF/InputFiles.h:221
 
-  std::vector<SymbolBody *> SymbolBodies;
+  std::vector<Symbol *> SymbolBodies;
 };
----------------
The same.


================
Comment at: lld/COFF/LTO.cpp:96
   unsigned SymNum = 0;
-  std::vector<SymbolBody *> SymBodies = F.getSymbols();
+  std::vector<Symbol *> SymBodies = F.getSymbols();
   std::vector<lto::SymbolResolution> Resols(SymBodies.size());
----------------
Same.


https://reviews.llvm.org/D39459





More information about the llvm-commits mailing list