]> granicus.if.org Git - clang/commitdiff
Add ASTContext::StringMap<char> to unique selector names.
authorSteve Naroff <snaroff@apple.com>
Wed, 12 Sep 2007 23:08:22 +0000 (23:08 +0000)
committerSteve Naroff <snaroff@apple.com>
Wed, 12 Sep 2007 23:08:22 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41894 91177308-0d34-0410-b5e6-96231b3b80d8

clang.xcodeproj/project.pbxproj
include/clang/AST/ASTContext.h

index a7d7e5fae4dad959240a194c7ac5b4058d018e84..06a6d796fb833472bd8969f78cc630c942e9c126 100644 (file)
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
                        projectDirPath = "";
index 1d39bb3b70ecbf95b59e45af2b0cba1e43198583..f1e0959e0c3e7de76d25e02bfce6a06e3de2637b 100644 (file)
@@ -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