From 0594545b5b31ff543fb6016a3ae35ee78b51b984 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 29 Jul 2009 23:39:09 +0000 Subject: [PATCH] Remove the TranslationUnit usage from clang-wpa.cpp since it's not really necessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77529 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/wpa/clang-wpa.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tools/wpa/clang-wpa.cpp b/tools/wpa/clang-wpa.cpp index e7515ecd24..2cdc1c6d98 100644 --- a/tools/wpa/clang-wpa.cpp +++ b/tools/wpa/clang-wpa.cpp @@ -15,7 +15,6 @@ #include "clang/Analysis/CallGraph.h" #include "clang/Basic/FileManager.h" -#include "clang/Index/TranslationUnit.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -24,20 +23,10 @@ using namespace idx; static llvm::cl::list InputFilenames(llvm::cl::Positional, llvm::cl::desc("")); -// FIXME: this duplicates the one in index-test.cpp. -class TUnit : public TranslationUnit { -public: - TUnit(ASTUnit *ast, const std::string &filename) - : AST(ast), Filename(filename) {} - ASTContext &getASTContext() { return AST->getASTContext(); } - llvm::OwningPtr AST; - std::string Filename; -}; - int main(int argc, char **argv) { llvm::cl::ParseCommandLineOptions(argc, argv, "clang-wpa"); FileManager FileMgr; - std::vector TUnits; + std::vector ASTUnits; if (InputFilenames.empty()) return 0; @@ -55,15 +44,14 @@ int main(int argc, char **argv) { return 1; } - TUnit *TU = new TUnit(AST.take(), InFile); - TUnits.push_back(TU); + ASTUnits.push_back(AST.take()); } llvm::OwningPtr CG; CG.reset(new CallGraph()); - for (unsigned i = 0, e = TUnits.size(); i != e; ++i) - CG->addTU(*(TUnits[i]->AST)); + for (unsigned i = 0, e = ASTUnits.size(); i != e; ++i) + CG->addTU(*ASTUnits[i]); CG->ViewCallGraph(); } -- 2.40.0