Skip to content

Commit e8dad4c

Browse files
[rtsan][NFC] Update test comment and variable names
1 parent c3dd787 commit e8dad4c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

llvm/lib/Transforms/Instrumentation/RealtimeSanitizer.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ static PreservedAnalyses rtsanPreservedCFGAnalyses() {
5252
return PA;
5353
}
5454

55-
static void insertNotifyBlockingCallAtFunctionEntryPoint(Function &F) {
56-
IRBuilder<> Builder(&F.front().front());
57-
Value *NameArg = Builder.CreateGlobalString(demangle(F.getName()));
55+
static void insertNotifyBlockingCallAtFunctionEntryPoint(Function &Fn) {
56+
IRBuilder<> Builder(&Fn.front().front());
57+
Value *NameArg = Builder.CreateGlobalString(demangle(Fn.getName()));
5858

5959
FunctionType *FuncType =
60-
FunctionType::get(Type::getVoidTy(F.getContext()),
61-
{PointerType::getUnqual(F.getContext())}, false);
60+
FunctionType::get(Type::getVoidTy(Fn.getContext()),
61+
{PointerType::getUnqual(Fn.getContext())}, false);
6262

63-
FunctionCallee Func = F.getParent()->getOrInsertFunction(
63+
FunctionCallee Func = Fn.getParent()->getOrInsertFunction(
6464
"__rtsan_notify_blocking_call", FuncType);
6565

6666
Builder.CreateCall(Func, {NameArg});
@@ -69,16 +69,16 @@ static void insertNotifyBlockingCallAtFunctionEntryPoint(Function &F) {
6969
RealtimeSanitizerPass::RealtimeSanitizerPass(
7070
const RealtimeSanitizerOptions &Options) {}
7171

72-
PreservedAnalyses RealtimeSanitizerPass::run(Function &F,
72+
PreservedAnalyses RealtimeSanitizerPass::run(Function &Fn,
7373
AnalysisManager<Function> &AM) {
74-
if (F.hasFnAttribute(Attribute::SanitizeRealtime)) {
75-
insertCallAtFunctionEntryPoint(F, "__rtsan_realtime_enter");
76-
insertCallAtAllFunctionExitPoints(F, "__rtsan_realtime_exit");
74+
if (Fn.hasFnAttribute(Attribute::SanitizeRealtime)) {
75+
insertCallAtFunctionEntryPoint(Fn, "__rtsan_realtime_enter");
76+
insertCallAtAllFunctionExitPoints(Fn, "__rtsan_realtime_exit");
7777
return rtsanPreservedCFGAnalyses();
7878
}
7979

80-
if (F.hasFnAttribute(Attribute::SanitizeRealtimeUnsafe)) {
81-
insertNotifyBlockingCallAtFunctionEntryPoint(F);
80+
if (Fn.hasFnAttribute(Attribute::SanitizeRealtimeUnsafe)) {
81+
insertNotifyBlockingCallAtFunctionEntryPoint(Fn);
8282
return rtsanPreservedCFGAnalyses();
8383
}
8484

llvm/test/Instrumentation/RealtimeSanitizer/rtsan_unsafe.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ define noundef i32 @main() #2 {
1111

1212
attributes #0 = { mustprogress noinline sanitize_realtime_unsafe optnone ssp uwtable(sync) }
1313

14-
; RealtimeSanitizer pass should create the demangled function name as a global string, and
15-
; pass it as input to an inserted __rtsan_expect_not_realtime call at the function entrypoint
14+
; RealtimeSanitizer pass should create the demangled function name as a global string and,
15+
; at the function entrypoint, pass it as an argument to the rtsan notify method
1616
; CHECK: [[GLOBAL_STR:@[a-zA-Z0-9\.]+]]
1717
; CHECK-SAME: c"blocking_function()\00"
1818
; CHECK-LABEL: @_Z17blocking_functionv()

0 commit comments

Comments
 (0)