summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objdump
diff options
context:
space:
mode:
authorJames Henderson <jh7370@my.bristol.ac.uk>2019-01-17 15:18:44 +0000
committerJames Henderson <jh7370@my.bristol.ac.uk>2019-01-17 15:18:44 +0000
commitce5b5b486a71939913b1a0909498f216b5528401 (patch)
treeb82d02f6abbae0060909f263503a50d3ea206227 /llvm/tools/llvm-objdump
parent7630e0bcbe087918b31ba018af742a59989550df (diff)
downloadbcm5719-llvm-ce5b5b486a71939913b1a0909498f216b5528401.tar.gz
bcm5719-llvm-ce5b5b486a71939913b1a0909498f216b5528401.zip
Move demangling function from llvm-objdump to Demangle library
This allows it to be used in an upcoming llvm-readobj change. A small change in internal behaviour of the function is to always call the microsoftDemangle function if the string does not have an itanium encoding prefix, rather than only if it starts with '?'. This is harmless because the microsoftDemangle function does the same check already. Reviewed by: grimar, erik.pilkington Differential Revision: https://reviews.llvm.org/D56721 llvm-svn: 351448
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r--llvm/tools/llvm-objdump/llvm-objdump.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index 449d10cbb92..a4dbd07612f 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -463,21 +463,6 @@ bool llvm::isRelocAddressLess(RelocationRef A, RelocationRef B) {
return A.getOffset() < B.getOffset();
}
-static std::string demangle(StringRef Name) {
- char *Demangled = nullptr;
- if (Name.startswith("_Z"))
- Demangled = itaniumDemangle(Name.data(), Demangled, nullptr, nullptr);
- else if (Name.startswith("?"))
- Demangled = microsoftDemangle(Name.data(), Demangled, nullptr, nullptr);
-
- if (!Demangled)
- return Name;
-
- std::string Ret = Demangled;
- free(Demangled);
- return Ret;
-}
-
template <class ELFT>
static std::error_code getRelocationValueString(const ELFObjectFile<ELFT> *Obj,
const RelocationRef &RelRef,
OpenPOWER on IntegriCloud