1 //===--- SanitizerMetadata.h - Metadata for sanitizers ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Class which emits metadata consumed by sanitizer instrumentation passes.
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_CODEGEN_SANITIZERMETADATA_H
14 #define LLVM_CLANG_LIB_CODEGEN_SANITIZERMETADATA_H
16 #include "clang/AST/Type.h"
17 #include "clang/Basic/LLVM.h"
18 #include "clang/Basic/SourceLocation.h"
33 class SanitizerMetadata {
34 SanitizerMetadata(const SanitizerMetadata &) LLVM_DELETED_FUNCTION;
35 void operator=(const SanitizerMetadata &) LLVM_DELETED_FUNCTION;
39 SanitizerMetadata(CodeGenModule &CGM);
40 void reportGlobalToASan(llvm::GlobalVariable *GV, const VarDecl &D,
41 bool IsDynInit = false);
42 void reportGlobalToASan(llvm::GlobalVariable *GV, SourceLocation Loc,
43 StringRef Name, QualType Ty, bool IsDynInit = false,
44 bool IsBlacklisted = false);
45 void disableSanitizerForGlobal(llvm::GlobalVariable *GV);
46 void disableSanitizerForInstruction(llvm::Instruction *I);
48 llvm::MDNode *getLocationMetadata(SourceLocation Loc);
50 } // end namespace CodeGen
51 } // end namespace clang