Use StringRefZ explicitly instead of const char *.
authorRui Ueyama <ruiu@google.com>
Tue, 29 Nov 2016 19:11:39 +0000 (19:11 +0000)
committerRui Ueyama <ruiu@google.com>
Tue, 29 Nov 2016 19:11:39 +0000 (19:11 +0000)
This patch is to avoid an implicit conversion from const char * to
StringRefZ, to make it apparent where we are using StringRefZ.

llvm-svn: 288182

lld/ELF/InputFiles.cpp

index c8bcd73..de7e103 100644 (file)
@@ -450,7 +450,7 @@ SymbolBody *elf::ObjectFile<ELFT>::createSymbolBody(const Elf_Sym *Sym) {
     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);