mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
FCI: API for fallthrough BasicBlocks
The `FunctionCallIdentification` pass now has an API to get the fallthrough basic block of a function call basic block and to check whether a certain basic block/address is the fallthrough of a function call.
This commit is contained in:
@@ -24,6 +24,8 @@ bool FunctionCallIdentification::runOnFunction(llvm::Function &F) {
|
||||
|
||||
auto &GCBI = getAnalysis<GeneratedCodeBasicInfo>();
|
||||
|
||||
FallthroughAddresses.clear();
|
||||
|
||||
// Create function call marker
|
||||
// TODO: we could factor this out
|
||||
Module *M = F.getParent();
|
||||
@@ -216,6 +218,8 @@ bool FunctionCallIdentification::runOnFunction(llvm::Function &F) {
|
||||
LinkRegister
|
||||
};
|
||||
|
||||
FallthroughAddresses.insert(ReturnPC);
|
||||
|
||||
// If the instruction before the terminator is a call to exitTB, inject
|
||||
// the call to function_call before it, so it doesn't get purged
|
||||
auto It = Terminator->getIterator();
|
||||
|
||||
Reference in New Issue
Block a user