[cfe-commits] r110809 - in /cfe/trunk/examples: CMakeLists.txt Makefile wpa/CMakeLists.txt wpa/Makefile wpa/clang-wpa.cpp

Daniel Dunbar daniel at zuster.org
Wed Aug 11 08:21:41 PDT 2010


Author: ddunbar
Date: Wed Aug 11 10:21:41 2010
New Revision: 110809

URL: http://llvm.org/viewvc/llvm-project?rev=110809&view=rev
Log:
Remove wpa 'example', it isn't being maintained.

Removed:
    cfe/trunk/examples/wpa/CMakeLists.txt
    cfe/trunk/examples/wpa/Makefile
    cfe/trunk/examples/wpa/clang-wpa.cpp
Modified:
    cfe/trunk/examples/CMakeLists.txt
    cfe/trunk/examples/Makefile

Modified: cfe/trunk/examples/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/CMakeLists.txt?rev=110809&r1=110808&r2=110809&view=diff
==============================================================================
--- cfe/trunk/examples/CMakeLists.txt (original)
+++ cfe/trunk/examples/CMakeLists.txt Wed Aug 11 10:21:41 2010
@@ -1,4 +1,3 @@
 add_subdirectory(clang-interpreter)
 add_subdirectory(PrintFunctionNames)
-add_subdirectory(wpa)
 

Modified: cfe/trunk/examples/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/Makefile?rev=110809&r1=110808&r2=110809&view=diff
==============================================================================
--- cfe/trunk/examples/Makefile (original)
+++ cfe/trunk/examples/Makefile Wed Aug 11 10:21:41 2010
@@ -9,6 +9,6 @@
 
 CLANG_LEVEL := ..
 
-PARALLEL_DIRS := clang-interpreter PrintFunctionNames wpa
+PARALLEL_DIRS := clang-interpreter PrintFunctionNames
 
 include $(CLANG_LEVEL)/Makefile

Removed: cfe/trunk/examples/wpa/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/CMakeLists.txt?rev=110808&view=auto
==============================================================================
--- cfe/trunk/examples/wpa/CMakeLists.txt (original)
+++ cfe/trunk/examples/wpa/CMakeLists.txt (removed)
@@ -1,25 +0,0 @@
-set(LLVM_NO_RTTI 1)
-
-set(LLVM_USED_LIBS
-  clangIndex
-  clangFrontend
-  clangDriver
-  clangSema
-  clangAnalysis
-  clangChecker
-  clangRewrite
-  clangAST
-  clangParse
-  clangLex
-  clangBasic)
-
-set( LLVM_LINK_COMPONENTS
-  bitreader
-  mc
-  core
-  )
-
-add_clang_executable(clang-wpa
-  clang-wpa.cpp
-  )
-add_dependencies(clang-wpa clang-headers)

Removed: cfe/trunk/examples/wpa/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/Makefile?rev=110808&view=auto
==============================================================================
--- cfe/trunk/examples/wpa/Makefile (original)
+++ cfe/trunk/examples/wpa/Makefile (removed)
@@ -1,23 +0,0 @@
-##===- examples/wpa/Makefile -------------------------------*- Makefile -*-===##
-#
-#                     The LLVM Compiler Infrastructure
-#
-# This file is distributed under the University of Illinois Open Source
-# License. See LICENSE.TXT for details.
-#
-##===----------------------------------------------------------------------===##
-
-CLANG_LEVEL := ../..
-
-TOOLNAME = clang-wpa
-NO_INSTALL = 1
-
-# No plugins, optimize startup time.
-TOOL_NO_EXPORTS = 1
-
-LINK_COMPONENTS := asmparser bitreader mc core
-USEDLIBS = clangChecker.a clangIndex.a clangFrontend.a clangDriver.a \
-	   clangSema.a clangAnalysis.a clangAST.a clangParse.a clangLex.a \
-	   clangBasic.a
-
-include $(CLANG_LEVEL)/Makefile

