]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h
MFC r244628:
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / StaticAnalyzer / Core / PathSensitive / TaintManager.h
1 //== TaintManager.h - Managing taint --------------------------- -*- C++ -*--=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //  This file provides APIs for adding, removing, querying symbol taint.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CLANG_TAINTMANAGER_H
15 #define LLVM_CLANG_TAINTMANAGER_H
16
17 #include "clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h"
18
19 namespace clang {
20 namespace ento {
21
22 /// The GDM component containing the tainted root symbols. We lazily infer the
23 /// taint of the dependent symbols. Currently, this is a map from a symbol to
24 /// tag kind. TODO: Should support multiple tag kinds.
25 // FIXME: This does not use the nice trait macros because it must be accessible
26 // from multiple translation units.
27 struct TaintMap {};
28 typedef llvm::ImmutableMap<SymbolRef, TaintTagType> TaintMapImpl;
29 template<> struct ProgramStateTrait<TaintMap>
30     :  public ProgramStatePartialTrait<TaintMapImpl> {
31   static void *GDMIndex() { static int index = 0; return &index; }
32 };
33
34 class TaintManager {
35
36   TaintManager() {}
37 };
38
39 }
40 }
41
42 #endif