aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-02 02:38:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-02 02:38:08 +0000
commitdefcda7ea696c41ecaad36cc77f2360b91697265 (patch)
treee777a5618c9a861d0a0ea7cb97e50185afb59324 /lib/Driver/Driver.cpp
parent58e12fd6df3b692a8385d1c1b9644ba98e86e64d (diff)
Driver: Simplify logic for sending 'clang -E t.c' output to stdout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110009 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 077c05ba16..b394bf9301 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1078,19 +1078,6 @@ void Driver::BuildJobsForAction(Compilation &C,
InputInfos.push_back(II);
}
- // Determine if we should output to a pipe.
- bool OutputToPipe = false;
- if (CanAcceptPipe && T.canPipeOutput()) {
- // Some actions default to writing to a pipe if they are the top level phase
- // and there was no user override.
- //
- // FIXME: Is there a better way to handle this?
- if (AtTopLevel) {
- if (isa<PreprocessJobAction>(A) && !C.getArgs().hasArg(options::OPT_o))
- OutputToPipe = true;
- }
- }
-
// Figure out where to put the job (pipes).
Job *Dest = &C.getJobs();
assert(!InputInfos[0].isPipe() && "Unrequested pipe!");
@@ -1107,18 +1094,6 @@ void Driver::BuildJobsForAction(Compilation &C,
// where to put the new job.
if (JA->getType() == types::TY_Nothing) {
Result = InputInfo(A->getType(), BaseInput);
- } else if (OutputToPipe) {
- // Append to current piped job or create a new one as appropriate.
- PipedJob *PJ = dyn_cast<PipedJob>(Dest);
- if (!PJ) {
- PJ = new PipedJob();
- // FIXME: Temporary hack so that -ccc-print-bindings work until we have
- // pipe support. Please remove later.
- if (!CCCPrintBindings)
- cast<JobList>(Dest)->addJob(PJ);
- Dest = PJ;
- }
- Result = InputInfo(PJ, A->getType(), BaseInput);
} else {
Result = InputInfo(GetNamedOutputPath(C, *JA, BaseInput, AtTopLevel),
A->getType(), BaseInput);
@@ -1150,6 +1125,10 @@ const char *Driver::GetNamedOutputPath(Compilation &C,
return C.addResultFile(FinalOutput->getValue(C.getArgs()));
}
+ // Default to writing to stdout?
+ if (AtTopLevel && isa<PreprocessJobAction>(JA))
+ return "-";
+
// Output to a temporary file?
if (!AtTopLevel && !C.getArgs().hasArg(options::OPT_save_temps)) {
std::string TmpName =