Files
revng-revng/include/revng/EarlyFunctionAnalysis/CallHandler.h
Alessandro Di Federico 28a0fa5b7d DetectABI: run to fixed point and more
This commit switches the approach with which we run the ABI analyses: we
now run them until we reach a fixed point. This enables proper
interprocedural propagation of arguments and return values.

Basically, we now inject reads before call sites, so that, if a function
immediately calls another one, the arguments of the callee are
propagated to the caller.

This commit also updates the logic with which we propagate function
prototypes (and names) to callers. The main advantage of this, is that
function wrappers (in particular, PLT entries) now have the same name as
the function they wrap.
2023-12-12 10:05:22 +01:00

42 lines
1.1 KiB
C++

#pragma once
//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
#include <set>
#include "llvm/IR/IRBuilder.h"
#include "revng/Support/MetaAddress.h"
namespace efa {
class CallHandler {
public:
virtual ~CallHandler() {}
/// \note Implementers should not emit a terminator
virtual void
handleCall(MetaAddress CallerBlock,
llvm::IRBuilder<> &Builder,
MetaAddress Callee,
const std::set<llvm::GlobalVariable *> &ClobberedRegisters,
const std::optional<int64_t> &MaybeFSO,
bool IsNoReturn,
bool IsTailCall,
llvm::Value *SymbolNamePointer) = 0;
/// \note Implementers are responsible for terminator emissions
virtual void handlePostNoReturn(llvm::IRBuilder<> &Builder) = 0;
/// \note Implementers should not emit a terminator
virtual void
handleIndirectJump(llvm::IRBuilder<> &Builder,
MetaAddress Block,
const std::set<llvm::GlobalVariable *> &ClobberedRegisters,
llvm::Value *SymbolNamePointer) = 0;
};
} // namespace efa