summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Transforms/Instrumentation/FunctionBlackList.h
blob: c1239b9b7e0dc7c60d1fba0b1b096f036155b483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===-- FunctionBlackList.cpp - blacklist of functions ----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//===----------------------------------------------------------------------===//
//
// This is a utility class for instrumentation passes (like AddressSanitizer
// or ThreadSanitizer) to avoid instrumenting some functions based on
// user-supplied blacklist.
//
//===----------------------------------------------------------------------===//
//

#include <string>

namespace llvm {
class Function;
class Regex;

// Blacklisted functions are not instrumented.
// The blacklist file contains one or more lines like this:
// ---
// fun:FunctionWildCard
// ---
// This is similar to the "ignore" feature of ThreadSanitizer.
// http://code.google.com/p/data-race-test/wiki/ThreadSanitizerIgnores
class FunctionBlackList {
 public:
  FunctionBlackList(const std::string &Path);
  bool isIn(const Function &F);
 private:
  Regex *Functions;
};

}  // namespace llvm
OpenPOWER on IntegriCloud