[llvm] [BOLT] Fix runOnEachFunctionWithUniqueAllocId (PR #90039)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Wed May 1 13:20:31 PDT 2024
================
@@ -164,6 +164,15 @@ void runOnEachFunction(BinaryContext &BC, SchedulingPolicy SchedPolicy,
Pool.wait();
}
+static void EnsureAllocatorExists(BinaryContext &BC, unsigned AllocId) {
+ if (!BC.MIB->checkAllocatorExists(AllocId)) {
+ MCPlusBuilder::AllocatorIdTy Id =
+ BC.MIB->initializeNewAnnotationAllocator();
+ (void)Id;
+ assert(AllocId == Id && "unexpected allocator id created");
----------------
maksfb wrote:
nit:
```suggestion
assert(AllocId == Id && "Unexpected allocator id created");
```
https://github.com/llvm/llvm-project/pull/90039
More information about the llvm-commits
mailing list