blob: 75f7fa0d3e2db7a1ecba7181d29dc80f685b3167 [file] [log] [blame]
Ted Kremenekd27f8162008-01-15 23:55:06 +00001//===-- GRConstants.cpp - Simple, Path-Sens. Constant Prop. ------*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Constant Propagation via Graph Reachability
11//
12// This files defines a simple analysis that performs path-sensitive
13// constant propagation within a function. An example use of this analysis
14// is to perform simple checks for NULL dereferences.
15//
16//===----------------------------------------------------------------------===//
17
18#include "clang/Analysis/PathSensitive/GREngine.h"
19#include "clang/AST/Expr.h"
20#include "clang/Analysis/Analyses/LiveVariables.h"
21#include "clang/Analysis/Visitors/CFGStmtVisitor.h"
22
23#include "llvm/Support/Casting.h"
24#include "llvm/Support/DataTypes.h"
25#include "llvm/ADT/APSInt.h"
26#include "llvm/ADT/FoldingSet.h"
27#include "llvm/ADT/ImmutableMap.h"
Ted Kremenek3c6c6722008-01-16 17:56:25 +000028#include "llvm/ADT/SmallVector.h"
Ted Kremenekd27f8162008-01-15 23:55:06 +000029#include "llvm/Support/Compiler.h"
30
Ted Kremenekaa66a322008-01-16 21:46:15 +000031#ifndef NDEBUG
32#include "llvm/Support/GraphWriter.h"
33#include <sstream>
34#endif
35
Ted Kremenekd27f8162008-01-15 23:55:06 +000036using namespace clang;
37using llvm::APInt;
38using llvm::APFloat;
39using llvm::dyn_cast;
40using llvm::cast;
41
42//===----------------------------------------------------------------------===//
Ted Kremenekaa66a322008-01-16 21:46:15 +000043/// DSPtr - A variant smart pointer that wraps either a ValueDecl* or a
Ted Kremenekd27f8162008-01-15 23:55:06 +000044/// Stmt*. Use cast<> or dyn_cast<> to get actual pointer type
45//===----------------------------------------------------------------------===//
46namespace {
Ted Kremenekcb448ca2008-01-16 00:53:15 +000047class VISIBILITY_HIDDEN DSPtr {
Ted Kremenek0525a4f2008-01-16 19:47:19 +000048 uintptr_t Raw;
Ted Kremenekd27f8162008-01-15 23:55:06 +000049public:
Ted Kremeneke3d7c242008-01-16 23:35:31 +000050 enum VariantKind { IsSubExp=0x0, IsValueDecl=0x1, IsBlkLvl=0x2, Flags=0x3 };
Ted Kremenekd27f8162008-01-15 23:55:06 +000051 inline void* getPtr() const { return reinterpret_cast<void*>(Raw & ~Flags); }
52 inline VariantKind getKind() const { return (VariantKind) (Raw & Flags); }
53
Ted Kremenekaa66a322008-01-16 21:46:15 +000054 DSPtr(ValueDecl* D) : Raw(reinterpret_cast<uintptr_t>(D) | IsValueDecl) {}
Ted Kremenekcb448ca2008-01-16 00:53:15 +000055 DSPtr(Stmt* S, bool isBlkLvl)
Ted Kremenekd27f8162008-01-15 23:55:06 +000056 : Raw(reinterpret_cast<uintptr_t>(S) | (isBlkLvl ? IsBlkLvl : IsSubExp)) {}
57
58 bool isSubExpr() const { return getKind() == IsSubExp; }
59
60 inline void Profile(llvm::FoldingSetNodeID& ID) const {
Ted Kremenek98491852008-01-16 05:51:13 +000061 ID.AddPointer(getPtr());
62 ID.AddInteger((unsigned) getKind());
Ted Kremenekd27f8162008-01-15 23:55:06 +000063 }
Ted Kremenekcb448ca2008-01-16 00:53:15 +000064 inline bool operator==(const DSPtr& X) const { return Raw == X.Raw; }
65 inline bool operator!=(const DSPtr& X) const { return Raw != X.Raw; }
Ted Kremenekb3d2dca2008-01-16 23:33:44 +000066 inline bool operator<(const DSPtr& X) const {
67 VariantKind k = getKind(), Xk = X.getKind();
Ted Kremeneke00fe3f2008-01-17 00:52:48 +000068 return k == Xk ? getPtr() < X.getPtr() : ((unsigned) k) < ((unsigned) Xk);
Ted Kremenekb3d2dca2008-01-16 23:33:44 +000069 }
Ted Kremenekd27f8162008-01-15 23:55:06 +000070};
71} // end anonymous namespace
72
Ted Kremenekcb448ca2008-01-16 00:53:15 +000073// Machinery to get cast<> and dyn_cast<> working with DSPtr.
Ted Kremenekd27f8162008-01-15 23:55:06 +000074namespace llvm {
Ted Kremenekaa66a322008-01-16 21:46:15 +000075 template<> inline bool isa<ValueDecl,DSPtr>(const DSPtr& V) {
76 return V.getKind() == DSPtr::IsValueDecl;
Ted Kremenekd27f8162008-01-15 23:55:06 +000077 }
Ted Kremenekcb448ca2008-01-16 00:53:15 +000078 template<> inline bool isa<Stmt,DSPtr>(const DSPtr& V) {
Ted Kremeneke00fe3f2008-01-17 00:52:48 +000079 return ((unsigned) V.getKind()) != DSPtr::IsValueDecl;
Ted Kremenekd27f8162008-01-15 23:55:06 +000080 }
Ted Kremenekaa66a322008-01-16 21:46:15 +000081 template<> struct VISIBILITY_HIDDEN cast_retty_impl<ValueDecl,DSPtr> {
82 typedef const ValueDecl* ret_type;
Ted Kremenekd27f8162008-01-15 23:55:06 +000083 };
Ted Kremenekcb448ca2008-01-16 00:53:15 +000084 template<> struct VISIBILITY_HIDDEN cast_retty_impl<Stmt,DSPtr> {
Ted Kremenekd27f8162008-01-15 23:55:06 +000085 typedef const Stmt* ret_type;
86 };
Ted Kremenekcb448ca2008-01-16 00:53:15 +000087 template<> struct VISIBILITY_HIDDEN simplify_type<DSPtr> {
Ted Kremenekd27f8162008-01-15 23:55:06 +000088 typedef void* SimpleType;
Ted Kremenekcb448ca2008-01-16 00:53:15 +000089 static inline SimpleType getSimplifiedValue(const DSPtr &V) {
Ted Kremenekd27f8162008-01-15 23:55:06 +000090 return V.getPtr();
91 }
92 };
93} // end llvm namespace
94
95//===----------------------------------------------------------------------===//
96// DeclStmtMapTy - A ImmutableMap type from Decl*/Stmt* to integers.
97//
98// FIXME: We may eventually use APSInt, or a mixture of APSInt and
99// integer primitives to do this right; this will handle both
100// different bit-widths and allow us to detect integer overflows, etc.
101//
102//===----------------------------------------------------------------------===//
103
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000104typedef llvm::ImmutableMap<DSPtr,uint64_t> DeclStmtMapTy;
Ted Kremenekd27f8162008-01-15 23:55:06 +0000105
106namespace clang {
107template<>
108struct VISIBILITY_HIDDEN GRTrait<DeclStmtMapTy> {
109 static inline void* toPtr(DeclStmtMapTy M) {
110 return reinterpret_cast<void*>(M.getRoot());
111 }
112 static inline DeclStmtMapTy toState(void* P) {
113 return DeclStmtMapTy(static_cast<DeclStmtMapTy::TreeTy*>(P));
114 }
115};
116}
117
118//===----------------------------------------------------------------------===//
119// The Checker!
120//===----------------------------------------------------------------------===//
121
122namespace {
123class VISIBILITY_HIDDEN ExprVariantTy {
124 const uint64_t val;
125 const bool isConstant;
126public:
127 ExprVariantTy() : val(0), isConstant(false) {}
128 ExprVariantTy(uint64_t v) : val(v), isConstant(true) {}
129
130 operator bool() const { return isConstant; }
131 uint64_t getVal() const { assert (isConstant); return val; }
132
133 ExprVariantTy operator+(const ExprVariantTy& X) const {
134 if (!isConstant || !X.isConstant) return ExprVariantTy();
135 else return ExprVariantTy(val+X.val);
136 }
137
138 ExprVariantTy operator-(const ExprVariantTy& X) const {
139 if (!isConstant || !X.isConstant) return ExprVariantTy();
Ted Kremenek95b3f6f2008-01-16 22:20:36 +0000140 else return ExprVariantTy(val-X.val);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000141 }
142};
143} // end anonymous namespace
144
145//===----------------------------------------------------------------------===//
146// The Checker!
147//===----------------------------------------------------------------------===//
148
149namespace {
150class VISIBILITY_HIDDEN GRConstants : public CFGStmtVisitor<GRConstants> {
151
152public:
153 typedef DeclStmtMapTy StateTy;
154 typedef GRNodeBuilder<GRConstants> NodeBuilder;
155 typedef ExplodedNode<StateTy> NodeTy;
156
157protected:
Ted Kremenekaa66a322008-01-16 21:46:15 +0000158 // Liveness - live-variables information the ValueDecl* and Expr* (block-level)
Ted Kremenekd27f8162008-01-15 23:55:06 +0000159 // in the CFG. Used to prune out dead state.
160 LiveVariables* Liveness;
161
162 // Builder - The current GRNodeBuilder which is used when building the nodes
163 // for a given statement.
164 NodeBuilder* Builder;
165
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000166 DeclStmtMapTy::Factory StateMgr;
Ted Kremenekd27f8162008-01-15 23:55:06 +0000167
168 // cfg - the current CFG.
169 CFG* cfg;
170
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000171 typedef llvm::SmallVector<NodeTy*,8> NodeSetTy;
Ted Kremenekd27f8162008-01-15 23:55:06 +0000172 NodeSetTy NodeSetA;
173 NodeSetTy NodeSetB;
174 NodeSetTy* Nodes;
175 NodeSetTy* OldNodes;
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000176 StateTy CurrentState;
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000177 NodeTy* InitialPred;
Ted Kremenekd27f8162008-01-15 23:55:06 +0000178
Ted Kremenekd27f8162008-01-15 23:55:06 +0000179public:
180 GRConstants() : Liveness(NULL), Builder(NULL), cfg(NULL),
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000181 Nodes(&NodeSetA), OldNodes(&NodeSetB),
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000182 CurrentState(StateMgr.GetEmptyMap()), InitialPred(NULL) {}
Ted Kremenekd27f8162008-01-15 23:55:06 +0000183
184 ~GRConstants() { delete Liveness; }
185
186 CFG& getCFG() { assert (cfg); return *cfg; }
187
188 void Initialize(CFG& c) {
189 cfg = &c;
190 Liveness = new LiveVariables(c);
191 Liveness->runOnCFG(c);
Ted Kremenek79649df2008-01-17 18:25:22 +0000192 Liveness->runOnAllBlocks(c, NULL, true);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000193 }
194
195 StateTy getInitialState() {
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000196 return StateMgr.GetEmptyMap();
Ted Kremenekd27f8162008-01-15 23:55:06 +0000197 }
198
199 void ProcessStmt(Stmt* S, NodeBuilder& builder);
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000200 void SwitchNodeSets();
Ted Kremenekd27f8162008-01-15 23:55:06 +0000201 void DoStmt(Stmt* S);
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000202
203 StateTy RemoveDescendantMappings(Stmt* S, StateTy M, unsigned Levels=2);
204 StateTy RemoveSubExprMappings(StateTy M);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000205
206 void AddBinding(Expr* E, ExprVariantTy V, bool isBlkLvl = false);
Ted Kremenekaa66a322008-01-16 21:46:15 +0000207 void AddBinding(ValueDecl* D, ExprVariantTy V);
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000208
Ted Kremenekd27f8162008-01-15 23:55:06 +0000209 ExprVariantTy GetBinding(Expr* E);
210
211 void BlockStmt_VisitStmt(Stmt* S) { DoStmt(S); }
Ted Kremenekd27f8162008-01-15 23:55:06 +0000212
213 void VisitAssign(BinaryOperator* O);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000214 void VisitBinAdd(BinaryOperator* O);
215 void VisitBinSub(BinaryOperator* O);
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000216 void VisitBinAssign(BinaryOperator* D);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000217};
218} // end anonymous namespace
219
220void GRConstants::ProcessStmt(Stmt* S, NodeBuilder& builder) {
221 Builder = &builder;
222 Nodes->clear();
223 OldNodes->clear();
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000224 InitialPred = Builder->getLastNode();
225 assert (InitialPred);
226 OldNodes->push_back(InitialPred);
227 CurrentState = RemoveSubExprMappings(InitialPred->getState());
Ted Kremenekd27f8162008-01-15 23:55:06 +0000228 BlockStmt_Visit(S);
229 Builder = NULL;
230}
231
232ExprVariantTy GRConstants::GetBinding(Expr* E) {
Ted Kremenek0525a4f2008-01-16 19:47:19 +0000233 DSPtr P(NULL);
Ted Kremenek4e99a5f2008-01-17 16:57:34 +0000234 E = E->IgnoreParens();
Ted Kremenek0525a4f2008-01-16 19:47:19 +0000235
Ted Kremenekca3e8572008-01-16 22:28:08 +0000236 switch (E->getStmtClass()) {
237 case Stmt::DeclRefExprClass:
238 P = DSPtr(cast<DeclRefExpr>(E)->getDecl());
239 break;
240
241 case Stmt::IntegerLiteralClass:
242 return cast<IntegerLiteral>(E)->getValue().getZExtValue();
243
244 default:
245 P = DSPtr(E, getCFG().isBlkExpr(E));
246 break;
247 }
Ted Kremenek0525a4f2008-01-16 19:47:19 +0000248
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000249 StateTy::iterator I = CurrentState.find(P);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000250
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000251 if (I == CurrentState.end())
Ted Kremenekd27f8162008-01-15 23:55:06 +0000252 return ExprVariantTy();
253
254 return (*I).second;
255}
256
257void GRConstants::AddBinding(Expr* E, ExprVariantTy V, bool isBlkLvl) {
Ted Kremenek22f0d972008-01-16 19:28:16 +0000258 if (V)
259 CurrentState = StateMgr.Add(CurrentState, DSPtr(E,isBlkLvl), V.getVal());
Ted Kremenekd27f8162008-01-15 23:55:06 +0000260}
261
Ted Kremenekaa66a322008-01-16 21:46:15 +0000262void GRConstants::AddBinding(ValueDecl* D, ExprVariantTy V) {
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000263 if (V)
264 CurrentState = StateMgr.Add(CurrentState, DSPtr(D), V.getVal());
265 else
266 CurrentState = StateMgr.Remove(CurrentState, DSPtr(D));
267}
268
Ted Kremenekd27f8162008-01-15 23:55:06 +0000269void GRConstants::SwitchNodeSets() {
270 NodeSetTy* Tmp = OldNodes;
271 OldNodes = Nodes;
272 Nodes = Tmp;
273 Nodes->clear();
274}
275
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000276GRConstants::StateTy
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000277GRConstants::RemoveSubExprMappings(StateTy M) {
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000278 for (StateTy::iterator I = M.begin(), E = M.end();
279 I!=E && I.getKey().getKind() == DSPtr::IsSubExp; ++I) {
280 // Note: we can assign a new map to M since the iterators are
281 // iterating over the tree of the original map (aren't immutable maps
282 // nice?).
283 M = StateMgr.Remove(M, I.getKey());
284 }
285
286 return M;
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000287}
288
289
290GRConstants::StateTy
291GRConstants::RemoveDescendantMappings(Stmt* S, GRConstants::StateTy State,
292 unsigned Levels) {
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000293 typedef Stmt::child_iterator iterator;
294
295 for (iterator I=S->child_begin(), E=S->child_end(); I!=E; ++I)
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000296 if (Stmt* C = *I) {
297 if (Levels == 1) {
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000298 // Observe that this will only remove mappings to non-block level
299 // expressions. This is valid even if *CI is a block-level expression,
300 // since it simply won't be in the map in the first place.
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000301 // Note: This should also work if 'C' is a block-level expression,
302 // although ideally we would want to skip processing C's children.
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000303 State = StateMgr.Remove(State, DSPtr(C,false));
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000304 }
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000305 else {
306 if (ParenExpr* P = dyn_cast<ParenExpr>(C))
307 State = RemoveDescendantMappings(P, State, Levels);
308 else
309 State = RemoveDescendantMappings(C, State, Levels-1);
310 }
311 }
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000312
313 return State;
314}
Ted Kremenekd27f8162008-01-15 23:55:06 +0000315
316void GRConstants::DoStmt(Stmt* S) {
317 for (Stmt::child_iterator I=S->child_begin(), E=S->child_end(); I!=E; ++I)
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000318 if (*I) DoStmt(*I);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000319
Ted Kremenekd27f8162008-01-15 23:55:06 +0000320 for (NodeSetTy::iterator I=OldNodes->begin(), E=OldNodes->end(); I!=E; ++I) {
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000321 NodeTy* Pred = *I;
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000322
323 if (Pred != InitialPred)
324 CurrentState = Pred->getState();
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000325
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000326 StateTy OldState = CurrentState;
Ted Kremeneke00fe3f2008-01-17 00:52:48 +0000327
328 if (Pred != InitialPred)
329 CurrentState = RemoveDescendantMappings(S, CurrentState);
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000330
Ted Kremenekd27f8162008-01-15 23:55:06 +0000331 Visit(S);
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000332
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000333 if (CurrentState != OldState) {
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000334 NodeTy* N = Builder->generateNode(S, CurrentState, Pred);
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000335 if (N) Nodes->push_back(N);
Ted Kremenekcb448ca2008-01-16 00:53:15 +0000336 }
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000337 else Nodes->push_back(Pred);
Ted Kremenekd27f8162008-01-15 23:55:06 +0000338 }
Ted Kremenek3c6c6722008-01-16 17:56:25 +0000339
340 SwitchNodeSets();
Ted Kremenekd27f8162008-01-15 23:55:06 +0000341}
342
Ted Kremenekd27f8162008-01-15 23:55:06 +0000343void GRConstants::VisitBinAdd(BinaryOperator* B) {
344 AddBinding(B, GetBinding(B->getLHS()) + GetBinding(B->getRHS()));
345}
346
347void GRConstants::VisitBinSub(BinaryOperator* B) {
348 AddBinding(B, GetBinding(B->getLHS()) - GetBinding(B->getRHS()));
349}
Ted Kremenekee985462008-01-16 18:18:48 +0000350
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000351
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000352void GRConstants::VisitBinAssign(BinaryOperator* B) {
Ted Kremenek79649df2008-01-17 18:25:22 +0000353 if (DeclRefExpr* D = dyn_cast<DeclRefExpr>(B->getLHS()->IgnoreParens())) {
354 ExprVariantTy V = GetBinding(B->getRHS());
355 AddBinding(D->getDecl(), V);
356 AddBinding(B, V);
357 }
Ted Kremenek1ccd31c2008-01-16 19:42:59 +0000358}
359
Ted Kremenekee985462008-01-16 18:18:48 +0000360//===----------------------------------------------------------------------===//
361// Driver.
362//===----------------------------------------------------------------------===//
363
Ted Kremenekaa66a322008-01-16 21:46:15 +0000364#ifndef NDEBUG
365namespace llvm {
366template<>
367struct VISIBILITY_HIDDEN DOTGraphTraits<GRConstants::NodeTy*> :
368 public DefaultDOTGraphTraits {
369
370 static std::string getNodeLabel(const GRConstants::NodeTy* N, void*) {
371 std::ostringstream Out;
372
373 Out << "Vertex: " << (void*) N << '\n';
374 ProgramPoint Loc = N->getLocation();
375
376 switch (Loc.getKind()) {
377 case ProgramPoint::BlockEntranceKind:
378 Out << "Block Entrance: B"
379 << cast<BlockEntrance>(Loc).getBlock()->getBlockID();
380 break;
381
382 case ProgramPoint::BlockExitKind:
383 assert (false);
384 break;
385
386 case ProgramPoint::PostStmtKind: {
387 const PostStmt& L = cast<PostStmt>(Loc);
388 Out << "Stmt: " << (void*) L.getStmt() << '\n';
389 L.getStmt()->printPretty(Out);
390 break;
391 }
392
393 default: {
394 const BlockEdge& E = cast<BlockEdge>(Loc);
395 Out << "Edge: (B" << E.getSrc()->getBlockID() << ", B"
396 << E.getDst()->getBlockID() << ')';
397 }
398 }
399
400 Out << "\n{";
401
402 GRConstants::StateTy M = N->getState();
403 bool isFirst = true;
404
405 for (GRConstants::StateTy::iterator I=M.begin(), E=M.end(); I!=E; ++I) {
406 if (!isFirst)
407 Out << '\n';
408 else
409 isFirst = false;
410
411 if (ValueDecl* V = dyn_cast<ValueDecl>(I.getKey())) {
412 Out << "Decl: " << (void*) V << ", " << V->getName();
413 }
414 else {
415 Stmt* E = cast<Stmt>(I.getKey());
416 Out << "Stmt: " << (void*) E;
417 }
418
419 Out << " => " << I.getData();
420 }
421
422 Out << " }";
423
424 return Out.str();
425 }
426};
427} // end llvm namespace
428#endif
429
Ted Kremenekee985462008-01-16 18:18:48 +0000430namespace clang {
431void RunGRConstants(CFG& cfg) {
432 GREngine<GRConstants> Engine(cfg);
433 Engine.ExecuteWorkList();
Ted Kremenekaa66a322008-01-16 21:46:15 +0000434#ifndef NDEBUG
435 llvm::ViewGraph(*Engine.getGraph().roots_begin(),"GRConstants");
436#endif
Ted Kremenekee985462008-01-16 18:18:48 +0000437}
438}