summaryrefslogtreecommitdiff
path: root/lld/MachO/InputSection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/MachO/InputSection.cpp')
-rw-r--r--lld/MachO/InputSection.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lld/MachO/InputSection.cpp b/lld/MachO/InputSection.cpp
index 64c584920def..c1b3297f321f 100644
--- a/lld/MachO/InputSection.cpp
+++ b/lld/MachO/InputSection.cpp
@@ -167,8 +167,7 @@ std::string InputSection::getSourceLocation(uint64_t off) const {
// Symbols are generally prefixed with an underscore, which is not included
// in the debug information.
StringRef symName = sym->getName();
- if (!symName.empty() && symName[0] == '_')
- symName = symName.substr(1);
+ symName.consume_front("_");
if (std::optional<std::pair<std::string, unsigned>> fileLine =
dwarf->getVariableLoc(symName))