aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/IdentifierTable.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2008-11-12 23:21:09 +0000
committerDouglas Gregor <dgregor@apple.com>2008-11-12 23:21:09 +0000
commit7d7e6727a5de032c86dcb58ae734e7c1603c26e6 (patch)
tree0c542ae5d737114b92f73e8291c51903e8c0b74b /include/clang/Basic/IdentifierTable.h
parentb7c3ca8af0a1a3b66fb220562c72dd3102153d5b (diff)
Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier for these (e.g., "<constructor>") and override NamedDecl::getName() to provide a human-readable name. This is one potential solution to the problem; another solution would be to replace the use of IdentifierInfo* in NamedDecl with a different class that deals with identifiers better. I'm also prototyping that to see how it compares, but this commit is better than what we had previously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59193 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/IdentifierTable.h')
-rw-r--r--include/clang/Basic/IdentifierTable.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index 4a16a3e42b..f6b95ba380 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -178,6 +178,16 @@ class IdentifierTable {
/// overloadable operators in C++.
IdentifierInfo *OverloadedOperators[NUM_OVERLOADED_OPERATORS];
+ /// ConstructorId - Placeholder identifier for C++ constructors.
+ IdentifierInfo *ConstructorId;
+
+ /// DestructorId - Placeholder identifier for C++ destructor.
+ IdentifierInfo *DestructorId;
+
+ /// ConversionFunctionId - Placeholder identifier for a C++
+ /// conversion function.
+ IdentifierInfo *ConversionFunctionId;
+
public:
/// IdentifierTable ctor - Create the identifier table, populating it with
/// info about the language keywords for the language specified by LangOpts.
@@ -203,6 +213,18 @@ public:
return *OverloadedOperators[Op];
}
+ /// getConstructorId - Return a placeholder identifier for a C++
+ /// constructor.
+ IdentifierInfo &getConstructorId();
+
+ /// getDestructorId - Return a placeholder identifier for a C++
+ /// destructor.
+ IdentifierInfo &getDestructorId();
+
+ /// getConversionFunctionId - Return a placeholder identifier for a
+ /// C++ conversion function.
+ IdentifierInfo &getConversionFunctionId();
+
typedef HashTableTy::const_iterator iterator;
typedef HashTableTy::const_iterator const_iterator;