Skip to content

Commit

Permalink
[rtsan] Update notify function name in blocking Pass
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtrevelyan committed Sep 21, 2024
1 parent b354df2 commit 80c897e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Instrumentation/RealtimeSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static PreservedAnalyses rtsanPreservedCFGAnalyses() {
return PA;
}

static void insertExpectNotRealtimeAtFunctionEntryPoint(Function &F) {
static void insertNotifyBlockingCallAtFunctionEntryPoint(Function &F) {
IRBuilder<> Builder(&F.front().front());
Value *NameArg = Builder.CreateGlobalString(demangle(F.getName()));

Expand All @@ -61,7 +61,7 @@ static void insertExpectNotRealtimeAtFunctionEntryPoint(Function &F) {
{PointerType::getUnqual(F.getContext())}, false);

FunctionCallee Func = F.getParent()->getOrInsertFunction(
"__rtsan_expect_not_realtime", FuncType);
"__rtsan_notify_blocking_call", FuncType);

Builder.CreateCall(Func, {NameArg});
}
Expand All @@ -78,7 +78,7 @@ PreservedAnalyses RealtimeSanitizerPass::run(Function &F,
}

if (F.hasFnAttribute(Attribute::SanitizeRealtimeUnsafe)) {
insertExpectNotRealtimeAtFunctionEntryPoint(F);
insertNotifyBlockingCallAtFunctionEntryPoint(F);
return rtsanPreservedCFGAnalyses();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ attributes #0 = { mustprogress noinline sanitize_realtime_unsafe optnone ssp uwt
; CHECK: [[GLOBAL_STR:@[a-zA-Z0-9\.]+]]
; CHECK-SAME: c"blocking_function()\00"
; CHECK-LABEL: @_Z17blocking_functionv()
; CHECK-NEXT: call{{.*}}@__rtsan_expect_not_realtime(ptr{{.*}}[[GLOBAL_STR]])
; CHECK-NEXT: call{{.*}}@__rtsan_notify_blocking_call(ptr{{.*}}[[GLOBAL_STR]])

0 comments on commit 80c897e

Please sign in to comment.