brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · e5b60a0 Raw
51 lines · c
1//===-- MSVCUndecoratedNameParser.h -----------------------------*- 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 9#ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H10#define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H11 12#include <vector>13 14#include "llvm/ADT/ArrayRef.h"15#include "llvm/ADT/StringRef.h"16 17class MSVCUndecoratedNameSpecifier {18public:19  MSVCUndecoratedNameSpecifier(llvm::StringRef full_name,20                               llvm::StringRef base_name)21      : m_full_name(full_name), m_base_name(base_name) {}22 23  llvm::StringRef GetFullName() const { return m_full_name; }24  llvm::StringRef GetBaseName() const { return m_base_name; }25 26private:27  llvm::StringRef m_full_name;28  llvm::StringRef m_base_name;29};30 31class MSVCUndecoratedNameParser {32public:33  explicit MSVCUndecoratedNameParser(llvm::StringRef name);34 35  llvm::ArrayRef<MSVCUndecoratedNameSpecifier> GetSpecifiers() const {36    return m_specifiers;37  }38 39  static bool IsMSVCUndecoratedName(llvm::StringRef name);40  static bool ExtractContextAndIdentifier(llvm::StringRef name,41                                          llvm::StringRef &context,42                                          llvm::StringRef &identifier);43 44  static llvm::StringRef DropScope(llvm::StringRef name);45 46private:47  std::vector<MSVCUndecoratedNameSpecifier> m_specifiers;48};49 50#endif51