diff options
| author | robot-ydb-importer <[email protected]> | 2024-02-01 17:04:24 +0300 |
|---|---|---|
| committer | Alexander Smirnov <[email protected]> | 2024-02-09 19:16:57 +0300 |
| commit | 92eec2d2cadb061e8d0736fc1e6006255d1db6aa (patch) | |
| tree | 374efcbf55311667e4f87ee2790bf71ac6756ae4 /contrib/libs/llvm12/lib/Demangle/Demangle.cpp | |
| parent | b34656eaa432fe5258085ca4e4642774fe082456 (diff) | |
YDB Import 559
Diffstat (limited to 'contrib/libs/llvm12/lib/Demangle/Demangle.cpp')
| -rw-r--r-- | contrib/libs/llvm12/lib/Demangle/Demangle.cpp | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/contrib/libs/llvm12/lib/Demangle/Demangle.cpp b/contrib/libs/llvm12/lib/Demangle/Demangle.cpp deleted file mode 100644 index 000f75b6a97..00000000000 --- a/contrib/libs/llvm12/lib/Demangle/Demangle.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===-- Demangle.cpp - Common demangling functions ------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -/// -/// \file This file contains definitions of common demangling functions. -/// -//===----------------------------------------------------------------------===// - -#include "llvm/Demangle/Demangle.h" -#include <cstdlib> - -static bool isItaniumEncoding(const std::string &MangledName) { - size_t Pos = MangledName.find_first_not_of('_'); - // A valid Itanium encoding requires 1-4 leading underscores, followed by 'Z'. - return Pos > 0 && Pos <= 4 && MangledName[Pos] == 'Z'; -} - -std::string llvm::demangle(const std::string &MangledName) { - char *Demangled; - if (isItaniumEncoding(MangledName)) - Demangled = itaniumDemangle(MangledName.c_str(), nullptr, nullptr, nullptr); - else - Demangled = microsoftDemangle(MangledName.c_str(), nullptr, nullptr, - nullptr, nullptr); - - if (!Demangled) - return MangledName; - - std::string Ret = Demangled; - std::free(Demangled); - return Ret; -} |
