File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 23
23
24
24
namespace swift {
25
25
26
- enum class BlockListAction : uint8_t {
26
+ enum class BlockListAction : uint8_t {
27
27
ShouldUseBinaryModule = 0 ,
28
28
ShouldUseTextualModule,
29
29
};
@@ -38,10 +38,11 @@ class BlockListStore {
38
38
struct Implementation ;
39
39
bool hasBlockListAction (StringRef key, BlockListKeyKind keyKind,
40
40
BlockListAction action);
41
- void addConfigureFilePath (StringRef path);
42
41
BlockListStore ();
43
42
~BlockListStore ();
44
43
private:
44
+ friend class ASTContext ;
45
+ void addConfigureFilePath (StringRef path);
45
46
Implementation &Impl;
46
47
};
47
48
Original file line number Diff line number Diff line change 10
10
//
11
11
// ===----------------------------------------------------------------------===//
12
12
13
+ #include " llvm/ADT/STLExtras.h"
14
+ #include " llvm/ADT/StringSwitch.h"
15
+ #include " llvm/Support/YAMLParser.h"
16
+ #include " llvm/Support/YAMLTraits.h"
13
17
#include " swift/Basic/BlockList.h"
18
+ #include " swift/Basic/SourceManager.h"
14
19
15
20
struct swift ::BlockListStore::Implementation {
21
+ llvm::StringMap<std::vector<BlockListAction>> ModuleActionDict;
22
+ llvm::StringMap<std::vector<BlockListAction>> ProjectActionDict;
16
23
void addConfigureFilePath (StringRef path);
17
24
bool hasBlockListAction (StringRef key, BlockListKeyKind keyKind,
18
25
BlockListAction action);
@@ -33,7 +40,12 @@ void swift::BlockListStore::addConfigureFilePath(StringRef path) {
33
40
34
41
bool swift::BlockListStore::Implementation::hasBlockListAction (StringRef key,
35
42
BlockListKeyKind keyKind, BlockListAction action) {
36
- return false ;
43
+ auto *dict = keyKind == BlockListKeyKind::ModuleName ? &ModuleActionDict :
44
+ &ProjectActionDict;
45
+ auto it = dict->find (key);
46
+ if (it == dict->end ())
47
+ return false ;
48
+ return llvm::is_contained (it->second , action);
37
49
}
38
50
39
51
void swift::BlockListStore::Implementation::addConfigureFilePath (StringRef path) {
You can’t perform that action at this time.
0 commit comments