mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user