[llvm-commits] [llvm] r94438 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/directive_file.s
Chris Lattner
sabre at nondot.org
Mon Jan 25 11:02:59 PST 2010
Author: lattner
Date: Mon Jan 25 13:02:58 2010
New Revision: 94438
URL: http://llvm.org/viewvc/llvm-project?rev=94438&view=rev
Log:
wirte up .file and .file to the mc asmparser.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/directive_file.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=94438&r1=94437&r2=94438&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Mon Jan 25 13:02:58 2010
@@ -1708,14 +1708,18 @@
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;
}
Modified: llvm/trunk/test/MC/AsmParser/directive_file.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_file.s?rev=94438&r1=94437&r2=94438&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_file.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_file.s Mon Jan 25 13:02:58 2010
@@ -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"
+
More information about the llvm-commits
mailing list