From b212b34f19472469c1d20ada3161c3523268d5be Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Thu, 12 Sep 2013 18:23:34 +0000 Subject: 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 llvm-svn: 190620 --- clang/lib/Frontend/CreateInvocationFromCommandLine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CreateInvocationFromCommandLine.cpp') diff --git a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp index acb93fa..78f39d4 100644 --- a/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp +++ b/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp @@ -56,7 +56,7 @@ clang::createInvocationFromCommandLine(ArrayRef 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 ArgList, if (Jobs.size() != 1 || !isa(*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; } -- cgit v1.1