mirror of
https://github.com/Cobalt-Strike/obfuscator-llvm
synced 2026-06-08 10:40:11 +00:00
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
//===- FlatteningIncludes.h - Flattening Obfuscation pass------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains includes and defines for the split basicblock pass
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef _SPLIT_INCLUDES_
|
|
#define _SPLIT_INCLUDES_
|
|
|
|
// LLVM include
|
|
#include "utils/Utils.h"
|
|
#include "llvm/ADT/Statistic.h"
|
|
#include "llvm/IR/BasicBlock.h"
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/Pass.h"
|
|
#include "llvm/Support/CommandLine.h"
|
|
#include "llvm/Transforms/IPO.h"
|
|
#include "llvm/Transforms/Scalar.h"
|
|
#include "llvm/Transforms/Utils/Local.h" // For DemoteRegToStack and DemotePHIToStack
|
|
|
|
// Namespace
|
|
namespace llvm {
|
|
struct SplitBasicBlock {
|
|
bool flag;
|
|
|
|
SplitBasicBlock() {}
|
|
|
|
bool runSplitBasicBlock(Function &F);
|
|
void split(Function *f);
|
|
|
|
bool containsPHI(BasicBlock *b);
|
|
void shuffle(std::vector<int> &vec);
|
|
};
|
|
|
|
struct SplitBasicBlockPass : public PassInfoMixin<SplitBasicBlockPass>,
|
|
public SplitBasicBlock {
|
|
SplitBasicBlockPass();
|
|
static bool isRequired();
|
|
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
|
|
};
|
|
} // namespace llvm
|
|
#endif
|