Driver: ConstructJob also needs to know the destination (where to put
its commands).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67179 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/Job.cpp b/lib/Driver/Job.cpp
index 1efc38a..222cf15 100644
--- a/lib/Driver/Job.cpp
+++ b/lib/Driver/Job.cpp
@@ -21,3 +21,11 @@
PipedJob::PipedJob() : Job(PipedJobClass) {}
JobList::JobList() : Job(JobListClass) {}
+
+void Job::addCommand(Command *C) {
+ if (PipedJob *PJ = dyn_cast<PipedJob>(this))
+ PJ->addCommand(C);
+ else
+ cast<JobList>(this)->addJob(C);
+}
+