#include "llvm/Transforms/Instrumentation/InstrOrderFile.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Instrumentation.h"
#include <fstream>
#include <mutex>
#include <sstream>
usingnamespacellvm;
#define DEBUG_TYPE …
static cl::opt<std::string> ClOrderFileWriteMapping(
"orderfile-write-mapping", cl::init(""),
cl::desc(
"Dump functions and their MD5 hash to deobfuscate profile data"),
cl::Hidden);
namespace {
std::mutex MappingMutex;
struct InstrOrderFile { … };
}
PreservedAnalyses
InstrOrderFilePass::run(Module &M, ModuleAnalysisManager &AM) { … }