Files
Mergen/lifter/core/OperandUtils.h
T
yusufcanislek 1ed00cc67e Refactor: reorganize lifter/ into subdirectories with PascalCase naming
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.
2026-03-06 18:07:26 +03:00

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;
}