mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user