]> granicus.if.org Git - clang/commit
Frontend: Simplify ownership model for clang's output streams.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 15 Jul 2016 00:55:40 +0000 (00:55 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 15 Jul 2016 00:55:40 +0000 (00:55 +0000)
commitf1bc23840ff148c68225bd02c95a56eef4e7a2fc
tree069deddb3129982b3ef2646a57644b1060f9b85e
parent543a4302fa7c2926757ecf86f62dd193d66a74e3
Frontend: Simplify ownership model for clang's output streams.

This changes the CompilerInstance::createOutputFile function to return
a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream
implicitly owned by the CompilerInstance. This in most cases required that
I move ownership of the output stream to the relevant ASTConsumer.

The motivation for this change is to allow BackendConsumer to be a client
of interfaces such as D20268 which take ownership of the output stream.

Differential Revision: http://reviews.llvm.org/D21537

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275507 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/clang/CodeGen/BackendUtil.h
include/clang/CodeGen/ObjectFilePCHContainerOperations.h
include/clang/Frontend/ASTConsumers.h
include/clang/Frontend/CompilerInstance.h
include/clang/Frontend/FrontendActions.h
include/clang/Frontend/PCHContainerOperations.h
include/clang/Rewrite/Frontend/ASTConsumers.h
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CodeGenAction.cpp
lib/CodeGen/ObjectFilePCHContainerOperations.cpp
lib/Frontend/ASTConsumers.cpp
lib/Frontend/ASTUnit.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/FrontendActions.cpp
lib/Frontend/PCHContainerOperations.cpp
lib/Frontend/Rewrite/FrontendActions.cpp
lib/Frontend/Rewrite/HTMLPrint.cpp
lib/Frontend/Rewrite/RewriteModernObjC.cpp
lib/Frontend/Rewrite/RewriteObjC.cpp
tools/clang-check/ClangCheck.cpp