From: Steve Naroff Date: Wed, 12 Sep 2007 23:08:22 +0000 (+0000) Subject: Add ASTContext::StringMap to unique selector names. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9aa5e69d8253e196be90c070738ab5bd9813730;p=clang Add ASTContext::StringMap to unique selector names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41894 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 namespace clang { @@ -37,6 +38,7 @@ class ASTContext { llvm::FoldingSet FunctionTypeProtos; llvm::DenseMap RecordLayoutInfo; RecordDecl *CFConstantStringTypeDecl; + llvm::StringMap 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