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:
Alessandro Di Federico
2018-08-17 21:14:04 +02:00
parent 2d23bb525b
commit b4b0b7bce9
2 changed files with 37 additions and 0 deletions
+4
View File
@@ -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();