blob: 3062b4a62ed86f683fcf0e4582953b4ea7393699 [file] [log] [blame]
Alexey Samsonov4b8de112014-08-01 21:35:28 +00001//===--- SanitizerMetadata.h - Metadata for sanitizers ----------*- 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// Class which emits metadata consumed by sanitizer instrumentation passes.
11//
12//===----------------------------------------------------------------------===//
13#ifndef CLANG_CODEGEN_SANITIZERMETADATA_H
14#define CLANG_CODEGEN_SANITIZERMETADATA_H
15
16#include "clang/Basic/LLVM.h"
17#include "clang/Basic/SourceLocation.h"
18
19namespace llvm {
20class GlobalVariable;
21}
22
23namespace clang {
24class VarDecl;
25
26namespace CodeGen {
27
28class CodeGenModule;
29
30class SanitizerMetadata {
31 SanitizerMetadata(const SanitizerMetadata &) LLVM_DELETED_FUNCTION;
32 void operator=(const SanitizerMetadata &) LLVM_DELETED_FUNCTION;
33
34 CodeGenModule &CGM;
35public:
36 SanitizerMetadata(CodeGenModule &CGM);
37 void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
38 bool IsDynInit = false);
39 void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
40 StringRef Name, bool IsDynInit = false,
41 bool IsBlacklisted = false);
42 void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
43};
44} // end namespace CodeGen
45} // end namespace clang
46
47#endif