forked from OSchip/llvm-project
Driver/no-integrated-as: Fix forwarding of -g flag to assembler, when .s input
undergoes preprocessing. llvm-svn: 129414
This commit is contained in:
parent
539d96f01d
commit
dc8355e81a
|
@ -2604,11 +2604,16 @@ void darwin::Assemble::ConstructJob(Compilation &C, const JobAction &JA,
|
||||||
assert(Inputs.size() == 1 && "Unexpected number of inputs.");
|
assert(Inputs.size() == 1 && "Unexpected number of inputs.");
|
||||||
const InputInfo &Input = Inputs[0];
|
const InputInfo &Input = Inputs[0];
|
||||||
|
|
||||||
// Bit of a hack, this is only used for original inputs.
|
// Determine the original source input.
|
||||||
//
|
const Action *SourceAction = &JA;
|
||||||
// FIXME: This is broken for preprocessed .s inputs.
|
while (SourceAction->getKind() != Action::InputClass) {
|
||||||
if (Input.isFilename() &&
|
assert(!SourceAction->getInputs().empty() && "unexpected root action!");
|
||||||
strcmp(Input.getFilename(), Input.getBaseInput()) == 0) {
|
SourceAction = SourceAction->getInputs()[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forward -g, assuming we are dealing with an actual assembly file.
|
||||||
|
if (SourceAction->getType() == types::TY_Asm ||
|
||||||
|
SourceAction->getType() == types::TY_PP_Asm) {
|
||||||
if (Args.hasArg(options::OPT_gstabs))
|
if (Args.hasArg(options::OPT_gstabs))
|
||||||
CmdArgs.push_back("--gstabs");
|
CmdArgs.push_back("--gstabs");
|
||||||
else if (Args.hasArg(options::OPT_g_Group))
|
else if (Args.hasArg(options::OPT_g_Group))
|
||||||
|
|
Loading…
Reference in New Issue