[C++20] [Modules] Fix may-be incorrect ADL for module local entities (#123931)
[llvm-project.git] / lldb / source / Plugins / Language / CPlusPlus / MSVCUndecoratedNameParser.h
blobe5b60a0a1d5be4260db3174c80524c26d525d760
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H
12 #include <vector>
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/StringRef.h"
17 class MSVCUndecoratedNameSpecifier {
18 public:
19 MSVCUndecoratedNameSpecifier(llvm::StringRef full_name,
20 llvm::StringRef base_name)
21 : m_full_name(full_name), m_base_name(base_name) {}
23 llvm::StringRef GetFullName() const { return m_full_name; }
24 llvm::StringRef GetBaseName() const { return m_base_name; }
26 private:
27 llvm::StringRef m_full_name;
28 llvm::StringRef m_base_name;
31 class MSVCUndecoratedNameParser {
32 public:
33 explicit MSVCUndecoratedNameParser(llvm::StringRef name);
35 llvm::ArrayRef<MSVCUndecoratedNameSpecifier> GetSpecifiers() const {
36 return m_specifiers;
39 static bool IsMSVCUndecoratedName(llvm::StringRef name);
40 static bool ExtractContextAndIdentifier(llvm::StringRef name,
41 llvm::StringRef &context,
42 llvm::StringRef &identifier);
44 static llvm::StringRef DropScope(llvm::StringRef name);
46 private:
47 std::vector<MSVCUndecoratedNameSpecifier> m_specifiers;
50 #endif