================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:120
@@ +119,3 @@
+static cl::opt<bool> ClEnableKasan(
+    "enable-kasan", cl::desc("Enable KernelAddressSanitizer instrumentation"),
+    cl::Hidden, cl::init(false));
----------------
Um, `asan-kernel`? Looks like most of the flags in this file start with 
`asan-`, it makes sense to keep it.

================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:394
@@ -385,1 +393,3 @@
+      : FunctionPass(ID), CompileKernel(CompileKernel || ClEnableKasan),
+        AsanCtorFunction(NULL), AsanInitFunction(NULL) {
     initializeAddressSanitizerPass(*PassRegistry::getPassRegistry());
----------------
nullptr
You can also consider using brace-or-equal initializer here.

================
Comment at: tools/clang/include/clang/Basic/Sanitizers.h:56
@@ +55,3 @@
+  /// \brief Check if either ASan or KASan is enabled.
+  bool hasAsanOrKasan() const;
+
----------------
glider wrote:
> samsonov wrote:
> > Um, no, I mean to add `hasOneOf` method that would take ArrayRef of 
> > sanitizer kinds and return true iff at least one of them is enabled. Then 
> > you could call it as...
> This is basically the `has()` method without the `llvm::countPopulation(K) == 
> 1` check.
> Why not use a mask instead of an ArrayRef?
Yeah, using the mask is also ok. But let's make the name different, so that 
`has()` method would still always accept a single sanitizer.

http://reviews.llvm.org/D10411

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to