]> granicus.if.org Git - clang/commitdiff
Get clang-wpa to build in TOT (reflecting updates
authorTed Kremenek <kremenek@apple.com>
Tue, 18 Jan 2011 04:22:19 +0000 (04:22 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 18 Jan 2011 04:22:19 +0000 (04:22 +0000)
to the static analyzer).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123727 91177308-0d34-0410-b5e6-96231b3b80d8

examples/wpa/clang-wpa.cpp

index 41422b04ecf108523698dba8389f72ae29f83fca..d5cb6f845865dd670fbf4179bfe3f3d378a50952 100644 (file)
 
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/SourceManager.h"
-#include "clang/GR/PathSensitive/AnalysisManager.h"
-#include "clang/GR/PathSensitive/ExprEngine.h"
-#include "clang/GR/PathSensitive/TransferFuncs.h"
-#include "clang/GR/Checkers/LocalCheckers.h"
+#include "clang/StaticAnalyzer/PathSensitive/AnalysisManager.h"
+#include "clang/StaticAnalyzer/PathSensitive/ExprEngine.h"
+#include "clang/StaticAnalyzer/PathSensitive/TransferFuncs.h"
+#include "clang/StaticAnalyzer/Checkers/LocalCheckers.h"
 #include "clang/Frontend/ASTUnit.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Index/CallGraph.h"
@@ -91,7 +91,9 @@ int main(int argc, char **argv) {
     = CompilerInstance::createDiagnostics(DiagOpts, argc, argv);
   for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
     const std::string &InFile = InputFilenames[i];
-    llvm::OwningPtr<ASTUnit> AST(ASTUnit::LoadFromASTFile(InFile, Diags));
+    llvm::OwningPtr<ASTUnit> AST(ASTUnit::LoadFromASTFile(InFile, Diags,
+                                                          FileSystemOptions(),
+                                                          false, 0, 0, true));
     if (!AST)
       return 1;
 
@@ -130,6 +132,7 @@ int main(int argc, char **argv) {
   Preprocessor &PP = TU->getPreprocessor();
 
   // Hard code options for now.
+  using namespace clang::ento;
   AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(),
                        PP.getLangOptions(), /* PathDiagnostic */ 0,
                        CreateRegionStoreManager,
@@ -138,7 +141,9 @@ int main(int argc, char **argv) {
                        /* VisualizeEG */ false, /* VisualizeEGUbi */ false,
                        /* PurgeDead */ true, /* EagerlyAssume */ false,
                        /* TrimGraph */ false, /* InlineCall */ true, 
-                       /* UseUnoptimizedCFG */ false);
+                       /* UseUnoptimizedCFG */ false,
+                       /* addImplicitDtors */ true,
+                       /* addInitializers */ false);
 
   TransferFuncs* TF = MakeCFRefCountTF(AMgr.getASTContext(), /*GC*/false,
                                          AMgr.getLangOptions());