-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLLVMTutorial.h
More file actions
41 lines (31 loc) · 1.2 KB
/
LLVMTutorial.h
File metadata and controls
41 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===- LLVMTutorial.h - Skeleton code for LLVM Tutorial ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides skeleton code for a transformation that adds calls to
// every memory access operation and every branch.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TRANSFORMS_UTILS_LLVMTUTORIAL_H
#define LLVM_TRANSFORMS_UTILS_LLVMTUTORIAL_H
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Instructions.h"
namespace llvm {
class LLVMTutorialPass : public PassInfoMixin<LLVMTutorialPass> {
public:
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
StringRef getPassName() const { return "LLVM Tutorial Pass"; }
private:
// Declare a callee that will check memory.
FunctionCallee checkMemoryFn;
// Methods for transforming difference instructions
void visitLoadInst(LoadInst *LI);
void visitStoreInst(StoreInst *SI);
};
} // namespace llvm
#endif // LLVM_TRANSFORMS_UTILS_LLVMTUTORIAL_H