SIL: some improvements to the BasicBlockBitfield utilities

* add a BasicBlockSetVector class
* add a second argument to BasicBlockFlag::set, for the set value.
* rename BasicBlockSet::remove -> BasicBlockSet::erase.
* add a MaxBitfieldID statistics value in SILFunction.cpp
This commit is contained in:
Erik Eckstein
2021-01-25 13:11:33 +01:00
parent ddd0f4d3a9
commit 2f890dcbbf
4 changed files with 72 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
@@ -25,8 +25,13 @@ struct SILFunction {
};
struct SILBasicBlock {
SILFunction *function;
uint32_t customBits = 0;
uint64_t lastInitializedBitfieldID = 0;
SILBasicBlock(SILFunction *function): function(function) {}
SILFunction *getParent() const { return function; }
};
}
@@ -41,7 +46,7 @@ namespace {
TEST(SILBitfieldTest, Basic) {
SILFunction f;
SILBasicBlock b;
SILBasicBlock b(&f);
{
BasicBlockFlag A(&f);