Skip to content

Commit 61065f4

Browse files
authored
---
yaml --- r: 348893 b: refs/heads/master c: 5d817d9 h: refs/heads/master i: 348891: 19f6d74
1 parent 8115bed commit 61065f4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8f55e4274ff56710d6b4b8e74ee937f844e66d56
2+
refs/heads/master: 5d817d9d5886a3d0bcfebd9f150d3fc874439804
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/Basic/StringExtras.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "swift/Basic/LLVM.h"
2222
#include "swift/Basic/OptionSet.h"
2323
#include "llvm/ADT/SmallVector.h"
24-
#include "llvm/ADT/StringMap.h"
2524
#include "llvm/ADT/StringRef.h"
2625
#include "llvm/ADT/StringSet.h"
2726
#include "llvm/Support/Allocator.h"
@@ -65,6 +64,8 @@ namespace swift {
6564

6665
public:
6766
StringRef copyString(StringRef string);
67+
68+
llvm::BumpPtrAllocator &getAllocator() { return Allocator; }
6869
};
6970

7071
namespace camel_case {
@@ -430,11 +431,13 @@ StringRef matchLeadingTypeName(StringRef name, OmissionTypeName typeName);
430431
/// Describes a set of names with an inheritance relationship.
431432
class InheritedNameSet {
432433
const InheritedNameSet *Parent;
433-
llvm::StringSet<> Names;
434+
llvm::StringSet<llvm::BumpPtrAllocator &> Names;
434435

435436
public:
436437
/// Construct a new inherited name set with the given parent.
437-
explicit InheritedNameSet(const InheritedNameSet *parent) : Parent(parent) { }
438+
InheritedNameSet(const InheritedNameSet *parent,
439+
llvm::BumpPtrAllocator &allocator)
440+
: Parent(parent), Names(allocator) { }
438441

439442
// Add a new name to the set.
440443
void add(StringRef name);

trunk/lib/ClangImporter/ImportName.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,10 +1842,10 @@ const InheritedNameSet *NameImporter::getAllPropertyNames(
18421842
}
18431843

18441844
// Create the set of properties.
1845-
known = allProperties.insert(
1846-
{ std::pair<const clang::ObjCInterfaceDecl *, char>(classDecl,
1847-
forInstance),
1848-
llvm::make_unique<InheritedNameSet>(parentSet) }).first;
1845+
llvm::BumpPtrAllocator &alloc = scratch.getAllocator();
1846+
known = allProperties.insert({
1847+
std::pair<const clang::ObjCInterfaceDecl *, char>(classDecl, forInstance),
1848+
llvm::make_unique<InheritedNameSet>(parentSet, alloc) }).first;
18491849

18501850
// Local function to add properties from the given set.
18511851
auto addProperties = [&](clang::DeclContext::decl_range members) {

0 commit comments

Comments
 (0)