|
LLVM 24.0.0git
|
#include "BPF.h"#include "llvm/ADT/MapVector.h"#include "llvm/ADT/SetVector.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DiagnosticInfo.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/InstIterator.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/Module.h"#include "llvm/Pass.h"#include "llvm/Transforms/Utils/ModuleUtils.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "bpf-func-table" |
Functions | |
| static bool | isInText (const Function &F) |
| The address of a function in another section is the address of a program, e.g. | |
| static bool | isCallbackUse (const Use &U, SmallPtrSetImpl< const User * > &Seen) |
| A callback: bpf_loop(), bpf_timer_set_callback() and co. | |
| static bool | isAddressUse (const Use &U) |
| The use is the address of the function as a value. | |
| static void | replaceAddress (Function &F, Constant *Index) |
| static bool | runFuncTable (Module &M) |
| INITIALIZE_PASS (BPFFuncTableLegacy, DEBUG_TYPE, "BPF Function Table", false, false) ModulePass *llvm | |
| #define DEBUG_TYPE "bpf-func-table" |
Definition at line 51 of file BPFFuncTable.cpp.
| INITIALIZE_PASS | ( | BPFFuncTableLegacy | , |
| DEBUG_TYPE | , | ||
| "BPF Function Table" | , | ||
| false | , | ||
| false | ) |
Definition at line 219 of file BPFFuncTable.cpp.
References llvm::createBPFFuncTablePass(), and DEBUG_TYPE.
The use is the address of the function as a value.
Definition at line 90 of file BPFFuncTable.cpp.
References llvm::dyn_cast(), llvm::isa(), and isCallbackUse().
Referenced by canFoldIVIncExpr(), replaceAddress(), and runFuncTable().
A callback: bpf_loop(), bpf_timer_set_callback() and co.
The kernel calls it and wants the function. A helper is a number, a kfunc a declaration.
Definition at line 71 of file BPFFuncTable.cpp.
References llvm::all_of(), llvm::dyn_cast(), F, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::isa(), and llvm::Value::uses().
Referenced by isAddressUse().
The address of a function in another section is the address of a program, e.g.
in struct_ops.
Definition at line 65 of file BPFFuncTable.cpp.
References F.
Referenced by runFuncTable().
Definition at line 102 of file BPFFuncTable.cpp.
References C(), llvm::dyn_cast(), F, llvm::isa(), isAddressUse(), and llvm::make_early_inc_range().
Referenced by runFuncTable().
Definition at line 119 of file BPFFuncTable.cpp.
References llvm::any_of(), llvm::appendToCompilerUsed(), llvm::appendToUsed(), B(), C(), Changed, llvm::collectUsedGlobalVariables(), DL, llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), F, llvm::First, llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantPointerNull::get(), llvm::ConstantExpr::getInBoundsPtrAdd(), llvm::Type::getInt64Ty(), llvm::ConstantExpr::getIntToPtr(), llvm::PointerType::getUnqual(), I, instructions, llvm::GlobalValue::InternalLinkage, llvm::IRBuilder(), llvm::isa(), isAddressUse(), isInText(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), replaceAddress(), llvm::Table, and uint64_t.
Referenced by llvm::BPFFuncTablePass::run().