clang
18.0.0git
include
clang
Tooling
Refactoring
Rename
SymbolName.h
Go to the documentation of this file.
1
//===--- SymbolName.h - Clang refactoring library -------------------------===//
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
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_CLANG_TOOLING_REFACTORING_RENAME_SYMBOLNAME_H
10
#define LLVM_CLANG_TOOLING_REFACTORING_RENAME_SYMBOLNAME_H
11
12
#include "
clang/Basic/LLVM.h
"
13
#include "llvm/ADT/ArrayRef.h"
14
#include "llvm/ADT/SmallVector.h"
15
#include "llvm/ADT/StringRef.h"
16
17
namespace
clang
{
18
namespace
tooling {
19
20
/// A name of a symbol.
21
///
22
/// Symbol's name can be composed of multiple strings. For example, Objective-C
23
/// methods can contain multiple argument labels:
24
///
25
/// \code
26
/// - (void) myMethodNamePiece: (int)x anotherNamePieces:(int)y;
27
/// // ^~ string 0 ~~~~~ ^~ string 1 ~~~~~
28
/// \endcode
29
class
SymbolName
{
30
public
:
31
explicit
SymbolName
(StringRef Name) {
32
// While empty symbol names are valid (Objective-C selectors can have empty
33
// name pieces), occurrences Objective-C selectors are created using an
34
// array of strings instead of just one string.
35
assert(!Name.empty() &&
"Invalid symbol name!"
);
36
this->Name.push_back(Name.str());
37
}
38
39
ArrayRef<std::string>
getNamePieces
()
const
{
return
Name; }
40
41
private
:
42
llvm::SmallVector<std::string, 1>
Name;
43
};
44
45
}
// end namespace tooling
46
}
// end namespace clang
47
48
#endif
// LLVM_CLANG_TOOLING_REFACTORING_RENAME_SYMBOLNAME_H
LLVM.h
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
clang::tooling::SymbolName
A name of a symbol.
Definition:
SymbolName.h:29
clang::tooling::SymbolName::SymbolName
SymbolName(StringRef Name)
Definition:
SymbolName.h:31
clang::tooling::SymbolName::getNamePieces
ArrayRef< std::string > getNamePieces() const
Definition:
SymbolName.h:39
llvm::ArrayRef
Definition:
LLVM.h:31
llvm::SmallVector
Definition:
LLVM.h:35
clang
Definition:
CalledOnceCheck.h:17
Generated on Mon Nov 27 2023 22:29:36 for clang by
1.9.6