1 //===-- MSVCUndecoratedNameParser.h -----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H
10 #define LLDB_SOURCE_PLUGINS_LANGUAGE_CPLUSPLUS_MSVCUNDECORATEDNAMEPARSER_H
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/StringRef.h"
17 class MSVCUndecoratedNameSpecifier
{
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
; }
27 llvm::StringRef m_full_name
;
28 llvm::StringRef m_base_name
;
31 class MSVCUndecoratedNameParser
{
33 explicit MSVCUndecoratedNameParser(llvm::StringRef name
);
35 llvm::ArrayRef
<MSVCUndecoratedNameSpecifier
> GetSpecifiers() const {
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
);
47 std::vector
<MSVCUndecoratedNameSpecifier
> m_specifiers
;