wirte up .file and .file to the mc asmparser.
[oota-llvm.git] / lib / MC / MCParser / AsmParser.cpp
index 077d2dffa65ab2ee697c456aa5cc486579fd4ac3..d5bc396103fe4b32da158c8461ff31a767cd46a0 100644 (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;
 }