#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_TAINT_H
#define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_TAINT_H
#include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
namespace clang {
namespace ento {
namespace taint {
TaintTagType;
static constexpr TaintTagType TaintTagGeneric = …;
[[nodiscard]] ProgramStateRef addTaint(ProgramStateRef State, const Stmt *S,
const LocationContext *LCtx,
TaintTagType Kind = TaintTagGeneric);
[[nodiscard]] ProgramStateRef addTaint(ProgramStateRef State, SVal V,
TaintTagType Kind = TaintTagGeneric);
[[nodiscard]] ProgramStateRef addTaint(ProgramStateRef State, SymbolRef Sym,
TaintTagType Kind = TaintTagGeneric);
[[nodiscard]] ProgramStateRef addTaint(ProgramStateRef State,
const MemRegion *R,
TaintTagType Kind = TaintTagGeneric);
[[nodiscard]] ProgramStateRef removeTaint(ProgramStateRef State, SVal V);
[[nodiscard]] ProgramStateRef removeTaint(ProgramStateRef State,
const MemRegion *R);
[[nodiscard]] ProgramStateRef removeTaint(ProgramStateRef State, SymbolRef Sym);
[[nodiscard]] ProgramStateRef
addPartialTaint(ProgramStateRef State, SymbolRef ParentSym,
const SubRegion *SubRegion,
TaintTagType Kind = TaintTagGeneric);
bool isTainted(ProgramStateRef State, const Stmt *S,
const LocationContext *LCtx,
TaintTagType Kind = TaintTagGeneric);
bool isTainted(ProgramStateRef State, SVal V,
TaintTagType Kind = TaintTagGeneric);
bool isTainted(ProgramStateRef State, SymbolRef Sym,
TaintTagType Kind = TaintTagGeneric);
bool isTainted(ProgramStateRef State, const MemRegion *Reg,
TaintTagType Kind = TaintTagGeneric);
std::vector<SymbolRef> getTaintedSymbols(ProgramStateRef State, const Stmt *S,
const LocationContext *LCtx,
TaintTagType Kind = TaintTagGeneric);
std::vector<SymbolRef> getTaintedSymbols(ProgramStateRef State, SVal V,
TaintTagType Kind = TaintTagGeneric);
std::vector<SymbolRef> getTaintedSymbols(ProgramStateRef State, SymbolRef Sym,
TaintTagType Kind = TaintTagGeneric);
std::vector<SymbolRef> getTaintedSymbols(ProgramStateRef State,
const MemRegion *Reg,
TaintTagType Kind = TaintTagGeneric);
std::vector<SymbolRef> getTaintedSymbolsImpl(ProgramStateRef State,
const Stmt *S,
const LocationContext *LCtx,
TaintTagType Kind,
bool returnFirstOnly);
std::vector<SymbolRef> getTaintedSymbolsImpl(ProgramStateRef State, SVal V,
TaintTagType Kind,
bool returnFirstOnly);
std::vector<SymbolRef> getTaintedSymbolsImpl(ProgramStateRef State,
SymbolRef Sym, TaintTagType Kind,
bool returnFirstOnly);
std::vector<SymbolRef> getTaintedSymbolsImpl(ProgramStateRef State,
const MemRegion *Reg,
TaintTagType Kind,
bool returnFirstOnly);
void printTaint(ProgramStateRef State, raw_ostream &Out, const char *nl = "\n",
const char *sep = "");
LLVM_DUMP_METHOD void dumpTaint(ProgramStateRef State);
}
}
}
#endif