clang  6.0.0svn
SymbolName.h
Go to the documentation of this file.
1 //===--- SymbolName.h - Clang refactoring library -------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLING_REFACTOR_RENAME_SYMBOL_NAME_H
11 #define LLVM_CLANG_TOOLING_REFACTOR_RENAME_SYMBOL_NAME_H
12 
13 #include "clang/Basic/LLVM.h"
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringRef.h"
17 
18 namespace clang {
19 namespace tooling {
20 
21 /// A name of a symbol.
22 ///
23 /// Symbol's name can be composed of multiple strings. For example, Objective-C
24 /// methods can contain multiple argument lables:
25 ///
26 /// \code
27 /// - (void) myMethodNamePiece: (int)x anotherNamePieces:(int)y;
28 /// // ^~ string 0 ~~~~~ ^~ string 1 ~~~~~
29 /// \endcode
30 class SymbolName {
31 public:
32  explicit SymbolName(StringRef Name) {
33  // While empty symbol names are valid (Objective-C selectors can have empty
34  // name pieces), occurrences Objective-C selectors are created using an
35  // array of strings instead of just one string.
36  assert(!Name.empty() && "Invalid symbol name!");
37  this->Name.push_back(Name.str());
38  }
39 
40  ArrayRef<std::string> getNamePieces() const { return Name; }
41 
42 private:
44 };
45 
46 } // end namespace tooling
47 } // end namespace clang
48 
49 #endif // LLVM_CLANG_TOOLING_REFACTOR_RENAME_SYMBOL_NAME_H
A name of a symbol.
Definition: SymbolName.h:30
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.
SymbolName(StringRef Name)
Definition: SymbolName.h:32
ArrayRef< std::string > getNamePieces() const
Definition: SymbolName.h:40