clang  6.0.0svn
SanitizerMetadata.h
Go to the documentation of this file.
1 //===--- 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 LLVM_CLANG_LIB_CODEGEN_SANITIZERMETADATA_H
14 #define LLVM_CLANG_LIB_CODEGEN_SANITIZERMETADATA_H
15 
16 #include "clang/AST/Type.h"
17 #include "clang/Basic/LLVM.h"
19 
20 namespace llvm {
21 class GlobalVariable;
22 class Instruction;
23 class MDNode;
24 }
25 
26 namespace clang {
27 class VarDecl;
28 
29 namespace CodeGen {
30 
31 class CodeGenModule;
32 
34  SanitizerMetadata(const SanitizerMetadata &) = delete;
35  void operator=(const SanitizerMetadata &) = delete;
36 
37  CodeGenModule &CGM;
38 public:
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);
47 private:
48  llvm::MDNode *getLocationMetadata(SourceLocation Loc);
49 };
50 } // end namespace CodeGen
51 } // end namespace clang
52 
53 #endif
A (possibly-)qualified type.
Definition: Type.h:614
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Definition: Dominators.h:26
C Language Family Type Representation.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Definition: Decl.h:771
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Encodes a location in the source.
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
Defines the clang::SourceLocation class and associated facilities.