OSDN Git Service

PR11740: Disable assembly debug info when assembly already contains line directives
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 26 May 2016 00:22:26 +0000 (00:22 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 26 May 2016 00:22:26 +0000 (00:22 +0000)
commit2474f04f67a34476c16316ba0299237c3e6df6b0
tree673983b909ff42fd90add4c365f271f93b70513c
parent3985ce522244785949a9efdd66218f421d6b5732
PR11740: Disable assembly debug info when assembly already contains line directives

If there is already debug info in the assembly file, and user hope to
use -g option for compiling, we think we should not directly report an
error.

According to what GNU assembler did, it just reused the debug info in
the assembly file, and turned off the DEBUG_TYPE option so that there
will be no new debug info emitted by assembler. This fix is just as what
GNU assembler did.

The concern is the situation that there are two .text sections in the
assembly file, one with debug info and the other one without. Currently
with this fix, the assembler will no longer generate any debug info for
the second .text section. And this is what GNU assembler exactly did for
this situation. So I think this still make some sense.

Patch by Zhizhou Yang!

Differential Revision: http://reviews.llvm.org/D20002

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270806 91177308-0d34-0410-b5e6-96231b3b80d8
lib/MC/MCParser/AsmParser.cpp
test/MC/AsmParser/directive_file-2.s [new file with mode: 0644]
test/MC/AsmParser/directive_file-errors.s [deleted file]