diff options
author | Hans Wennborg <hans@hanshq.net> | 2013-09-12 18:23:34 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2013-09-12 18:23:34 +0000 |
commit | fc3389701ead32709ba84825e4c06651065da2c0 (patch) | |
tree | 94cd74b9a557a1d8df873a9053d7083ce55dd512 /lib/Frontend/CreateInvocationFromCommandLine.cpp | |
parent | 17e95c8aac18cac3e040079a120b4a129975ae9d (diff) | |
download | clang-fc3389701ead32709ba84825e4c06651065da2c0.tar.gz |
Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.
This moves the code to Job.cpp, which seems like a more natural fit,
and replaces the "is this a JobList? is this a Command?" logic with
a virtual function call.
It also removes the code duplication between PrintJob and
PrintDiagnosticJob and simplifies the code a little.
There's no functionality change here, except that the Executable is
now always printed within quotes, whereas it would previously not be
quoted in crash reports, which I think was a bug.
Differential Revision: http://llvm-reviews.chandlerc.com/D1653
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CreateInvocationFromCommandLine.cpp')
-rw-r--r-- | lib/Frontend/CreateInvocationFromCommandLine.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/CreateInvocationFromCommandLine.cpp b/lib/Frontend/CreateInvocationFromCommandLine.cpp index acb93fa1b0..78f39d4298 100644 --- a/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -56,7 +56,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, // Just print the cc1 options if -### was present. if (C->getArgs().hasArg(driver::options::OPT__HASH_HASH_HASH)) { - C->PrintJob(llvm::errs(), C->getJobs(), "\n", true); + C->getJobs().Print(llvm::errs(), "\n", true); return 0; } @@ -66,7 +66,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList, if (Jobs.size() != 1 || !isa<driver::Command>(*Jobs.begin())) { SmallString<256> Msg; llvm::raw_svector_ostream OS(Msg); - C->PrintJob(OS, C->getJobs(), "; ", true); + Jobs.Print(OS, "; ", true); Diags->Report(diag::err_fe_expected_compiler_job) << OS.str(); return 0; } |