wirte up .file and .file to the mc asmparser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94438 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2010-01-25 19:02:58 +00:00
parent a6594fc715
commit d32e803073
2 changed files with 12 additions and 5 deletions

View File

@ -1708,14 +1708,18 @@ bool AsmParser::ParseDirectiveFile(StringRef, SMLoc DirectiveLoc) {
if (Lexer.isNot(AsmToken::String))
return TokError("unexpected token in '.file' directive");
StringRef ATTRIBUTE_UNUSED FileName = getTok().getString();
StringRef Filename = getTok().getString();
Filename = Filename.substr(1, Filename.size()-2);
Lex();
if (Lexer.isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in '.file' directive");
// FIXME: Do something with the .file.
if (FileNumber == -1)
Out.EmitFileDirective(Filename);
else
Out.EmitDwarfFileDirective(FileNumber, Filename);
return false;
}

View File

@ -1,5 +1,8 @@
# RUN: llvm-mc -triple i386-unknown-unknown %s
# FIXME: Actually test the output.
# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
.file "hello"
.file 1 "world"
# CHECK: .file "hello"
# CHECK: .file 1 "world"