mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
a65ccc3413
`ValueMaterializer` is a rewrite of what was called `AdvancedValueInfo` which follows the same principles. The main benefits over the old version is: * We materialize the data-flow graph and the CFG of the relevant part of root. This makes debugging significantly easier. * We drop the old MonotoneFramework infrastructure in favor of getMaximalFixedPoint. * We significantly reduce the amount of queries we make to AdvancedValueInfo.
29 lines
618 B
C++
29 lines
618 B
C++
#pragma once
|
|
|
|
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
#include "llvm/IR/Instructions.h"
|
|
|
|
#include "revng/Support/Debug.h"
|
|
#include "revng/Support/IRHelpers.h"
|
|
|
|
namespace llvm {
|
|
class APInt;
|
|
}
|
|
|
|
inline Logger<> ValueMaterializerLogger("value-materializer");
|
|
|
|
std::string aviFormatter(const llvm::APInt &Value);
|
|
|
|
inline bool isPhiLike(llvm::Value *V) {
|
|
return (llvm::isa<llvm::PHINode>(V) or llvm::isa<llvm::SelectInst>(V));
|
|
}
|
|
|
|
inline bool isMemory(llvm::Value *V) {
|
|
using namespace llvm;
|
|
V = skipCasts(V);
|
|
return not(isa<GlobalVariable>(V) or isa<AllocaInst>(V));
|
|
}
|