diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /lib/Frontend/ASTConsumers.cpp | |
parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) |
Notes
Diffstat (limited to 'lib/Frontend/ASTConsumers.cpp')
-rw-r--r-- | lib/Frontend/ASTConsumers.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 52776b6a8483..de72ea57e35b 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -35,9 +35,9 @@ namespace { typedef RecursiveASTVisitor<ASTPrinter> base; public: - ASTPrinter(raw_ostream *Out = nullptr, bool Dump = false, + ASTPrinter(std::unique_ptr<raw_ostream> Out = nullptr, bool Dump = false, StringRef FilterString = "", bool DumpLookups = false) - : Out(Out ? *Out : llvm::outs()), Dump(Dump), + : Out(Out ? *Out : llvm::outs()), OwnedOut(std::move(Out)), Dump(Dump), FilterString(FilterString), DumpLookups(DumpLookups) {} void HandleTranslationUnit(ASTContext &Context) override { @@ -94,6 +94,7 @@ namespace { } raw_ostream &Out; + std::unique_ptr<raw_ostream> OwnedOut; bool Dump; std::string FilterString; bool DumpLookups; @@ -122,9 +123,11 @@ namespace { }; } // end anonymous namespace -std::unique_ptr<ASTConsumer> clang::CreateASTPrinter(raw_ostream *Out, - StringRef FilterString) { - return llvm::make_unique<ASTPrinter>(Out, /*Dump=*/false, FilterString); +std::unique_ptr<ASTConsumer> +clang::CreateASTPrinter(std::unique_ptr<raw_ostream> Out, + StringRef FilterString) { + return llvm::make_unique<ASTPrinter>(std::move(Out), /*Dump=*/false, + FilterString); } std::unique_ptr<ASTConsumer> clang::CreateASTDumper(StringRef FilterString, @@ -268,7 +271,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, // Print the parameters. Out << "("; bool PrintComma = false; - for (auto I : FD->params()) { + for (auto I : FD->parameters()) { if (PrintComma) Out << ", "; else @@ -290,13 +293,12 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, // Print the parameters. Out << "("; bool PrintComma = false; - for (FunctionDecl::param_const_iterator I = D->param_begin(), - E = D->param_end(); I != E; ++I) { + for (ParmVarDecl *Parameter : D->parameters()) { if (PrintComma) Out << ", "; else PrintComma = true; - Out << **I; + Out << *Parameter; } Out << ")"; @@ -320,13 +322,12 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, // Print the parameters. Out << "("; bool PrintComma = false; - for (FunctionDecl::param_const_iterator I = D->param_begin(), - E = D->param_end(); I != E; ++I) { + for (ParmVarDecl *Parameter : D->parameters()) { if (PrintComma) Out << ", "; else PrintComma = true; - Out << **I; + Out << *Parameter; } Out << ")"; |