Skip to content

Commit 3aa4efb

Browse files
author
Steve Naroff
committed
Add ASTContext::StringMap<char> to unique selector names. llvm-svn: 41894
1 parent d831796 commit 3aa4efb

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

clang/clang.xcodeproj/project.pbxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@
675675
08FB7793FE84155DC02AAC07 /* Project object */ = {
676676
isa = PBXProject;
677677
buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "clang" */;
678-
compatibilityVersion = "Xcode 2.4";
679678
hasScannedForEncodings = 1;
680679
mainGroup = 08FB7794FE84155DC02AAC07 /* clang */;
681680
projectDirPath = "";

clang/include/clang/AST/ASTContext.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "clang/AST/RecordLayout.h"
2020
#include "clang/AST/Type.h"
2121
#include "llvm/ADT/DenseMap.h"
22+
#include "llvm/ADT/StringMap.h"
2223
#include <vector>
2324

2425
namespace clang {
@@ -37,6 +38,7 @@ class ASTContext {
3738
llvm::FoldingSet<FunctionTypeProto> FunctionTypeProtos;
3839
llvm::DenseMap<const RecordDecl*, const RecordLayout*> RecordLayoutInfo;
3940
RecordDecl *CFConstantStringTypeDecl;
41+
llvm::StringMap<char> SelectorNames;
4042
public:
4143
TargetInfo &Target;
4244
IdentifierTable &Idents;
@@ -174,6 +176,16 @@ class ASTContext {
174176
/// 'typeSize' is a real floating point or complex type.
175177
QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize,
176178
QualType typeDomain) const;
179+
180+
//===--------------------------------------------------------------------===//
181+
// Objective-C
182+
//===--------------------------------------------------------------------===//
183+
184+
/// getSelectorName - Return a uniqued character string for the selector.
185+
char &getSelectorName(const char *NameStart, const char *NameEnd) {
186+
return SelectorNames.GetOrCreateValue(NameStart, NameEnd).getValue();
187+
}
188+
177189
private:
178190
ASTContext(const ASTContext&); // DO NOT IMPLEMENT
179191
void operator=(const ASTContext&); // DO NOT IMPLEMENT

0 commit comments

Comments
 (0)