summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ProgramPoint.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-16 18:44:52 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-16 18:44:52 +0000
commit0ecb53a421da0750ad289674812ac676fc7664bc (patch)
tree825516f5986af87de4492b923a39e91a53c8fb4e /clang/lib/Analysis/ProgramPoint.cpp
parent7c5dbd95e21b406ee08b41356d53b939e3360464 (diff)
downloadbcm5719-llvm-0ecb53a421da0750ad289674812ac676fc7664bc.tar.gz
bcm5719-llvm-0ecb53a421da0750ad289674812ac676fc7664bc.zip
ProgramPoint now takes the space of two pointers instead of one. This change was
motivated because it became clear that the number of subclasses of ProgramPoint would expand and we ran out of bits to represent a pointer variant. As a plus of this change, BlockEdge program points can now be represented explicitly without using a cache of CFGBlock* pairs in CFG. llvm-svn: 56245
Diffstat (limited to 'clang/lib/Analysis/ProgramPoint.cpp')
-rw-r--r--clang/lib/Analysis/ProgramPoint.cpp64
1 files changed, 0 insertions, 64 deletions
diff --git a/clang/lib/Analysis/ProgramPoint.cpp b/clang/lib/Analysis/ProgramPoint.cpp
deleted file mode 100644
index d95680ff389..00000000000
--- a/clang/lib/Analysis/ProgramPoint.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//= ProgramPoint.cpp - Program Points for Path-Sensitive Analysis --*- C++ -*-//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements methods for subclasses of ProgramPoint.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/AST/CFG.h"
-#include "clang/Analysis/ProgramPoint.h"
-
-using namespace clang;
-
-BlockEdge::BlockEdge(CFG& cfg, const CFGBlock* B1, const CFGBlock* B2) {
- if (B1->succ_size() == 1) {
- assert (*(B1->succ_begin()) == B2);
- setRawData(B1, BlockEdgeSrcKind);
- }
- else if (B2->pred_size() == 1) {
- assert (*(B2->pred_begin()) == B1);
- setRawData(B2, BlockEdgeDstKind);
- }
- else
- setRawData(cfg.getBlockEdgeImpl(B1,B2), BlockEdgeAuxKind);
-}
-
-CFGBlock* BlockEdge::getSrc() const {
- switch (getKind()) {
- default:
- assert (false && "Invalid BlockEdgeKind.");
- return NULL;
-
- case BlockEdgeSrcKind:
- return reinterpret_cast<CFGBlock*>(getRawPtr());
-
- case BlockEdgeDstKind:
- return *(reinterpret_cast<CFGBlock*>(getRawPtr())->pred_begin());
-
- case BlockEdgeAuxKind:
- return reinterpret_cast<BPair*>(getRawPtr())->first;
- }
-}
-
-CFGBlock* BlockEdge::getDst() const {
- switch (getKind()) {
- default:
- assert (false && "Invalid BlockEdgeKind.");
- return NULL;
-
- case BlockEdgeSrcKind:
- return *(reinterpret_cast<CFGBlock*>(getRawPtr())->succ_begin());
-
- case BlockEdgeDstKind:
- return reinterpret_cast<CFGBlock*>(getRawPtr());
-
- case BlockEdgeAuxKind:
- return reinterpret_cast<BPair*>(getRawPtr())->second;
- }
-}
OpenPOWER on IntegriCloud