[PATCH] D25857: [tsan][clang] Introduce a function attribute to disable TSan checking at run time
Dmitry Vyukov via cfe-commits
cfe-commits at lists.llvm.org
Sun Oct 30 18:51:48 PDT 2016
dvyukov added inline comments.
================
Comment at: lib/CodeGen/CodeGenFunction.cpp:717
+ // Ignore TSan memory acesses from within dealloc and all of its calees at
+ // run time.
----------------
This is unpleasant. We had recursive ignores in the old Valgrind-based tsan, but managed to not reintroduce them in the new tsan so far. But I also don't see any better solution.
================
Comment at: lib/CodeGen/CodeGenFunction.cpp:721
+ if (const auto *M = dyn_cast_or_null<ObjCMethodDecl>(D))
+ if (M->getMethodFamily() == OMF_dealloc)
+ Fn->addFnAttr("sanitize_thread_no_checking_at_run_time");
----------------
Can we do this check right in the tsan pass? Or this information is already lost there?
================
Comment at: lib/CodeGen/CodeGenFunction.cpp:722
+ if (M->getMethodFamily() == OMF_dealloc)
+ Fn->addFnAttr("sanitize_thread_no_checking_at_run_time");
+
----------------
Also do:
Fn->removeFnAttr(llvm::Attribute::SanitizeThread);
That's what will effectively happen. And it will allow to simplify the other patch.
https://reviews.llvm.org/D25857
More information about the cfe-commits
mailing list