mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-02 07:41:38 +00:00
[CFLAA] Move FunctionHandle to llvm::cflaa.
Also, while here, remove an unneeded `using namespace llvm`. Thanks to George for the suggestion. llvm-svn: 306355
This commit is contained in:
parent
d5e4c1ecf6
commit
60a4b37e86
@ -18,7 +18,8 @@
|
|||||||
#include "llvm/IR/Function.h"
|
#include "llvm/IR/Function.h"
|
||||||
#include "llvm/IR/ValueHandle.h"
|
#include "llvm/IR/ValueHandle.h"
|
||||||
|
|
||||||
using namespace llvm;
|
namespace llvm {
|
||||||
|
namespace cflaa {
|
||||||
|
|
||||||
template <typename AAResult> struct FunctionHandle final : public CallbackVH {
|
template <typename AAResult> struct FunctionHandle final : public CallbackVH {
|
||||||
FunctionHandle(Function *Fn, AAResult *Result)
|
FunctionHandle(Function *Fn, AAResult *Result)
|
||||||
@ -41,8 +42,6 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace llvm {
|
|
||||||
namespace cflaa {
|
|
||||||
static inline const Function *parentFunctionOfValue(const Value *Val) {
|
static inline const Function *parentFunctionOfValue(const Value *Val) {
|
||||||
if (auto *Inst = dyn_cast<Instruction>(Val)) {
|
if (auto *Inst = dyn_cast<Instruction>(Val)) {
|
||||||
auto *Bb = Inst->getParent();
|
auto *Bb = Inst->getParent();
|
||||||
|
@ -76,7 +76,7 @@ private:
|
|||||||
/// that simply has empty sets.
|
/// that simply has empty sets.
|
||||||
DenseMap<const Function *, Optional<FunctionInfo>> Cache;
|
DenseMap<const Function *, Optional<FunctionInfo>> Cache;
|
||||||
|
|
||||||
std::forward_list<FunctionHandle<CFLAndersAAResult>> Handles;
|
std::forward_list<cflaa::FunctionHandle<CFLAndersAAResult>> Handles;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Analysis pass providing a never-invalidated alias analysis result.
|
/// Analysis pass providing a never-invalidated alias analysis result.
|
||||||
|
@ -94,7 +94,7 @@ private:
|
|||||||
/// have any kind of recursion, it is discernable from a function
|
/// have any kind of recursion, it is discernable from a function
|
||||||
/// that simply has empty sets.
|
/// that simply has empty sets.
|
||||||
DenseMap<Function *, Optional<FunctionInfo>> Cache;
|
DenseMap<Function *, Optional<FunctionInfo>> Cache;
|
||||||
std::forward_list<FunctionHandle<CFLSteensAAResult>> Handles;
|
std::forward_list<cflaa::FunctionHandle<CFLSteensAAResult>> Handles;
|
||||||
|
|
||||||
FunctionInfo buildSetsFrom(Function *F);
|
FunctionInfo buildSetsFrom(Function *F);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user