Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 1 | //===--- AnalysisConsumer.cpp - ASTConsumer for running Analyses ----------===// |
| 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 | // "Meta" ASTConsumer for running different source analyses. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "ASTConsumers.h" |
Ted Kremenek | ad99dbf | 2008-11-03 22:31:48 +0000 | [diff] [blame] | 15 | #include "clang/Driver/PathDiagnosticClients.h" |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 16 | #include "clang/AST/ASTConsumer.h" |
| 17 | #include "clang/AST/Decl.h" |
| 18 | #include "clang/AST/DeclObjC.h" |
| 19 | #include "llvm/Support/Compiler.h" |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 20 | #include "llvm/ADT/OwningPtr.h" |
| 21 | #include "clang/AST/CFG.h" |
| 22 | #include "clang/Analysis/Analyses/LiveVariables.h" |
| 23 | #include "clang/Analysis/PathDiagnostic.h" |
| 24 | #include "clang/Basic/SourceManager.h" |
| 25 | #include "clang/Basic/FileManager.h" |
| 26 | #include "clang/AST/ParentMap.h" |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 27 | #include "clang/AST/TranslationUnit.h" |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 28 | #include "clang/Analysis/PathSensitive/BugReporter.h" |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 29 | #include "clang/Analysis/Analyses/LiveVariables.h" |
| 30 | #include "clang/Analysis/LocalCheckers.h" |
| 31 | #include "clang/Analysis/PathSensitive/GRTransferFuncs.h" |
| 32 | #include "clang/Analysis/PathSensitive/GRExprEngine.h" |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 33 | #include "llvm/Support/Streams.h" |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 34 | #include "llvm/Support/raw_ostream.h" |
| 35 | #include "llvm/System/Path.h" |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 36 | #include "llvm/System/Program.h" |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 37 | #include <vector> |
| 38 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 39 | using namespace clang; |
| 40 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 41 | static ExplodedNodeImpl::Auditor* CreateUbiViz(); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 42 | |
| 43 | //===----------------------------------------------------------------------===// |
| 44 | // Basic type definitions. |
| 45 | //===----------------------------------------------------------------------===// |
| 46 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 47 | namespace { |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 48 | class AnalysisManager; |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 49 | typedef void (*CodeAction)(AnalysisManager& Mgr); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 50 | } // end anonymous namespace |
| 51 | |
| 52 | //===----------------------------------------------------------------------===// |
| 53 | // AnalysisConsumer declaration. |
| 54 | //===----------------------------------------------------------------------===// |
| 55 | |
| 56 | namespace { |
| 57 | |
| 58 | class VISIBILITY_HIDDEN AnalysisConsumer : public ASTConsumer { |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 59 | typedef std::vector<CodeAction> Actions; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 60 | Actions FunctionActions; |
| 61 | Actions ObjCMethodActions; |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 62 | Actions ObjCImplementationActions; |
Ted Kremenek | daac634 | 2008-11-07 02:09:25 +0000 | [diff] [blame] | 63 | Actions TranslationUnitActions; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 64 | |
| 65 | public: |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 66 | const bool VisGraphviz; |
| 67 | const bool VisUbigraph; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 68 | const bool TrimGraph; |
Ted Kremenek | 95c7b00 | 2008-10-24 01:04:59 +0000 | [diff] [blame] | 69 | const LangOptions& LOpts; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 70 | Diagnostic &Diags; |
| 71 | ASTContext* Ctx; |
| 72 | Preprocessor* PP; |
| 73 | PreprocessorFactory* PPF; |
| 74 | const std::string HTMLDir; |
| 75 | const std::string FName; |
| 76 | llvm::OwningPtr<PathDiagnosticClient> PD; |
| 77 | bool AnalyzeAll; |
Ted Kremenek | 95c7b00 | 2008-10-24 01:04:59 +0000 | [diff] [blame] | 78 | AnalysisStores SM; |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 79 | AnalysisDiagClients DC; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 80 | |
| 81 | AnalysisConsumer(Diagnostic &diags, Preprocessor* pp, |
| 82 | PreprocessorFactory* ppf, |
| 83 | const LangOptions& lopts, |
| 84 | const std::string& fname, |
| 85 | const std::string& htmldir, |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 86 | AnalysisStores sm, AnalysisDiagClients dc, |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 87 | bool visgraphviz, bool visubi, bool trim, bool analyzeAll) |
| 88 | : VisGraphviz(visgraphviz), VisUbigraph(visubi), TrimGraph(trim), |
| 89 | LOpts(lopts), Diags(diags), |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 90 | Ctx(0), PP(pp), PPF(ppf), |
| 91 | HTMLDir(htmldir), |
| 92 | FName(fname), |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 93 | AnalyzeAll(analyzeAll), SM(sm), DC(dc) {} |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 94 | |
| 95 | void addCodeAction(CodeAction action) { |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 96 | FunctionActions.push_back(action); |
| 97 | ObjCMethodActions.push_back(action); |
| 98 | } |
| 99 | |
| 100 | void addObjCImplementationAction(CodeAction action) { |
| 101 | ObjCImplementationActions.push_back(action); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 102 | } |
| 103 | |
Ted Kremenek | daac634 | 2008-11-07 02:09:25 +0000 | [diff] [blame] | 104 | void addTranslationUnitAction(CodeAction action) { |
| 105 | TranslationUnitActions.push_back(action); |
| 106 | } |
| 107 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 108 | virtual void Initialize(ASTContext &Context) { |
| 109 | Ctx = &Context; |
| 110 | } |
| 111 | |
| 112 | virtual void HandleTopLevelDecl(Decl *D); |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 113 | virtual void HandleTranslationUnit(TranslationUnit &TU); |
| 114 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 115 | void HandleCode(Decl* D, Stmt* Body, Actions actions); |
| 116 | }; |
| 117 | |
| 118 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 119 | class VISIBILITY_HIDDEN AnalysisManager : public BugReporterData { |
Ted Kremenek | f304ddc | 2008-11-05 19:05:06 +0000 | [diff] [blame] | 120 | Decl* D; Stmt* Body; |
| 121 | TranslationUnit* TU; |
| 122 | |
| 123 | enum AnalysisScope { ScopeTU, ScopeDecl } AScope; |
| 124 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 125 | AnalysisConsumer& C; |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 126 | bool DisplayedFunction; |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 127 | |
| 128 | llvm::OwningPtr<CFG> cfg; |
| 129 | llvm::OwningPtr<LiveVariables> liveness; |
| 130 | llvm::OwningPtr<ParentMap> PM; |
| 131 | |
| 132 | public: |
| 133 | AnalysisManager(AnalysisConsumer& c, Decl* d, Stmt* b) |
Ted Kremenek | f304ddc | 2008-11-05 19:05:06 +0000 | [diff] [blame] | 134 | : D(d), Body(b), TU(0), AScope(ScopeDecl), C(c), DisplayedFunction(false) {} |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 135 | |
Ted Kremenek | f304ddc | 2008-11-05 19:05:06 +0000 | [diff] [blame] | 136 | AnalysisManager(AnalysisConsumer& c, TranslationUnit* tu) |
| 137 | : D(0), Body(0), TU(tu), AScope(ScopeTU), C(c), DisplayedFunction(false) {} |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 138 | |
Ted Kremenek | f304ddc | 2008-11-05 19:05:06 +0000 | [diff] [blame] | 139 | Decl* getCodeDecl() const { |
| 140 | assert (AScope == ScopeDecl); |
| 141 | return D; |
| 142 | } |
| 143 | |
| 144 | Stmt* getBody() const { |
| 145 | assert (AScope == ScopeDecl); |
| 146 | return Body; |
| 147 | } |
| 148 | |
| 149 | TranslationUnit* getTranslationUnit() const { |
| 150 | assert (AScope == ScopeTU); |
| 151 | return TU; |
| 152 | } |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 153 | |
Ted Kremenek | 95c7b00 | 2008-10-24 01:04:59 +0000 | [diff] [blame] | 154 | GRStateManager::StoreManagerCreator getStoreManagerCreator() { |
| 155 | switch (C.SM) { |
| 156 | default: |
| 157 | #define ANALYSIS_STORE(NAME, CMDFLAG, DESC)\ |
| 158 | case NAME##Model: return Create##NAME##Manager; |
| 159 | #include "Analyses.def" |
| 160 | } |
| 161 | }; |
| 162 | |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 163 | virtual CFG* getCFG() { |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 164 | if (!cfg) cfg.reset(CFG::buildCFG(getBody())); |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 165 | return cfg.get(); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 166 | } |
| 167 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 168 | virtual ParentMap& getParentMap() { |
Ted Kremenek | e207558 | 2008-07-02 23:16:33 +0000 | [diff] [blame] | 169 | if (!PM) |
| 170 | PM.reset(new ParentMap(getBody())); |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 171 | return *PM.get(); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 172 | } |
| 173 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 174 | virtual ASTContext& getContext() { |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 175 | return *C.Ctx; |
| 176 | } |
| 177 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 178 | virtual SourceManager& getSourceManager() { |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 179 | return getContext().getSourceManager(); |
| 180 | } |
| 181 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 182 | virtual Diagnostic& getDiagnostic() { |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 183 | return C.Diags; |
| 184 | } |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 185 | |
| 186 | const LangOptions& getLangOptions() const { |
| 187 | return C.LOpts; |
| 188 | } |
| 189 | |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 190 | virtual PathDiagnosticClient* getPathDiagnosticClient() { |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 191 | if (C.PD.get() == 0 && !C.HTMLDir.empty()) { |
| 192 | switch (C.DC) { |
| 193 | default: |
| 194 | #define ANALYSIS_DIAGNOSTICS(NAME, CMDFLAG, DESC, CREATEFN)\ |
| 195 | case PD_##NAME: C.PD.reset(CREATEFN(C.HTMLDir, C.PP, C.PPF)); break; |
| 196 | #include "Analyses.def" |
| 197 | } |
| 198 | } |
Ted Kremenek | e207558 | 2008-07-02 23:16:33 +0000 | [diff] [blame] | 199 | return C.PD.get(); |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 200 | } |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 201 | |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 202 | virtual LiveVariables* getLiveVariables() { |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 203 | if (!liveness) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 204 | CFG* c = getCFG(); |
| 205 | if (!c) return 0; |
| 206 | |
| 207 | liveness.reset(new LiveVariables(*c)); |
| 208 | liveness->runOnCFG(*c); |
| 209 | liveness->runOnAllBlocks(*c, 0, true); |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 210 | } |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 211 | |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 212 | return liveness.get(); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 213 | } |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 214 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 215 | bool shouldVisualizeGraphviz() const { |
| 216 | return C.VisGraphviz; |
| 217 | } |
| 218 | |
| 219 | bool shouldVisualizeUbigraph() const { |
| 220 | return C.VisUbigraph; |
| 221 | } |
| 222 | |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 223 | bool shouldVisualize() const { |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 224 | return C.VisGraphviz || C.VisUbigraph; |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 225 | } |
| 226 | |
| 227 | bool shouldTrimGraph() const { |
| 228 | return C.TrimGraph; |
| 229 | } |
| 230 | |
| 231 | void DisplayFunction() { |
| 232 | |
| 233 | if (DisplayedFunction) |
| 234 | return; |
| 235 | |
| 236 | DisplayedFunction = true; |
| 237 | |
| 238 | if (FunctionDecl *FD = dyn_cast<FunctionDecl>(getCodeDecl())) { |
Ted Kremenek | 628a42e | 2008-09-04 00:02:50 +0000 | [diff] [blame] | 239 | llvm::cout << "ANALYZE: " |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 240 | << getContext().getSourceManager().getSourceName(FD->getLocation()) |
| 241 | << ' ' |
| 242 | << FD->getIdentifier()->getName() |
| 243 | << '\n'; |
| 244 | } |
| 245 | else if (ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(getCodeDecl())) { |
Ted Kremenek | 628a42e | 2008-09-04 00:02:50 +0000 | [diff] [blame] | 246 | llvm::cout << "ANALYZE (ObjC Method): " |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 247 | << getContext().getSourceManager().getSourceName(MD->getLocation()) |
| 248 | << " '" |
| 249 | << MD->getSelector().getName() << "'\n"; |
| 250 | } |
| 251 | } |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 252 | }; |
| 253 | |
| 254 | } // end anonymous namespace |
| 255 | |
| 256 | namespace llvm { |
| 257 | template <> struct FoldingSetTrait<CodeAction> { |
| 258 | static inline void Profile(CodeAction X, FoldingSetNodeID& ID) { |
| 259 | ID.AddPointer(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(X))); |
| 260 | } |
| 261 | }; |
| 262 | } |
| 263 | |
| 264 | //===----------------------------------------------------------------------===// |
| 265 | // AnalysisConsumer implementation. |
| 266 | //===----------------------------------------------------------------------===// |
| 267 | |
| 268 | void AnalysisConsumer::HandleTopLevelDecl(Decl *D) { |
| 269 | switch (D->getKind()) { |
| 270 | case Decl::Function: { |
| 271 | FunctionDecl* FD = cast<FunctionDecl>(D); |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 272 | |
| 273 | if (FName.size() > 0 && FName != FD->getIdentifier()->getName()) |
| 274 | break; |
| 275 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 276 | Stmt* Body = FD->getBody(); |
| 277 | if (Body) HandleCode(FD, Body, FunctionActions); |
| 278 | break; |
| 279 | } |
| 280 | |
| 281 | case Decl::ObjCMethod: { |
| 282 | ObjCMethodDecl* MD = cast<ObjCMethodDecl>(D); |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 283 | |
| 284 | if (FName.size() > 0 && FName != MD->getSelector().getName()) |
| 285 | return; |
| 286 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 287 | Stmt* Body = MD->getBody(); |
| 288 | if (Body) HandleCode(MD, Body, ObjCMethodActions); |
| 289 | break; |
| 290 | } |
| 291 | |
| 292 | default: |
| 293 | break; |
| 294 | } |
| 295 | } |
| 296 | |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 297 | void AnalysisConsumer::HandleTranslationUnit(TranslationUnit& TU) { |
| 298 | |
Ted Kremenek | daac634 | 2008-11-07 02:09:25 +0000 | [diff] [blame] | 299 | if(!TranslationUnitActions.empty()) { |
| 300 | AnalysisManager mgr(*this, &TU); |
| 301 | for (Actions::iterator I = TranslationUnitActions.begin(), |
| 302 | E = TranslationUnitActions.end(); I != E; ++I) |
| 303 | (*I)(mgr); |
| 304 | } |
| 305 | |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 306 | if (ObjCImplementationActions.empty()) |
| 307 | return; |
| 308 | |
| 309 | for (TranslationUnit::iterator I = TU.begin(), E = TU.end(); I!=E; ++I) { |
| 310 | |
| 311 | if (ObjCImplementationDecl* ID = dyn_cast<ObjCImplementationDecl>(*I)) |
| 312 | HandleCode(ID, 0, ObjCImplementationActions); |
| 313 | } |
| 314 | } |
| 315 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 316 | void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions actions) { |
| 317 | |
| 318 | // Don't run the actions if an error has occured with parsing the file. |
| 319 | if (Diags.hasErrorOccurred()) |
| 320 | return; |
| 321 | |
| 322 | SourceLocation Loc = D->getLocation(); |
| 323 | |
| 324 | // Only run actions on declarations defined in actual source. |
| 325 | if (!Loc.isFileID()) |
| 326 | return; |
| 327 | |
| 328 | // Don't run the actions on declarations in header files unless |
| 329 | // otherwise specified. |
| 330 | if (!AnalyzeAll && !Ctx->getSourceManager().isFromMainFile(Loc)) |
| 331 | return; |
| 332 | |
| 333 | // Create an AnalysisManager that will manage the state for analyzing |
| 334 | // this method/function. |
| 335 | AnalysisManager mgr(*this, D, Body); |
| 336 | |
| 337 | // Dispatch on the actions. |
Zhongxing Xu | 3702af5 | 2008-10-30 05:03:28 +0000 | [diff] [blame] | 338 | for (Actions::iterator I = actions.begin(), E = actions.end(); I != E; ++I) |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 339 | (*I)(mgr); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 340 | } |
| 341 | |
| 342 | //===----------------------------------------------------------------------===// |
| 343 | // Analyses |
| 344 | //===----------------------------------------------------------------------===// |
| 345 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 346 | static void ActionWarnDeadStores(AnalysisManager& mgr) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 347 | if (LiveVariables* L = mgr.getLiveVariables()) { |
| 348 | BugReporter BR(mgr); |
| 349 | CheckDeadStores(*L, BR); |
| 350 | } |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 351 | } |
| 352 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 353 | static void ActionWarnUninitVals(AnalysisManager& mgr) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 354 | if (CFG* c = mgr.getCFG()) |
| 355 | CheckUninitializedValues(*c, mgr.getContext(), mgr.getDiagnostic()); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 356 | } |
| 357 | |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 358 | |
Ted Kremenek | 78d4624 | 2008-07-22 16:21:24 +0000 | [diff] [blame] | 359 | static void ActionGRExprEngine(AnalysisManager& mgr, GRTransferFuncs* tf, |
| 360 | bool StandardWarnings = true) { |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 361 | |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 362 | |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 363 | llvm::OwningPtr<GRTransferFuncs> TF(tf); |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 364 | |
| 365 | // Construct the analysis engine. |
| 366 | LiveVariables* L = mgr.getLiveVariables(); |
| 367 | if (!L) return; |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 368 | |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 369 | // Display progress. |
Ted Kremenek | 45479c8 | 2008-08-28 18:34:41 +0000 | [diff] [blame] | 370 | mgr.DisplayFunction(); |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 371 | |
Ted Kremenek | 95c7b00 | 2008-10-24 01:04:59 +0000 | [diff] [blame] | 372 | GRExprEngine Eng(*mgr.getCFG(), *mgr.getCodeDecl(), mgr.getContext(), *L, |
| 373 | mgr.getStoreManagerCreator()); |
| 374 | |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 375 | Eng.setTransferFunctions(tf); |
| 376 | |
Ted Kremenek | 78d4624 | 2008-07-22 16:21:24 +0000 | [diff] [blame] | 377 | if (StandardWarnings) { |
| 378 | Eng.RegisterInternalChecks(); |
| 379 | RegisterAppleChecks(Eng); |
| 380 | } |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 381 | |
| 382 | // Set the graph auditor. |
| 383 | llvm::OwningPtr<ExplodedNodeImpl::Auditor> Auditor; |
| 384 | if (mgr.shouldVisualizeUbigraph()) { |
| 385 | Auditor.reset(CreateUbiViz()); |
| 386 | ExplodedNodeImpl::SetAuditor(Auditor.get()); |
| 387 | } |
Ted Kremenek | 78d4624 | 2008-07-22 16:21:24 +0000 | [diff] [blame] | 388 | |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 389 | // Execute the worklist algorithm. |
| 390 | Eng.ExecuteWorkList(); |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 391 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 392 | // Release the auditor (if any) so that it doesn't monitor the graph |
| 393 | // created BugReporter. |
| 394 | ExplodedNodeImpl::SetAuditor(0); |
| 395 | |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 396 | // Display warnings. |
Ted Kremenek | c095997 | 2008-07-02 21:24:01 +0000 | [diff] [blame] | 397 | Eng.EmitWarnings(mgr); |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 398 | |
| 399 | // Visualize the exploded graph. |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 400 | if (mgr.shouldVisualizeGraphviz()) |
Ted Kremenek | 34d7734 | 2008-07-02 16:49:11 +0000 | [diff] [blame] | 401 | Eng.ViewGraph(mgr.shouldTrimGraph()); |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 402 | } |
| 403 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 404 | static void ActionCheckerCFRefAux(AnalysisManager& mgr, bool GCEnabled, |
Ted Kremenek | 78d4624 | 2008-07-22 16:21:24 +0000 | [diff] [blame] | 405 | bool StandardWarnings) { |
| 406 | |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 407 | GRTransferFuncs* TF = MakeCFRefCountTF(mgr.getContext(), |
| 408 | GCEnabled, |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 409 | mgr.getLangOptions()); |
| 410 | |
Ted Kremenek | 78d4624 | 2008-07-22 16:21:24 +0000 | [diff] [blame] | 411 | ActionGRExprEngine(mgr, TF, StandardWarnings); |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 412 | } |
| 413 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 414 | static void ActionCheckerCFRef(AnalysisManager& mgr) { |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 415 | |
| 416 | switch (mgr.getLangOptions().getGCMode()) { |
| 417 | default: |
| 418 | assert (false && "Invalid GC mode."); |
| 419 | case LangOptions::NonGC: |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 420 | ActionCheckerCFRefAux(mgr, false, true); |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 421 | break; |
| 422 | |
| 423 | case LangOptions::GCOnly: |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 424 | ActionCheckerCFRefAux(mgr, true, true); |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 425 | break; |
| 426 | |
| 427 | case LangOptions::HybridGC: |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 428 | ActionCheckerCFRefAux(mgr, false, true); |
| 429 | ActionCheckerCFRefAux(mgr, true, false); |
Ted Kremenek | b35a74a | 2008-07-02 00:44:58 +0000 | [diff] [blame] | 430 | break; |
| 431 | } |
| 432 | } |
| 433 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 434 | static void ActionCheckerSimple(AnalysisManager& mgr) { |
Ted Kremenek | bc46f34 | 2008-07-02 16:35:50 +0000 | [diff] [blame] | 435 | ActionGRExprEngine(mgr, MakeGRSimpleValsTF()); |
| 436 | } |
| 437 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 438 | static void ActionDisplayLiveVariables(AnalysisManager& mgr) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 439 | if (LiveVariables* L = mgr.getLiveVariables()) { |
| 440 | mgr.DisplayFunction(); |
| 441 | L->dumpBlockLiveness(mgr.getSourceManager()); |
| 442 | } |
Ted Kremenek | 235e031 | 2008-07-02 18:11:29 +0000 | [diff] [blame] | 443 | } |
| 444 | |
Ted Kremenek | 902141f | 2008-07-02 18:23:21 +0000 | [diff] [blame] | 445 | static void ActionCFGDump(AnalysisManager& mgr) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 446 | if (CFG* c = mgr.getCFG()) { |
| 447 | mgr.DisplayFunction(); |
| 448 | c->dump(); |
| 449 | } |
Ted Kremenek | 902141f | 2008-07-02 18:23:21 +0000 | [diff] [blame] | 450 | } |
| 451 | |
| 452 | static void ActionCFGView(AnalysisManager& mgr) { |
Ted Kremenek | 7032f46 | 2008-07-03 05:26:14 +0000 | [diff] [blame] | 453 | if (CFG* c = mgr.getCFG()) { |
| 454 | mgr.DisplayFunction(); |
| 455 | c->viewCFG(); |
| 456 | } |
Ted Kremenek | 902141f | 2008-07-02 18:23:21 +0000 | [diff] [blame] | 457 | } |
| 458 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 459 | static void ActionWarnObjCDealloc(AnalysisManager& mgr) { |
Ted Kremenek | 4f4e7e4 | 2008-08-04 17:14:10 +0000 | [diff] [blame] | 460 | if (mgr.getLangOptions().getGCMode() == LangOptions::GCOnly) |
| 461 | return; |
| 462 | |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 463 | BugReporter BR(mgr); |
Ted Kremenek | 3cd483c | 2008-07-03 14:35:01 +0000 | [diff] [blame] | 464 | |
| 465 | CheckObjCDealloc(cast<ObjCImplementationDecl>(mgr.getCodeDecl()), |
| 466 | mgr.getLangOptions(), BR); |
Ted Kremenek | db09a4d | 2008-07-03 04:29:21 +0000 | [diff] [blame] | 467 | } |
| 468 | |
Ted Kremenek | 395aaf2 | 2008-07-23 00:45:26 +0000 | [diff] [blame] | 469 | static void ActionWarnObjCUnusedIvars(AnalysisManager& mgr) { |
| 470 | BugReporter BR(mgr); |
| 471 | CheckObjCUnusedIvar(cast<ObjCImplementationDecl>(mgr.getCodeDecl()), BR); |
| 472 | } |
| 473 | |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 474 | static void ActionWarnObjCMethSigs(AnalysisManager& mgr) { |
Ted Kremenek | 0d8019e | 2008-07-11 22:40:47 +0000 | [diff] [blame] | 475 | BugReporter BR(mgr); |
| 476 | |
| 477 | CheckObjCInstMethSignature(cast<ObjCImplementationDecl>(mgr.getCodeDecl()), |
| 478 | BR); |
| 479 | } |
| 480 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 481 | //===----------------------------------------------------------------------===// |
| 482 | // AnalysisConsumer creation. |
| 483 | //===----------------------------------------------------------------------===// |
| 484 | |
| 485 | ASTConsumer* clang::CreateAnalysisConsumer(Analyses* Beg, Analyses* End, |
Ted Kremenek | 95c7b00 | 2008-10-24 01:04:59 +0000 | [diff] [blame] | 486 | AnalysisStores SM, |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 487 | AnalysisDiagClients DC, |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 488 | Diagnostic &diags, Preprocessor* pp, |
| 489 | PreprocessorFactory* ppf, |
| 490 | const LangOptions& lopts, |
| 491 | const std::string& fname, |
| 492 | const std::string& htmldir, |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 493 | bool VisGraphviz, bool VisUbi, |
| 494 | bool trim, |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 495 | bool analyzeAll) { |
| 496 | |
| 497 | llvm::OwningPtr<AnalysisConsumer> |
Ted Kremenek | 4fc82c8 | 2008-11-03 23:18:07 +0000 | [diff] [blame] | 498 | C(new AnalysisConsumer(diags, pp, ppf, lopts, fname, htmldir, SM, DC, |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 499 | VisGraphviz, VisUbi, trim, analyzeAll)); |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 500 | |
| 501 | for ( ; Beg != End ; ++Beg) |
| 502 | switch (*Beg) { |
Ted Kremenek | f7f3c20 | 2008-07-15 00:46:02 +0000 | [diff] [blame] | 503 | #define ANALYSIS(NAME, CMD, DESC, SCOPE)\ |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 504 | case NAME:\ |
Ted Kremenek | f7f3c20 | 2008-07-15 00:46:02 +0000 | [diff] [blame] | 505 | C->add ## SCOPE ## Action(&Action ## NAME);\ |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 506 | break; |
Ted Kremenek | fb9a48c | 2008-07-14 23:41:13 +0000 | [diff] [blame] | 507 | #include "Analyses.def" |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 508 | default: break; |
| 509 | } |
| 510 | |
Ted Kremenek | f4381fd | 2008-07-02 00:03:09 +0000 | [diff] [blame] | 511 | return C.take(); |
| 512 | } |
| 513 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 514 | //===----------------------------------------------------------------------===// |
| 515 | // Ubigraph Visualization. FIXME: Move to separate file. |
| 516 | //===----------------------------------------------------------------------===// |
| 517 | |
| 518 | namespace { |
| 519 | |
| 520 | class UbigraphViz : public ExplodedNodeImpl::Auditor { |
| 521 | llvm::OwningPtr<llvm::raw_ostream> Out; |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 522 | llvm::sys::Path Dir, Filename; |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 523 | unsigned Cntr; |
| 524 | |
| 525 | typedef llvm::DenseMap<void*,unsigned> VMap; |
| 526 | VMap M; |
| 527 | |
| 528 | public: |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 529 | UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir, |
Ted Kremenek | 56b9871 | 2008-08-28 05:02:09 +0000 | [diff] [blame] | 530 | llvm::sys::Path& filename); |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 531 | |
| 532 | ~UbigraphViz(); |
| 533 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 534 | virtual void AddEdge(ExplodedNodeImpl* Src, ExplodedNodeImpl* Dst); |
| 535 | }; |
| 536 | |
| 537 | } // end anonymous namespace |
| 538 | |
| 539 | static ExplodedNodeImpl::Auditor* CreateUbiViz() { |
| 540 | std::string ErrMsg; |
| 541 | |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 542 | llvm::sys::Path Dir = llvm::sys::Path::GetTemporaryDirectory(&ErrMsg); |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 543 | if (!ErrMsg.empty()) |
| 544 | return 0; |
| 545 | |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 546 | llvm::sys::Path Filename = Dir; |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 547 | Filename.appendComponent("llvm_ubi"); |
| 548 | Filename.makeUnique(true,&ErrMsg); |
| 549 | |
| 550 | if (!ErrMsg.empty()) |
| 551 | return 0; |
| 552 | |
| 553 | llvm::cerr << "Writing '" << Filename << "'.\n"; |
| 554 | |
| 555 | llvm::OwningPtr<llvm::raw_fd_ostream> Stream; |
| 556 | std::string filename = Filename.toString(); |
Daniel Dunbar | 26fb272 | 2008-11-13 05:09:21 +0000 | [diff] [blame^] | 557 | Stream.reset(new llvm::raw_fd_ostream(filename.c_str(), false, ErrMsg)); |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 558 | |
| 559 | if (!ErrMsg.empty()) |
| 560 | return 0; |
| 561 | |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 562 | return new UbigraphViz(Stream.take(), Dir, Filename); |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | void UbigraphViz::AddEdge(ExplodedNodeImpl* Src, ExplodedNodeImpl* Dst) { |
Ted Kremenek | 45479c8 | 2008-08-28 18:34:41 +0000 | [diff] [blame] | 566 | |
| 567 | assert (Src != Dst && "Self-edges are not allowed."); |
| 568 | |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 569 | // Lookup the Src. If it is a new node, it's a root. |
| 570 | VMap::iterator SrcI= M.find(Src); |
| 571 | unsigned SrcID; |
| 572 | |
| 573 | if (SrcI == M.end()) { |
| 574 | M[Src] = SrcID = Cntr++; |
| 575 | *Out << "('vertex', " << SrcID << ", ('color','#00ff00'))\n"; |
| 576 | } |
| 577 | else |
| 578 | SrcID = SrcI->second; |
| 579 | |
| 580 | // Lookup the Dst. |
| 581 | VMap::iterator DstI= M.find(Dst); |
| 582 | unsigned DstID; |
| 583 | |
| 584 | if (DstI == M.end()) { |
| 585 | M[Dst] = DstID = Cntr++; |
| 586 | *Out << "('vertex', " << DstID << ")\n"; |
| 587 | } |
Ted Kremenek | 56b9871 | 2008-08-28 05:02:09 +0000 | [diff] [blame] | 588 | else { |
| 589 | // We have hit DstID before. Change its style to reflect a cache hit. |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 590 | DstID = DstI->second; |
Ted Kremenek | 56b9871 | 2008-08-28 05:02:09 +0000 | [diff] [blame] | 591 | *Out << "('change_vertex_style', " << DstID << ", 1)\n"; |
| 592 | } |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 593 | |
| 594 | // Add the edge. |
Ted Kremenek | d128932 | 2008-08-27 22:46:55 +0000 | [diff] [blame] | 595 | *Out << "('edge', " << SrcID << ", " << DstID |
| 596 | << ", ('arrow','true'), ('oriented', 'true'))\n"; |
Ted Kremenek | f8ce699 | 2008-08-27 22:31:43 +0000 | [diff] [blame] | 597 | } |
| 598 | |
Ted Kremenek | 56b9871 | 2008-08-28 05:02:09 +0000 | [diff] [blame] | 599 | UbigraphViz::UbigraphViz(llvm::raw_ostream* out, llvm::sys::Path& dir, |
| 600 | llvm::sys::Path& filename) |
| 601 | : Out(out), Dir(dir), Filename(filename), Cntr(0) { |
| 602 | |
| 603 | *Out << "('vertex_style_attribute', 0, ('shape', 'icosahedron'))\n"; |
| 604 | *Out << "('vertex_style', 1, 0, ('shape', 'sphere'), ('color', '#ffcc66')," |
| 605 | " ('size', '1.5'))\n"; |
| 606 | } |
| 607 | |
Ted Kremenek | 710ad93 | 2008-08-28 03:54:51 +0000 | [diff] [blame] | 608 | UbigraphViz::~UbigraphViz() { |
| 609 | Out.reset(0); |
| 610 | llvm::cerr << "Running 'ubiviz' program... "; |
| 611 | std::string ErrMsg; |
| 612 | llvm::sys::Path Ubiviz = llvm::sys::Program::FindProgramByName("ubiviz"); |
| 613 | std::vector<const char*> args; |
| 614 | args.push_back(Ubiviz.c_str()); |
| 615 | args.push_back(Filename.c_str()); |
| 616 | args.push_back(0); |
| 617 | |
| 618 | if (llvm::sys::Program::ExecuteAndWait(Ubiviz, &args[0],0,0,0,0,&ErrMsg)) { |
| 619 | llvm::cerr << "Error viewing graph: " << ErrMsg << "\n"; |
| 620 | } |
| 621 | |
| 622 | // Delete the directory. |
| 623 | Dir.eraseFromDisk(true); |
Daniel Dunbar | 932680e | 2008-08-29 03:45:59 +0000 | [diff] [blame] | 624 | } |