diff options
author | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2010-09-17 15:54:40 +0000 |
commit | 36c49e3f258dced101949edabd72e9bc3f1dedc4 (patch) | |
tree | 0bbe07708f7571f8b5291f6d7b96c102b7c99dee /examples/wpa/clang-wpa.cpp | |
parent | fc84956ac8b7cd244ef30e7a4d4d38a58dec5904 (diff) | |
download | FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.zip FreeBSD-src-36c49e3f258dced101949edabd72e9bc3f1dedc4.tar.gz |
Vendor import of clang r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020
Approved by: rpaulo (mentor)
Diffstat (limited to 'examples/wpa/clang-wpa.cpp')
-rw-r--r-- | examples/wpa/clang-wpa.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/wpa/clang-wpa.cpp b/examples/wpa/clang-wpa.cpp index 74ec368..41dca0d 100644 --- a/examples/wpa/clang-wpa.cpp +++ b/examples/wpa/clang-wpa.cpp @@ -62,6 +62,10 @@ public: return AST->getPreprocessor(); } + virtual Diagnostic &getDiagnostic() { + return AST->getDiagnostics(); + } + virtual DeclReferenceMap &getDeclReferenceMap() { return DeclRefMap; } @@ -87,7 +91,7 @@ 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::LoadFromPCHFile(InFile, Diags)); + llvm::OwningPtr<ASTUnit> AST(ASTUnit::LoadFromASTFile(InFile, Diags)); if (!AST) return 1; @@ -129,17 +133,18 @@ int main(int argc, char **argv) { AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(), PP.getLangOptions(), /* PathDiagnostic */ 0, CreateRegionStoreManager, - CreateRangeConstraintManager, + CreateRangeConstraintManager, &Idxer, /* MaxNodes */ 300000, /* MaxLoop */ 3, /* VisualizeEG */ false, /* VisualizeEGUbi */ false, /* PurgeDead */ true, /* EagerlyAssume */ false, - /* TrimGraph */ false, /* InlineCall */ true); + /* TrimGraph */ false, /* InlineCall */ true, + /* UseUnoptimizedCFG */ false); GRTransferFuncs* TF = MakeCFRefCountTF(AMgr.getASTContext(), /*GC*/false, AMgr.getLangOptions()); GRExprEngine Eng(AMgr, TF); - Eng.ExecuteWorkList(AMgr.getStackFrame(FD), AMgr.getMaxNodes()); + Eng.ExecuteWorkList(AMgr.getStackFrame(FD, TU), AMgr.getMaxNodes()); return 0; } |