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 | 3aa4efbdeed79f53677bfc604d47c11065f0790f (patch) | |
tree | 28d3191b984e77880a5f278fb066434636936fe2 | |
parent | d8317967aaba777b92e0d9aa3259b9538767a256 (diff) | |
download | llvm-3aa4efbdeed79f53677bfc604d47c11065f0790f.zip llvm-3aa4efbdeed79f53677bfc604d47c11065f0790f.tar.gz llvm-3aa4efbdeed79f53677bfc604d47c11065f0790f.tar.bz2 |
Add ASTContext::StringMap<char> to unique selector names.
llvm-svn: 41894
-rw-r--r-- | clang/clang.xcodeproj/project.pbxproj | 1 | ||||
-rw-r--r-- | clang/include/clang/AST/ASTContext.h | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/clang/clang.xcodeproj/project.pbxproj b/clang/clang.xcodeproj/project.pbxproj index a7d7e5f..06a6d79 100644 --- a/clang/clang.xcodeproj/project.pbxproj +++ b/clang/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/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 1d39bb3..f1e0959 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/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 |