23 lines · cpp
1//===- Utils.cpp ------------------------------------------------*- C++-*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//===----------------------------------------------------------------------===//7//8// The file defines utils functions that can be shared across archs.9//10//===----------------------------------------------------------------------===//11 12#include "lld/Common/Utils.h"13 14using namespace llvm;15using namespace lld;16 17StringRef lld::utils::getRootSymbol(StringRef name) {18 name.consume_back(".Tgm");19 auto [P0, S0] = name.rsplit(".llvm.");20 auto [P1, S1] = P0.rsplit(".__uniq.");21 return P1;22}23