mirror of
https://github.com/NaC-L/Mergen.git
synced 2026-05-12 09:40:34 +00:00
1ed00cc67e
Directory structure: lifter/core/ - LifterClass, pipeline, drivers, application, utils lifter/semantics/ - Semantics*.ipp, OperandUtils.ipp, opcodes lifter/disasm/ - Disassembler backends, mnemonic/register mappings lifter/memory/ - GEPTracker, MemoryPolicy, FileReader lifter/analysis/ - PathSolver, CustomPasses lifter/test/ - TestInstructions, Tester, test_vectors/ Naming convention standardized to PascalCase: fileReader.hpp -> FileReader.hpp lifterClass.hpp -> LifterClass.hpp icedDisassembler* -> IcedDisassembler* utils.h/cpp -> Utils.h/cpp includes.h -> Includes.h pp_macros.hpp -> PPMacros.hpp test_instructions* -> TestInstructions* tester.hpp -> Tester.hpp Include resolution uses cmake include-directories so no path prefixes needed in #include directives. All script paths updated for new test_vectors and opcodes locations.
21 lines
642 B
C
21 lines
642 B
C
#pragma once
|
|
#include <llvm/Analysis/InstSimplifyFolder.h>
|
|
#include <llvm/IR/Dominators.h>
|
|
#include <llvm/IR/IRBuilder.h>
|
|
#include <llvm/IR/Instruction.h>
|
|
#include <llvm/IR/Value.h>
|
|
|
|
inline bool comesBefore(llvm::Instruction* a, llvm::Instruction* b,
|
|
llvm::DominatorTree& DT) {
|
|
|
|
bool sameBlock =
|
|
a->getParent() == b->getParent(); // if same block, use ->comesBefore,
|
|
|
|
if (sameBlock) {
|
|
return a->comesBefore(b); // if a comes before b, return true
|
|
}
|
|
// if "a"'s block dominates "b"'s block, "a" comes first.
|
|
bool dominate = DT.properlyDominates(a->getParent(), b->getParent());
|
|
return dominate;
|
|
}
|