diff options
author | Steve Naroff <snaroff@apple.com> | 2007-09-12 23:08:22 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-09-12 23:08:22 +0000 |
commit | a9aa5e69d8253e196be90c070738ab5bd9813730 (patch) | |
tree | 780cc81253f93d8fdcf42e2b6eeea1925dcd7a84 | |
parent | 97487a01d7ae5068b793766257d34402b5d86667 (diff) |
Add ASTContext::StringMap<char> to unique selector names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41894 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | clang.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | include/clang/AST/ASTContext.h | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/clang.xcodeproj/project.pbxproj b/clang.xcodeproj/project.pbxproj index a7d7e5fae4..06a6d796fb 100644 --- a/clang.xcodeproj/project.pbxproj +++ b/clang.xcodeproj/project.pbxproj @@ -675,7 +675,6 @@ 08FB7793FE84155DC02AAC07 /* Project object */ = { isa = PBXProject; buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */; - compatibilityVersion = "Xcode 2.4"; hasScannedForEncodings = 1; mainGroup = 08FB7794FE84155DC02AAC07 /* clang */; projectDirPath = ""; diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 1d39bb3b70..f1e0959e0c 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -19,6 +19,7 @@ #include "clang/AST/RecordLayout.h" #include "clang/AST/Type.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/StringMap.h" #include <vector> namespace clang { @@ -37,6 +38,7 @@ class ASTContext { llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos; llvm::DenseMap<const RecordDecl*, const RecordLayout*> RecordLayoutInfo; RecordDecl *CFConstantStringTypeDecl; + llvm::StringMap<char> SelectorNames; public: TargetInfo &Target; IdentifierTable &Idents; @@ -174,6 +176,16 @@ public: /// 'typeSize' is a real floating point or complex type. QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, QualType typeDomain) const; + + //===--------------------------------------------------------------------===// + // Objective-C + //===--------------------------------------------------------------------===// + + /// getSelectorName - Return a uniqued character string for the selector. + char &getSelectorName(const char *NameStart, const char *NameEnd) { + return SelectorNames.GetOrCreateValue(NameStart, NameEnd).getValue(); + } + private: ASTContext(const ASTContext&); // DO NOT IMPLEMENT void operator=(const ASTContext&); // DO NOT IMPLEMENT |