aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/ProgramPoint.h
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-07-20 06:22:24 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-07-20 06:22:24 +0000
commit03509aea098772644bf4662dc1c88634818ceecc (patch)
tree9fafa05e7dc279d507f4886f9abf8f25a88b87c8 /include/clang/Analysis/ProgramPoint.h
parent8111a6150cb68a238d55a31f9f4f90869a43f988 (diff)
Constify all references to Stmt* and CFGBlock* in libChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r--include/clang/Analysis/ProgramPoint.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h
index 24bbf22640..08e08f2ad0 100644
--- a/include/clang/Analysis/ProgramPoint.h
+++ b/include/clang/Analysis/ProgramPoint.h
@@ -109,16 +109,16 @@ public:
const void *tag = 0)
: ProgramPoint(B, BlockEntranceKind, L, tag) {}
- CFGBlock* getBlock() const {
- return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
+ const CFGBlock* getBlock() const {
+ return reinterpret_cast<const CFGBlock*>(getData1());
}
- CFGElement getFirstElement() const {
+ const CFGElement getFirstElement() const {
const CFGBlock* B = getBlock();
return B->empty() ? CFGElement() : B->front();
}
- Stmt *getFirstStmt() const {
+ const Stmt *getFirstStmt() const {
return getFirstElement().getStmt();
}
@@ -132,16 +132,16 @@ public:
BlockExit(const CFGBlock* B, const LocationContext *L)
: ProgramPoint(B, BlockExitKind, L) {}
- CFGBlock* getBlock() const {
- return const_cast<CFGBlock*>(reinterpret_cast<const CFGBlock*>(getData1()));
+ const CFGBlock* getBlock() const {
+ return reinterpret_cast<const CFGBlock*>(getData1());
}
- Stmt* getLastStmt() const {
+ const Stmt* getLastStmt() const {
const CFGBlock* B = getBlock();
return B->empty() ? CFGElement() : B->back();
}
- Stmt* getTerminator() const {
+ const Stmt* getTerminator() const {
return getBlock()->getTerminator();
}
@@ -300,12 +300,12 @@ public:
BlockEdge(const CFGBlock* B1, const CFGBlock* B2, const LocationContext *L)
: ProgramPoint(B1, B2, BlockEdgeKind, L) {}
- CFGBlock* getSrc() const {
- return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData1()));
+ const CFGBlock* getSrc() const {
+ return static_cast<const CFGBlock*>(getData1());
}
- CFGBlock* getDst() const {
- return const_cast<CFGBlock*>(static_cast<const CFGBlock*>(getData2()));
+ const CFGBlock* getDst() const {
+ return static_cast<const CFGBlock*>(getData2());
}
static bool classof(const ProgramPoint* Location) {