mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-05 12:31:33 +00:00
TRE: Move class into anonymous namespace.
While there shrink a dangerously large SmallPtrSet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3a0a4d0c5c
commit
6a565e5be6
@ -145,19 +145,20 @@ static bool CanTRE(AllocaInst *AI) {
|
|||||||
isa<ConstantInt>(AI->getArraySize());
|
isa<ConstantInt>(AI->getArraySize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace {
|
||||||
struct AllocaCaptureTracker : public CaptureTracker {
|
struct AllocaCaptureTracker : public CaptureTracker {
|
||||||
AllocaCaptureTracker() : Captured(false) {}
|
AllocaCaptureTracker() : Captured(false) {}
|
||||||
|
|
||||||
void tooManyUses() { Captured = true; }
|
void tooManyUses() LLVM_OVERRIDE { Captured = true; }
|
||||||
|
|
||||||
bool shouldExplore(Use *U) {
|
bool shouldExplore(Use *U) LLVM_OVERRIDE {
|
||||||
Value *V = U->getUser();
|
Value *V = U->getUser();
|
||||||
if (isa<CallInst>(V) || isa<InvokeInst>(V))
|
if (isa<CallInst>(V) || isa<InvokeInst>(V))
|
||||||
UsesAlloca.insert(V);
|
UsesAlloca.insert(V);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool captured(Use *U) {
|
bool captured(Use *U) LLVM_OVERRIDE {
|
||||||
if (isa<ReturnInst>(U->getUser()))
|
if (isa<ReturnInst>(U->getUser()))
|
||||||
return false;
|
return false;
|
||||||
Captured = true;
|
Captured = true;
|
||||||
@ -165,8 +166,9 @@ struct AllocaCaptureTracker : public CaptureTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Captured;
|
bool Captured;
|
||||||
SmallPtrSet<const Value *, 64> UsesAlloca;
|
SmallPtrSet<const Value *, 16> UsesAlloca;
|
||||||
};
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
bool TailCallElim::runOnFunction(Function &F) {
|
bool TailCallElim::runOnFunction(Function &F) {
|
||||||
// If this function is a varargs function, we won't be able to PHI the args
|
// If this function is a varargs function, we won't be able to PHI the args
|
||||||
|
Loading…
Reference in New Issue
Block a user