diff options
author | Kevin Enderby <enderby@apple.com> | 2012-01-11 18:04:47 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2012-01-11 18:04:47 +0000 |
commit | 6223cf72e6ca266f0aa9ac3a905759a7eec81017 (patch) | |
tree | 576ff8f5887340007d08cabad1dcb0feb71bbffd /llvm/lib/MC/MCParser/AsmParser.cpp | |
parent | 21f83d9f36ce6780aaf9502341fa7645150569c7 (diff) | |
download | bcm5719-llvm-6223cf72e6ca266f0aa9ac3a905759a7eec81017.tar.gz bcm5719-llvm-6223cf72e6ca266f0aa9ac3a905759a7eec81017.zip |
The error check for using -g with a .s file already containing dwarf .file
directives was in the wrong place and getting triggered incorectly with a
cpp .file directive. This change fixes that and adds a test case.
llvm-svn: 147951
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 7fad30164ee..16eb64b5f5b 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -2424,13 +2424,13 @@ bool GenericAsmParser::ParseDirectiveFile(StringRef, SMLoc DirectiveLoc) { if (getLexer().isNot(AsmToken::EndOfStatement)) return TokError("unexpected token in '.file' directive"); - if (getContext().getGenDwarfForAssembly() == true) - Error(DirectiveLoc, "input can't have .file dwarf directives when -g is " - "used to generate dwarf debug info for assembly code"); - if (FileNumber == -1) getStreamer().EmitFileDirective(Filename); else { + if (getContext().getGenDwarfForAssembly() == true) + Error(DirectiveLoc, "input can't have .file dwarf directives when -g is " + "used to generate dwarf debug info for assembly code"); + if (getStreamer().EmitDwarfFileDirective(FileNumber, Directory, Filename)) Error(FileNumberLoc, "file number already allocated"); } |