Instrumenting C/C++ code using LLVM
问题 I want to write a LLVM pass to instrument every memory access. Here is what I am trying to do. Given any C/C++ program (like the one given below), I am trying to insert calls to some function, before and after every instruction that reads/writes to/from memory. For example consider the below C++ program (Account.cpp) #include <stdio.h> class Account { int balance; public: Account(int b) { balance = b; } ~Account(){ } int read() { int r; r = balance; return r; } void deposit(int n) { balance =