aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/IdentifierTable.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-17 14:58:09 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-17 14:58:09 +0000
commit2e1cd4264d363ca869bf37ef160902f211d21b8c (patch)
treeb4e6314529ad811be3463a668f8b4e515f66fbcc /include/clang/Basic/IdentifierTable.h
parentb8abbdc90f902a2c09c566193b900c2c45a46672 (diff)
Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of languages. DeclarationName is used in NamedDecl to store the name of the declaration (naturally), and ObjCMethodDecl is now a NamedDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r--include/clang/Basic/IdentifierTable.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index f6b95ba380..a13d4ba538 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -29,10 +29,11 @@ namespace llvm {
namespace clang {
struct LangOptions;
- class MultiKeywordSelector; // a private class used by Selector.
class IdentifierInfo;
class SourceLocation;
-
+ class MultiKeywordSelector; // private class used by Selector
+ class DeclarationName; // AST class that stores declaration names
+
/// IdentifierLocPair - A simple pair of identifier info and location.
typedef std::pair<IdentifierInfo*, SourceLocation> IdentifierLocPair;
@@ -281,8 +282,9 @@ class Selector {
}
Selector(uintptr_t V) : InfoPtr(V) {}
public:
- friend class SelectorTable; // only the SelectorTable can create these.
-
+ friend class SelectorTable; // only the SelectorTable can create these
+ friend class DeclarationName; // and the AST's DeclarationName.
+
/// The default ctor should only be used when creating data structures that
/// will contain selectors.
Selector() : InfoPtr(0) {}
@@ -362,12 +364,35 @@ public:
static SelectorTable* CreateAndRegister(llvm::Deserializer& D);
};
-} // end namespace clang
+/// DeclarationNameExtra - Common base of the MultiKeywordSelector and
+/// CXXSpecialName classes, both of which are private classes that can
+/// be stored by the AST's DeclarationName class.
+class DeclarationNameExtra {
+public:
+ /// ExtraKind - The kind of "extra" information stored in the
+ /// DeclarationName. See @c ExtraKindOrNumArgs for an explanation of
+ /// how these enumerator values are used.
+ enum ExtraKind {
+ CXXConstructor = 0,
+ CXXDestructor,
+ CXXConversionFunction,
+ NUM_EXTRA_KINDS
+ };
+ /// ExtraKindOrNumArgs - Either the kind of C++ special name (if the
+ /// value is one of the CXX* enumerators of ExtraKind), in which
+ /// case the DeclarationNameExtra is also a CXXSpecialName, or
+ /// NUM_EXTRA_KINDS+NumArgs, where NumArgs is the number of
+ /// arguments in the Objective-C selector, in which case the
+ /// DeclarationNameExtra is also a MultiKeywordSelector.
+ unsigned ExtraKindOrNumArgs;
+};
+
+} // end namespace clang
+namespace llvm {
/// Define DenseMapInfo so that Selectors can be used as keys in DenseMap and
/// DenseSets.
-namespace llvm {
template <>
struct DenseMapInfo<clang::Selector> {
static inline clang::Selector getEmptyKey() {
@@ -385,6 +410,6 @@ struct DenseMapInfo<clang::Selector> {
static bool isPod() { return true; }
};
-} // end namespace llvm
+} // end namespace llvm
#endif