diff options
author | Chris Lattner <sabre@nondot.org> | 2010-01-25 19:02:58 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-01-25 19:02:58 +0000 |
commit | d45adf28de2f92242335d65ea3a3060ef638182c (patch) | |
tree | 70f7cfe9d023319c0a461c9175bf3f5b6e806cf0 /llvm | |
parent | 601ef33c77349054b35434d9f53893068707c8f0 (diff) | |
download | bcm5719-llvm-d45adf28de2f92242335d65ea3a3060ef638182c.tar.gz bcm5719-llvm-d45adf28de2f92242335d65ea3a3060ef638182c.zip |
wirte up .file and .file to the mc asmparser.
llvm-svn: 94438
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 10 | ||||
-rw-r--r-- | llvm/test/MC/AsmParser/directive_file.s | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index 077d2dffa65..d5bc396103f 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -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; } diff --git a/llvm/test/MC/AsmParser/directive_file.s b/llvm/test/MC/AsmParser/directive_file.s index ec0b9543b94..3160d5c2bfd 100644 --- a/llvm/test/MC/AsmParser/directive_file.s +++ b/llvm/test/MC/AsmParser/directive_file.s @@ -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" + |