summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Compilation.cpp
diff options
context:
space:
mode:
authorNikolay Haustov <Nikolay.Haustov@amd.com>2016-06-28 08:00:42 +0000
committerNikolay Haustov <Nikolay.Haustov@amd.com>2016-06-28 08:00:42 +0000
commit9c366cdf2a80aeaf57cb540bdc4843bc0381cafa (patch)
tree053dc218c2a0745d4db71db0b85287a0088a6a98 /clang/lib/Driver/Compilation.cpp
parent3e176c77ab593e2edf659e7318cb41319cae10ff (diff)
downloadbcm5719-llvm-9c366cdf2a80aeaf57cb540bdc4843bc0381cafa.tar.gz
bcm5719-llvm-9c366cdf2a80aeaf57cb540bdc4843bc0381cafa.zip
[Driver] Add method to redirect output of Compilation.
Summary: Currently output of child process, however in my use case, it needs to be captured and presented to the user. Add Redirect method to Compilation and use existing infrastructure for redirecting output of commands. Reviewers: tstellarAMD Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21224 llvm-svn: 273997
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r--clang/lib/Driver/Compilation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index 46548e638a3..6a2616f0c2a 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -45,6 +45,7 @@ Compilation::~Compilation() {
// Free redirections of stdout/stderr.
if (Redirects) {
+ delete Redirects[0];
delete Redirects[1];
delete Redirects[2];
delete [] Redirects;
@@ -213,3 +214,7 @@ void Compilation::initCompilationForDiagnostics() {
StringRef Compilation::getSysRoot() const {
return getDriver().SysRoot;
}
+
+void Compilation::Redirect(const StringRef** Redirects) {
+ this->Redirects = Redirects;
+}
OpenPOWER on IntegriCloud