Removed: cfe/trunk/examples/wpa/clang-wpa.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/clang-wpa.cpp?rev=110808&view=auto
==============================================================================
--- cfe/trunk/examples/wpa/clang-wpa.cpp (original)
+++ cfe/trunk/examples/wpa/clang-wpa.cpp (removed)
@@ -1,149 +0,0 @@
-//===--- clang-wpa.cpp - clang whole program analyzer ---------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This tool reads a sequence of precompiled AST files, and do various
-// cross translation unit analyses.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Basic/FileManager.h"
-#include "clang/Basic/SourceManager.h"
-#include "clang/Checker/PathSensitive/AnalysisManager.h"
-#include "clang/Checker/PathSensitive/GRExprEngine.h"
-#include "clang/Checker/PathSensitive/GRTransferFuncs.h"
-#include "clang/Checker/Checkers/LocalCheckers.h"
-#include "clang/Frontend/ASTUnit.h"
-#include "clang/Frontend/CompilerInstance.h"
-#include "clang/Index/CallGraph.h"
-#include "clang/Index/Indexer.h"
-#include "clang/Index/TranslationUnit.h"
-#include "clang/Index/DeclReferenceMap.h"
-#include "clang/Index/SelectorMap.h"
-#include "clang/Lex/Preprocessor.h"
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/raw_ostream.h"
-using namespace clang;
-using namespace idx;
-
-static llvm::cl::list<std::string>
-InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input AST files>"));
-
-static llvm::cl::opt<bool> 
-ViewCallGraph("view-call-graph", llvm::cl::desc("Display the call graph."));
-
-static llvm::cl::opt<std::string>
-AnalyzeFunction("analyze-function", 
-                llvm::cl::desc("Specify the entry function."));
-
-namespace {
-// A thin wrapper over ASTUnit implementing the TranslationUnit interface.
-class ASTUnitTU : public TranslationUnit {
-  ASTUnit *AST;
-  DeclReferenceMap DeclRefMap;
-  SelectorMap SelMap;
-  
-public:
-  ASTUnitTU(ASTUnit *ast) 
-    : AST(ast), DeclRefMap(AST->getASTContext()), SelMap(AST->getASTContext()) {
-  }
-
-  virtual ASTContext &getASTContext() {
-    return AST->getASTContext();
-  }
-  
-  virtual Preprocessor &getPreprocessor() {
-    return AST->getPreprocessor();
-  }
-
-  virtual Diagnostic &getDiagnostic() {
-    return AST->getDiagnostics();
-  }
-
-  virtual DeclReferenceMap &getDeclReferenceMap() {
-    return DeclRefMap;
-  }
-
-  virtual SelectorMap &getSelectorMap() {
-    return SelMap;
-  }
-};
-}
-
-int main(int argc, char **argv) {
-  llvm::cl::ParseCommandLineOptions(argc, argv, "clang-wpa");
-  std::vector<ASTUnit*> ASTUnits;
-
-  Program Prog;
-  Indexer Idxer(Prog);
-
-  if (InputFilenames.empty())
-    return 0;
-
-  DiagnosticOptions DiagOpts;
-  llvm::IntrusiveRefCntPtr<Diagnostic> Diags
-    = 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::LoadFromPCHFile(InFile, Diags));
-    if (!AST)
-      return 1;
-
-    ASTUnits.push_back(AST.take());
-  }
-
-  if (ViewCallGraph) {
-    llvm::OwningPtr<CallGraph> CG;
-    CG.reset(new CallGraph(Prog));
-
-    for (unsigned i = 0, e = ASTUnits.size(); i != e; ++i)
-      CG->addTU(ASTUnits[i]->getASTContext());
-
-    CG->ViewCallGraph();
-    return 0;
-  }
-
-  if (AnalyzeFunction.empty())
-    return 0;
-
-  // Feed all ASTUnits to the Indexer.
-  for (unsigned i = 0, e = ASTUnits.size(); i != e; ++i) {
-    ASTUnitTU *TU = new ASTUnitTU(ASTUnits[i]);
-    Idxer.IndexAST(TU);
-  }
-
-  Entity Ent = Entity::get(AnalyzeFunction, Prog);
-  FunctionDecl *FD;
-  TranslationUnit *TU;
-  llvm::tie(FD, TU) = Idxer.getDefinitionFor(Ent);
-
-  if (!FD)
-    return 0;
-
-  // Create an analysis engine.
-  Preprocessor &PP = TU->getPreprocessor();
-
-  // Hard code options for now.
-  AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(),
-                       PP.getLangOptions(), /* PathDiagnostic */ 0,
-                       CreateRegionStoreManager,
-                       CreateRangeConstraintManager, &Idxer,
-                       /* MaxNodes */ 300000, /* MaxLoop */ 3,
-                       /* VisualizeEG */ false, /* VisualizeEGUbi */ false,
-                       /* PurgeDead */ true, /* EagerlyAssume */ false,
-                       /* TrimGraph */ false, /* InlineCall */ true);
-
-  GRTransferFuncs* TF = MakeCFRefCountTF(AMgr.getASTContext(), /*GC*/false,
-                                         AMgr.getLangOptions());
-  GRExprEngine Eng(AMgr, TF);
-
-  Eng.ExecuteWorkList(AMgr.getStackFrame(FD, TU), AMgr.getMaxNodes());
-  
-  return 0;
-}





More information about the cfe-commits mailing list