[ASan] Support comments in ASan/TSan blacklist file as lines starting with #
authorAlexey Samsonov <samsonov@google.com>
Fri, 19 Oct 2012 15:24:46 +0000 (15:24 +0000)
committerAlexey Samsonov <samsonov@google.com>
Fri, 19 Oct 2012 15:24:46 +0000 (15:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166283 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/BlackList.cpp
lib/Transforms/Instrumentation/BlackList.h

index 2cb119964a3d28cf9c42c85331e8e2111ea5bc69..ef34b8a56d88e0e7485f466328bd93241ffc6d85 100644 (file)
@@ -45,6 +45,9 @@ BlackList::BlackList(const StringRef Path) {
   StringMap<std::string> Regexps;
   for (SmallVector<StringRef, 16>::iterator I = Lines.begin(), E = Lines.end();
        I != E; ++I) {
+    // Ignore empty lines and lines starting with "#"
+    if (I->empty() || I->startswith("#"))
+      continue;
     // Get our prefix and unparsed regexp.
     std::pair<StringRef, StringRef> SplitLine = I->split(":");
     StringRef Prefix = SplitLine.first;
index 73977fc10a641cfad3c1c0ae1382cd42c0a010ba..f3c05a5058cc952622dfa7f2d05f55ce0dd03fb7 100644 (file)
@@ -12,7 +12,9 @@
 //
 // The blacklist disables instrumentation of various functions and global
 // variables.  Each line contains a prefix, followed by a wild card expression.
+// Empty lines and lines starting with "#" are ignored.
 // ---
+// # Blacklisted items:
 // fun:*_ZN4base6subtle*
 // global:*global_with_bad_access_or_initialization*
 // global-init:*global_with_initialization_issues*