[PATCH] D26460: Tread TSan LLVM flags to driver: account for external flag values in TSan.

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 14:59:08 PST 2016


dvyukov added a comment.

> Could/should these be function attributes rather than pass arguments?

The use that we have for these flags is related to ignoring atomics in a huge source file, applying attributes to all functions in that file is impractical.
We have similar compiler flags for other sanitizers as well.
We could add attributes along with flags, but we don't have any uses for that at the moment.



================
Comment at: lib/Transforms/Instrumentation/ThreadSanitizer.cpp:85
 struct ThreadSanitizer : public FunctionPass {
-  ThreadSanitizer() : FunctionPass(ID) {}
+  ThreadSanitizer(bool DetectDataRaces = true,
+                  bool StackTraces = true,
----------------
Do we need default parameter values here? I would expect that not.


================
Comment at: lib/Transforms/Instrumentation/ThreadSanitizer.cpp:110
 
+  bool InstrumentMemoryAccess;
+  bool InstrumentFuncEntryExit;
----------------
I would make them const as they are initialized only in ctor and are not meant to change.


https://reviews.llvm.org/D26460





More information about the llvm-commits mailing list