summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/AliasAnalysis.cpp4
-rw-r--r--lib/Analysis/CaptureTracking.cpp10
-rw-r--r--lib/Transforms/IPO/FunctionAttrs.cpp2
-rw-r--r--lib/Transforms/Scalar/TailRecursionElimination.cpp4
4 files changed, 10 insertions, 10 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 8f2ddb5507..36ed40d354 100644
--- a/lib/Analysis/AliasAnalysis.cpp
+++ b/lib/Analysis/AliasAnalysis.cpp
@@ -372,7 +372,7 @@ namespace {
void tooManyUses() override { Captured = true; }
- bool shouldExplore(Use *U) override {
+ bool shouldExplore(const Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// We explore this usage only if the usage can reach "BeforeHere".
@@ -388,7 +388,7 @@ namespace {
return true;
}
- bool captured(Use *U) override {
+ bool captured(const Use *U) override {
Instruction *I = cast<Instruction>(U->getUser());
BasicBlock *BB = I->getParent();
// Same logic as in shouldExplore.
diff --git a/lib/Analysis/CaptureTracking.cpp b/lib/Analysis/CaptureTracking.cpp
index 1e864b2954..60978470d2 100644
--- a/lib/Analysis/CaptureTracking.cpp
+++ b/lib/Analysis/CaptureTracking.cpp
@@ -28,7 +28,7 @@ using namespace llvm;
CaptureTracker::~CaptureTracker() {}
-bool CaptureTracker::shouldExplore(Use *U) { return true; }
+bool CaptureTracker::shouldExplore(const Use *U) { return true; }
namespace {
struct SimpleCaptureTracker : public CaptureTracker {
@@ -37,7 +37,7 @@ namespace {
void tooManyUses() override { Captured = true; }
- bool captured(Use *U) override {
+ bool captured(const Use *U) override {
if (isa<ReturnInst>(U->getUser()) && !ReturnCaptures)
return false;
@@ -81,8 +81,8 @@ static int const Threshold = 20;
void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) {
assert(V->getType()->isPointerTy() && "Capture is for pointers only!");
- SmallVector<Use*, Threshold> Worklist;
- SmallSet<Use*, Threshold> Visited;
+ SmallVector<const Use *, Threshold> Worklist;
+ SmallSet<const Use *, Threshold> Visited;
int Count = 0;
for (Value::const_use_iterator UI = V->use_begin(), UE = V->use_end();
@@ -99,7 +99,7 @@ void llvm::PointerMayBeCaptured(const Value *V, CaptureTracker *Tracker) {
}
while (!Worklist.empty()) {
- Use *U = Worklist.pop_back_val();
+ const Use *U = Worklist.pop_back_val();
Instruction *I = cast<Instruction>(U->getUser());
V = U->get();
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp
index 68eca52991..cb565d0814 100644
--- a/lib/Transforms/IPO/FunctionAttrs.cpp
+++ b/lib/Transforms/IPO/FunctionAttrs.cpp
@@ -344,7 +344,7 @@ namespace {
void tooManyUses() override { Captured = true; }
- bool captured(Use *U) override {
+ bool captured(const Use *U) override {
CallSite CS(U->getUser());
if (!CS.getInstruction()) { Captured = true; return true; }
diff --git a/lib/Transforms/Scalar/TailRecursionElimination.cpp b/lib/Transforms/Scalar/TailRecursionElimination.cpp
index fad4e0a6a3..bf49f814f6 100644
--- a/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -151,14 +151,14 @@ struct AllocaCaptureTracker : public CaptureTracker {
void tooManyUses() override { Captured = true; }
- bool shouldExplore(Use *U) override {
+ bool shouldExplore(const Use *U) override {
Value *V = U->getUser();
if (isa<CallInst>(V) || isa<InvokeInst>(V))
UsesAlloca.insert(V);
return true;
}
- bool captured(Use *U) override {
+ bool captured(const Use *U) override {
if (isa<ReturnInst>(U->getUser()))
return false;
Captured = true;