1 //===- Strings.cpp -------------------------------------------------------===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
15 #pragma comment(lib, "dbghelp.lib")
19 using namespace lld::coff;
22 Optional<std::string> coff::demangle(StringRef S) {
25 if (S.startswith("?"))
26 if (size_t Len = UnDecorateSymbolName(S.str().c_str(), Buf, sizeof(Buf), 0))
27 return std::string(Buf, Len);