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

@@ -10,6 +10,8 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "sil-function"
#include "swift/SIL/SILArgument.h"
#include "swift/SIL/SILBasicBlock.h"
#include "swift/SIL/SILFunction.h"
@@ -24,6 +26,7 @@
#include "swift/Basic/OptimizationMode.h"
#include "swift/Basic/Statistic.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/GraphWriter.h"
#include "clang/AST/Decl.h"
@@ -31,6 +34,8 @@
using namespace swift;
using namespace Lowering;
STATISTIC(MaxBitfieldID, "Max value of SILFunction::currentBitfieldID");
SILSpecializeAttr::SILSpecializeAttr(bool exported, SpecializationKind kind,
GenericSignature specializedSig,
SILFunction *target, Identifier spiGroup,
@@ -212,6 +217,8 @@ SILFunction::~SILFunction() {
"Function cannot be deleted while function_ref's still exist");
assert(!newestAliveBitfield &&
"Not all BasicBlockBitfields deleted at function destruction");
if (currentBitfieldID > MaxBitfieldID)
MaxBitfieldID = currentBitfieldID;
}
void SILFunction::createProfiler(ASTNode Root, SILDeclRef forDecl,