From: Rui Ueyama Date: Fri, 28 Apr 2017 20:00:09 +0000 (+0000) Subject: Use toString(Inputfile*) to format a file object. X-Git-Tag: llvmorg-5.0.0-rc1~6395 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a3ef95fc9328886779594f86077087bf87bfd3e;p=platform%2Fupstream%2Fllvm.git Use toString(Inputfile*) to format a file object. llvm-svn: 301674 --- diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index f6ec4dd..3b92ff1 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -123,10 +123,10 @@ std::string elf::ObjectFile::getLineInfo(InputSectionBase *S, return ""; } -// Returns "(internal)", "foo.a(bar.o)" or "baz.o". +// Returns "", "foo.a(bar.o)" or "baz.o". std::string lld::toString(const InputFile *F) { if (!F) - return "(internal)"; + return ""; if (F->ToStringCache.empty()) { if (F->ArchiveName.empty()) diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index aff5755..c082f12 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -39,9 +39,7 @@ std::vector elf::InputSections; // Returns a string to construct an error message. std::string lld::toString(const InputSectionBase *Sec) { - // File can be absent if section is synthetic. - std::string FileName = Sec->File ? Sec->File->getName() : ""; - return (FileName + ":(" + Sec->Name + ")").str(); + return (toString(Sec->File) + ":(" + Sec->Name + ")").str(); } template diff --git a/lld/test/ELF/abs-conflict.s b/lld/test/ELF/abs-conflict.s index 17a5302..4662c48 100644 --- a/lld/test/ELF/abs-conflict.s +++ b/lld/test/ELF/abs-conflict.s @@ -15,4 +15,4 @@ foo = 0x123 // DUP: duplicate symbol: foo // DUP-NEXT: >>> defined in {{.*}}.o -// DUP-NEXT: >>> defined in (internal) +// DUP-NEXT: >>> defined in