@@ -52,15 +52,15 @@ static PreservedAnalyses rtsanPreservedCFGAnalyses() {
52
52
return PA;
53
53
}
54
54
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 ()));
58
58
59
59
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 );
62
62
63
- FunctionCallee Func = F .getParent ()->getOrInsertFunction (
63
+ FunctionCallee Func = Fn .getParent ()->getOrInsertFunction (
64
64
" __rtsan_notify_blocking_call" , FuncType);
65
65
66
66
Builder.CreateCall (Func, {NameArg});
@@ -69,16 +69,16 @@ static void insertNotifyBlockingCallAtFunctionEntryPoint(Function &F) {
69
69
RealtimeSanitizerPass::RealtimeSanitizerPass (
70
70
const RealtimeSanitizerOptions &Options) {}
71
71
72
- PreservedAnalyses RealtimeSanitizerPass::run (Function &F ,
72
+ PreservedAnalyses RealtimeSanitizerPass::run (Function &Fn ,
73
73
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" );
77
77
return rtsanPreservedCFGAnalyses ();
78
78
}
79
79
80
- if (F .hasFnAttribute (Attribute::SanitizeRealtimeUnsafe)) {
81
- insertNotifyBlockingCallAtFunctionEntryPoint (F );
80
+ if (Fn .hasFnAttribute (Attribute::SanitizeRealtimeUnsafe)) {
81
+ insertNotifyBlockingCallAtFunctionEntryPoint (Fn );
82
82
return rtsanPreservedCFGAnalyses ();
83
83
}
84
84
0 commit comments