r242504 - Driver: Determine file names for crash reports more reliably
Justin Bogner
mail at justinbogner.com
Thu Jul 16 20:35:55 PDT 2015
Author: bogner
Date: Thu Jul 16 22:35:54 2015
New Revision: 242504
URL: http://llvm.org/viewvc/llvm-project?rev=242504&view=rev
Log:
Driver: Determine file names for crash reports more reliably
Guessing which file name to replace based on the -main-file-name
argument to -cc1 is flawed. Instead, keep track of which arguments are
inputs to each command.
Modified:
cfe/trunk/include/clang/Driver/Job.h
cfe/trunk/lib/Driver/Job.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/test/Driver/crash-report.c
Modified: cfe/trunk/include/clang/Driver/Job.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Job.h?rev=242504&r1=242503&r2=242504&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Job.h (original)
+++ cfe/trunk/include/clang/Driver/Job.h Thu Jul 16 22:35:54 2015
@@ -25,6 +25,7 @@ namespace driver {
class Action;
class Command;
class Tool;
+class InputInfo;
// Re-export this as clang::driver::ArgStringList.
using llvm::opt::ArgStringList;
@@ -53,6 +54,9 @@ class Command {
/// argument, which will be the executable).
llvm::opt::ArgStringList Arguments;
+ /// The list of program arguments which are inputs.
+ llvm::opt::ArgStringList InputFilenames;
+
/// Response file name, if this command is set to use one, or nullptr
/// otherwise
const char *ResponseFile;
@@ -79,7 +83,8 @@ class Command {
public:
Command(const Action &Source, const Tool &Creator, const char *Executable,
- const llvm::opt::ArgStringList &Arguments);
+ const llvm::opt::ArgStringList &Arguments,
+ ArrayRef<InputInfo> Inputs);
virtual ~Command() {}
virtual void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote,
@@ -117,6 +122,7 @@ class FallbackCommand : public Command {
public:
FallbackCommand(const Action &Source_, const Tool &Creator_,
const char *Executable_, const ArgStringList &Arguments_,
+ ArrayRef<InputInfo> Inputs,
std::unique_ptr<Command> Fallback_);
void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote,
Modified: cfe/trunk/lib/Driver/Job.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Job.cpp?rev=242504&r1=242503&r2=242504&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Job.cpp (original)
+++ cfe/trunk/lib/Driver/Job.cpp Thu Jul 16 22:35:54 2015
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "InputInfo.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Job.h"
@@ -26,9 +27,14 @@ using llvm::StringRef;
using llvm::ArrayRef;
Command::Command(const Action &Source, const Tool &Creator,
- const char *Executable, const ArgStringList &Arguments)
+ const char *Executable, const ArgStringList &Arguments,
+ ArrayRef<InputInfo> Inputs)
: Source(Source), Creator(Creator), Executable(Executable),
- Arguments(Arguments), ResponseFile(nullptr) {}
+ Arguments(Arguments), ResponseFile(nullptr) {
+ for (const auto &II : Inputs)
+ if (II.isFilename())
+ InputFilenames.push_back(II.getFilename());
+}
static int skipArgs(const char *Flag, bool HaveCrashVFS) {
// These flags are all of the form -Flag <Arg> and are treated as two
@@ -157,13 +163,6 @@ void Command::Print(raw_ostream &OS, con
Args = ArrayRef<const char *>(ArgsRespFile).slice(1); // no executable name
}
- StringRef MainFilename;
- // We'll need the argument to -main-file-name to find the input file name.
- if (CrashInfo)
- for (size_t I = 0, E = Args.size(); I + 1 < E; ++I)
- if (StringRef(Args[I]).equals("-main-file-name"))
- MainFilename = Args[I + 1];
-
bool HaveCrashVFS = CrashInfo && !CrashInfo->VFSPath.empty();
for (size_t i = 0, e = Args.size(); i < e; ++i) {
const char *const Arg = Args[i];
@@ -172,8 +171,11 @@ void Command::Print(raw_ostream &OS, con
if (int Skip = skipArgs(Arg, HaveCrashVFS)) {
i += Skip - 1;
continue;
- } else if (llvm::sys::path::filename(Arg) == MainFilename &&
- (i == 0 || StringRef(Args[i - 1]) != "-main-file-name")) {
+ }
+ auto Found = std::find_if(InputFilenames.begin(), InputFilenames.end(),
+ [&Arg](StringRef IF) { return IF == Arg; });
+ if (Found != InputFilenames.end() &&
+ (i == 0 || StringRef(Args[i - 1]) != "-main-file-name")) {
// Replace the input file name with the crashinfo's file name.
OS << ' ';
StringRef ShortName = llvm::sys::path::filename(CrashInfo->Filename);
@@ -256,8 +258,9 @@ int Command::Execute(const StringRef **R
FallbackCommand::FallbackCommand(const Action &Source_, const Tool &Creator_,
const char *Executable_,
const ArgStringList &Arguments_,
+ ArrayRef<InputInfo> Inputs,
std::unique_ptr<Command> Fallback_)
- : Command(Source_, Creator_, Executable_, Arguments_),
+ : Command(Source_, Creator_, Executable_, Arguments_, Inputs),
Fallback(std::move(Fallback_)) {}
void FallbackCommand::Print(raw_ostream &OS, const char *Terminator,
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=242504&r1=242503&r2=242504&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jul 16 22:35:54 2015
@@ -2579,12 +2579,13 @@ static void SplitDebugInfo(const ToolCha
ExtractArgs.push_back(OutFile);
const char *Exec = Args.MakeArgString(TC.GetProgramPath("objcopy"));
+ InputInfo II(Output.getFilename(), types::TY_Object, Output.getFilename());
// First extract the dwo sections.
- C.addCommand(llvm::make_unique<Command>(JA, T, Exec, ExtractArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, T, Exec, ExtractArgs, II));
// Then remove them from the original .o file.
- C.addCommand(llvm::make_unique<Command>(JA, T, Exec, StripArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, T, Exec, StripArgs, II));
}
/// \brief Vectorize at all optimization levels greater than 1 except for -Oz.
@@ -4883,10 +4884,10 @@ void Clang::ConstructJob(Compilation &C,
(InputType == types::TY_C || InputType == types::TY_CXX)) {
auto CLCommand =
getCLFallback()->GetCommand(C, JA, Output, Inputs, Args, LinkingOutput);
- C.addCommand(llvm::make_unique<FallbackCommand>(JA, *this, Exec, CmdArgs,
- std::move(CLCommand)));
+ C.addCommand(llvm::make_unique<FallbackCommand>(
+ JA, *this, Exec, CmdArgs, Inputs, std::move(CLCommand)));
} else {
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Handle the debug info splitting at object creation time if we're
@@ -5374,7 +5375,7 @@ void ClangAs::ConstructJob(Compilation &
CmdArgs.push_back(Input.getFilename());
const char *Exec = getToolChain().getDriver().getClangProgramPath();
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
// Handle the debug info splitting at object creation time if we're
// creating an object.
@@ -5497,7 +5498,7 @@ void gcc::Common::ConstructJob(Compilati
GCCName = "gcc";
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void gcc::Preprocessor::RenderExtraToolArgs(const JobAction &JA,
@@ -5596,7 +5597,7 @@ void hexagon::Assembler::ConstructJob(Co
const char *GCCName = "hexagon-as";
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath(GCCName));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void hexagon::Linker::RenderExtraToolArgs(const JobAction &JA,
@@ -5771,7 +5772,7 @@ void hexagon::Linker::ConstructJob(Compi
std::string Linker = ToolChain.GetProgramPath("hexagon-ld");
C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Linker),
- CmdArgs));
+ CmdArgs, Inputs));
}
// Hexagon tools end.
@@ -6087,7 +6088,7 @@ void cloudabi::Linker::ConstructJob(Comp
CmdArgs.push_back(Args.MakeArgString(ToolChain.GetFilePath("crtend.o")));
const char *Exec = Args.MakeArgString(ToolChain.GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6155,7 +6156,7 @@ void darwin::Assembler::ConstructJob(Com
// asm_final spec is empty.
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::MachOTool::anchor() {}
@@ -6388,7 +6389,7 @@ void darwin::Linker::ConstructJob(Compil
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("touch"));
CmdArgs.push_back(Output.getFilename());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, None));
return;
}
@@ -6524,7 +6525,7 @@ void darwin::Linker::ConstructJob(Compil
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
std::unique_ptr<Command> Cmd =
- llvm::make_unique<Command>(JA, *this, Exec, CmdArgs);
+ llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs);
Cmd->setInputFileList(std::move(InputFileList));
C.addCommand(std::move(Cmd));
}
@@ -6548,7 +6549,7 @@ void darwin::Lipo::ConstructJob(Compilat
}
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("lipo"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6568,7 +6569,7 @@ void darwin::Dsymutil::ConstructJob(Comp
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("dsymutil"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6591,7 +6592,7 @@ void darwin::VerifyDebug::ConstructJob(C
const char *Exec =
Args.MakeArgString(getToolChain().GetProgramPath("dwarfdump"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void solaris::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6611,7 +6612,7 @@ void solaris::Assembler::ConstructJob(Co
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6715,7 +6716,7 @@ void solaris::Linker::ConstructJob(Compi
addProfileRT(getToolChain(), Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void openbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6785,7 +6786,7 @@ void openbsd::Assembler::ConstructJob(Co
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6915,7 +6916,7 @@ void openbsd::Linker::ConstructJob(Compi
}
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void bitrig::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -6935,7 +6936,7 @@ void bitrig::Assembler::ConstructJob(Com
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void bitrig::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7049,7 +7050,7 @@ void bitrig::Linker::ConstructJob(Compil
}
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7131,7 +7132,7 @@ void freebsd::Assembler::ConstructJob(Co
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7314,7 +7315,7 @@ void freebsd::Linker::ConstructJob(Compi
addProfileRT(ToolChain, Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void netbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7389,7 +7390,7 @@ void netbsd::Assembler::ConstructJob(Com
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as")));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7599,7 +7600,7 @@ void netbsd::Linker::ConstructJob(Compil
addProfileRT(getToolChain(), Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void gnutools::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -7802,7 +7803,7 @@ void gnutools::Assembler::ConstructJob(C
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
// Handle the debug info splitting at object creation time if we're
// creating an object.
@@ -8189,8 +8190,8 @@ void gnutools::Linker::ConstructJob(Comp
}
}
- C.addCommand(
- llvm::make_unique<Command>(JA, *this, ToolChain.Linker.c_str(), CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, ToolChain.Linker.c_str(),
+ CmdArgs, Inputs));
}
// NaCl ARM assembly (inline or standalone) can be written with a set of macros
@@ -8365,8 +8366,8 @@ void nacltools::Linker::ConstructJob(Com
}
}
- C.addCommand(
- llvm::make_unique<Command>(JA, *this, ToolChain.Linker.c_str(), CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, ToolChain.Linker.c_str(),
+ CmdArgs, Inputs));
}
void minix::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -8386,7 +8387,7 @@ void minix::Assembler::ConstructJob(Comp
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void minix::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -8441,7 +8442,7 @@ void minix::Linker::ConstructJob(Compila
}
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// DragonFly Tools
@@ -8470,7 +8471,7 @@ void dragonfly::Assembler::ConstructJob(
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -8615,7 +8616,7 @@ void dragonfly::Linker::ConstructJob(Com
addProfileRT(getToolChain(), Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
// Try to find Exe from a Visual Studio distribution. This first tries to find
@@ -8776,7 +8777,7 @@ void visualstudio::Linker::ConstructJob(
}
const char *Exec = Args.MakeArgString(linkPath);
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void visualstudio::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -8871,7 +8872,7 @@ std::unique_ptr<Command> visualstudio::C
std::string Exec = FindVisualStudioExecutable(getToolChain(), "cl.exe",
D.getClangProgramPath());
return llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
- CmdArgs);
+ CmdArgs, Inputs);
}
/// MinGW Tools
@@ -8898,7 +8899,7 @@ void MinGW::Assembler::ConstructJob(Comp
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("as"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
if (Args.hasArg(options::OPT_gsplit_dwarf))
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,
@@ -9083,7 +9084,7 @@ void MinGW::Linker::ConstructJob(Compila
}
}
const char *Exec = Args.MakeArgString(TC.GetProgramPath(LinkerName.data()));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
/// XCore Tools
@@ -9119,7 +9120,7 @@ void XCore::Assembler::ConstructJob(Comp
CmdArgs.push_back(II.getFilename());
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("xcc"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void XCore::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -9147,7 +9148,7 @@ void XCore::Linker::ConstructJob(Compila
AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs);
const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("xcc"));
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void CrossWindows::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -9186,7 +9187,7 @@ void CrossWindows::Assembler::ConstructJ
const std::string Assembler = TC.GetProgramPath("as");
Exec = Args.MakeArgString(Assembler);
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void CrossWindows::Linker::ConstructJob(Compilation &C, const JobAction &JA,
@@ -9328,7 +9329,7 @@ void CrossWindows::Linker::ConstructJob(
const std::string Linker = TC.GetProgramPath("ld");
Exec = Args.MakeArgString(Linker);
- C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));
}
void tools::SHAVE::Compiler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -9372,8 +9373,8 @@ void tools::SHAVE::Compiler::ConstructJo
std::string Exec =
Args.MakeArgString(getToolChain().GetProgramPath("moviCompile"));
- C.addCommand(
- llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec), CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
+ CmdArgs, Inputs));
}
void tools::SHAVE::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
@@ -9404,6 +9405,6 @@ void tools::SHAVE::Assembler::ConstructJ
std::string Exec =
Args.MakeArgString(getToolChain().GetProgramPath("moviAsm"));
- C.addCommand(
- llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec), CmdArgs));
+ C.addCommand(llvm::make_unique<Command>(JA, *this, Args.MakeArgString(Exec),
+ CmdArgs, Inputs));
}
Modified: cfe/trunk/test/Driver/crash-report.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/crash-report.c?rev=242504&r1=242503&r2=242504&view=diff
==============================================================================
--- cfe/trunk/test/Driver/crash-report.c (original)
+++ cfe/trunk/test/Driver/crash-report.c Thu Jul 16 22:35:54 2015
@@ -5,6 +5,7 @@
// RUN: -iprefix /the/prefix -iwithprefix /tmp -iwithprefixbefore /tmp/ \
// RUN: -Xclang -internal-isystem -Xclang /tmp/ \
// RUN: -Xclang -internal-externc-isystem -Xclang /tmp/ \
+// RUN: -Xclang -main-file-name -Xclang foo.c \
// RUN: -DFOO=BAR -DBAR="BAZ QUX" 2>&1 | FileCheck %s
// RUN: cat %t/crash-report-*.c | FileCheck --check-prefix=CHECKSRC %s
// RUN: cat %t/crash-report-*.sh | FileCheck --check-prefix=CHECKSH %s
More information about the cfe-commits
mailing list