[lld] r274804 - Move demangle() from Symbols.cpp to Strings.cpp.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 16:44:20 PDT 2016


On Thu, Jul 7, 2016 at 4:39 PM, Davide Italiano <davide at freebsd.org> wrote:
> r274806
>
> On Thu, Jul 7, 2016 at 4:30 PM, Rui Ueyama <ruiu at google.com> wrote:
>> It demangles symbols by default, so we only have --no-demangle option. Feel
>> free to add --demangle as an ignored option.
>>
Also, FYI, this feature is not really tested.

template <typename ELFT>
std::string SymbolTable<ELFT>::conflictMsg(SymbolBody *Existing,
                                           InputFile *NewFile) {
  std::string Sym = Existing->getName();
#if 0
  if (Config->Demangle)
    Sym = demangle(Sym);
#endif
  return Sym + " in " + getFilename(Existing->getSourceFile<ELFT>()) + " and " +
         getFilename(NewFile);
}

If I compile out the call to demangle() all the tests will pass.
The only test for demangle is conflict.s but it matches using a regex
on the mangled
or demangled symbol.
Given we don't have a demangler for Windows from what I can tell we can either:
1) leave the test as is and not really test demangling
2) Make the test REQUIRE: shell but lose Windows coverage for this test.

Up to you.

Thanks,

--
Davide


>> On Thu, Jul 7, 2016 at 4:28 PM, Davide Italiano <davide at freebsd.org> wrote:
>>>
>>> On Thu, Jul 7, 2016 at 4:04 PM, Rui Ueyama via llvm-commits
>>> <llvm-commits at lists.llvm.org> wrote:
>>> > Author: ruiu
>>> > Date: Thu Jul  7 18:04:15 2016
>>> > New Revision: 274804
>>> >
>>> > URL: http://llvm.org/viewvc/llvm-project?rev=274804&view=rev
>>> > Log:
>>> > Move demangle() from Symbols.cpp to Strings.cpp.
>>> >
>>> > Symbols.cpp contains functions to handle ELF symbols.
>>> > demangle() function is essentially a function to work on a
>>> > string rather than on an ELF symbol. So Strings.cpp is a
>>> > better place to put that function.
>>> >
>>> > This change also make demangle to demangle symbols unconditionally.
>>> > Previously, it demangled symbols only when Config->Demangle is true.
>>> >
>>>
>>> FWIW, lld currently doesn't accept --demangle
>>>
>>> [davide at localhost build-clang]$ ld.gold --demangle
>>> ld.gold: fatal error: no input files
>>> [davide at localhost build-clang]$ ld.lld --demangle
>>> warning: unknown argument: --demangle
>>> unknown argument(s) found
>>>
>>>
>>> Thanks,
>>>
>>> --
>>> Davide
>>
>>
>
>
>
> --
> Davide
>
> "There are no solved problems; there are only problems that are more
> or less solved" -- Henri Poincare



-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-commits mailing list