File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 21
21
#include " swift/Basic/LLVM.h"
22
22
#include " swift/Basic/OptionSet.h"
23
23
#include " llvm/ADT/SmallVector.h"
24
- #include " llvm/ADT/StringMap.h"
25
24
#include " llvm/ADT/StringRef.h"
26
25
#include " llvm/ADT/StringSet.h"
27
26
#include " llvm/Support/Allocator.h"
@@ -65,6 +64,8 @@ namespace swift {
65
64
66
65
public:
67
66
StringRef copyString (StringRef string);
67
+
68
+ llvm::BumpPtrAllocator &getAllocator () { return Allocator; }
68
69
};
69
70
70
71
namespace camel_case {
@@ -430,11 +431,13 @@ StringRef matchLeadingTypeName(StringRef name, OmissionTypeName typeName);
430
431
// / Describes a set of names with an inheritance relationship.
431
432
class InheritedNameSet {
432
433
const InheritedNameSet *Parent;
433
- llvm::StringSet<> Names;
434
+ llvm::StringSet<llvm::BumpPtrAllocator & > Names;
434
435
435
436
public:
436
437
// / 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) { }
438
441
439
442
// Add a new name to the set.
440
443
void add (StringRef name);
Original file line number Diff line number Diff line change @@ -1842,10 +1842,10 @@ const InheritedNameSet *NameImporter::getAllPropertyNames(
1842
1842
}
1843
1843
1844
1844
// 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 ;
1849
1849
1850
1850
// Local function to add properties from the given set.
1851
1851
auto addProperties = [&](clang::DeclContext::decl_range members) {
You can’t perform that action at this time.
0 commit comments