summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2002-11-06 17:17:55 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2002-11-06 17:17:55 +0000
commit075a8d7341b200bc9d87bec45b4e7818389c6451 (patch)
treea7fea7d6792af7a07a0666d2b1201c788b02f1b4
parente781ba560e349d590982771202d39b6364a95b8c (diff)
downloadbcm5719-llvm-075a8d7341b200bc9d87bec45b4e7818389c6451.tar.gz
bcm5719-llvm-075a8d7341b200bc9d87bec45b4e7818389c6451.zip
Make query operations non-const to allow demand-driven analyses.
llvm-svn: 4569
-rw-r--r--llvm/include/llvm/Analysis/AliasAnalysis.h10
-rw-r--r--llvm/include/llvm/Analysis/BasicAliasAnalysis.h6
-rw-r--r--llvm/lib/Analysis/AliasAnalysis.cpp10
3 files changed, 13 insertions, 13 deletions
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 64647887e51..322dd547016 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -34,22 +34,22 @@ struct AliasAnalysis {
/// other. This is the interface that must be implemented by specific alias
/// analysis implementations.
///
- virtual Result alias(const Value *V1, const Value *V2) const = 0;
+ virtual Result alias(const Value *V1, const Value *V2) = 0;
/// canCallModify - Return a Result that indicates whether the specified
/// function call can modify the memory location pointed to by Ptr.
///
- virtual Result canCallModify(const CallInst &CI, const Value *Ptr) const = 0;
+ virtual Result canCallModify(const CallInst &CI, const Value *Ptr) = 0;
/// canInvokeModify - Return a Result that indicates whether the specified
/// function invoke can modify the memory location pointed to by Ptr.
///
- virtual Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const=0;
+ virtual Result canInvokeModify(const InvokeInst &I, const Value *Ptr) = 0;
/// canBasicBlockModify - Return true if it is possible for execution of the
/// specified basic block to modify the value pointed to by Ptr.
///
- bool canBasicBlockModify(const BasicBlock &BB, const Value *Ptr) const;
+ bool canBasicBlockModify(const BasicBlock &BB, const Value *Ptr);
/// canInstructionRangeModify - Return true if it is possible for the
/// execution of the specified instructions to modify the value pointed to by
@@ -57,7 +57,7 @@ struct AliasAnalysis {
/// range of [I1,I2] INCLUSIVE. I1 and I2 must be in the same basic block.
///
bool canInstructionRangeModify(const Instruction &I1, const Instruction &I2,
- const Value *Ptr) const;
+ const Value *Ptr);
virtual ~AliasAnalysis(); // We want to be subclassed
};
diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
index f97cfbabd23..fc323dd9725 100644
--- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h
@@ -16,17 +16,17 @@ struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
// alias - This is the only method here that does anything interesting...
//
- Result alias(const Value *V1, const Value *V2) const;
+ Result alias(const Value *V1, const Value *V2);
/// canCallModify - We are not interprocedural, so we do nothing exciting.
///
- Result canCallModify(const CallInst &CI, const Value *Ptr) const {
+ Result canCallModify(const CallInst &CI, const Value *Ptr) {
return MayAlias;
}
/// canInvokeModify - We are not interprocedural, so we do nothing exciting.
///
- Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const {
+ Result canInvokeModify(const InvokeInst &I, const Value *Ptr) {
return MayAlias; // We are not interprocedural
}
};
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 641e22e9547..98577c8dc41 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -34,10 +34,10 @@ static RegisterAnalysisGroup<AliasAnalysis> X("Alias Analysis");
//
namespace {
struct CanModify : public InstVisitor<CanModify, bool> {
- const AliasAnalysis &AA;
+ AliasAnalysis &AA;
const Value *Ptr;
- CanModify(const AliasAnalysis *aa, const Value *ptr)
+ CanModify(AliasAnalysis *aa, const Value *ptr)
: AA(*aa), Ptr(ptr) {}
bool visitInvokeInst(InvokeInst &II) {
@@ -66,7 +66,7 @@ AliasAnalysis::~AliasAnalysis() {}
/// specified basic block to modify the value pointed to by Ptr.
///
bool AliasAnalysis::canBasicBlockModify(const BasicBlock &bb,
- const Value *Ptr) const {
+ const Value *Ptr) {
CanModify CM(this, Ptr);
BasicBlock &BB = const_cast<BasicBlock&>(bb);
@@ -84,7 +84,7 @@ bool AliasAnalysis::canBasicBlockModify(const BasicBlock &bb,
///
bool AliasAnalysis::canInstructionRangeModify(const Instruction &I1,
const Instruction &I2,
- const Value *Ptr) const {
+ const Value *Ptr) {
assert(I1.getParent() == I2.getParent() &&
"Instructions not in same basic block!");
CanModify CM(this, Ptr);
@@ -144,7 +144,7 @@ static const Value *getUnderlyingObject(const Value *V) {
// Hopefully we have a smart C++ compiler. :)
//
AliasAnalysis::Result BasicAliasAnalysis::alias(const Value *V1,
- const Value *V2) const {
+ const Value *V2) {
// Strip off constant pointer refs if they exist
if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V1))
V1 = CPR->getValue();
OpenPOWER on IntegriCloud