[lld] r288182 - Use StringRefZ explicitly instead of const char *.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 11:11:40 PST 2016


Author: ruiu
Date: Tue Nov 29 13:11:39 2016
New Revision: 288182

URL: http://llvm.org/viewvc/llvm-project?rev=288182&view=rev
Log:
Use StringRefZ explicitly instead of const char *.

This patch is to avoid an implicit conversion from const char * to
StringRefZ, to make it apparent where we are using StringRefZ.

Modified:
    lld/trunk/ELF/InputFiles.cpp

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=288182&r1=288181&r2=288182&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Nov 29 13:11:39 2016
@@ -450,7 +450,7 @@ SymbolBody *elf::ObjectFile<ELFT>::creat
     if (this->StringTable.size() <= Sym->st_name)
       fatal(toString(this) + ": invalid symbol name offset");
 
-    const char *Name = this->StringTable.data() + Sym->st_name;
+    StringRefZ Name = this->StringTable.data() + Sym->st_name;
     if (Sym->st_shndx == SHN_UNDEF)
       return new (BAlloc)
           Undefined(Name, /*IsLocal=*/true, StOther, Type, this);




More information about the llvm-commits mailing list