[llvm-commits] [llvm] r76462 - in /llvm/trunk: include/llvm/MC/MCStreamer.h lib/MC/MCAsmStreamer.cpp test/MC/AsmParser/directive_dump_and_load.s tools/llvm-mc/AsmParser.cpp tools/llvm-mc/AsmParser.h

Kevin Enderby enderby at apple.com
Mon Jul 20 13:25:37 PDT 2009


Author: enderby
Date: Mon Jul 20 15:25:37 2009
New Revision: 76462

URL: http://llvm.org/viewvc/llvm-project?rev=76462&view=rev
Log:
Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API as
the parsing of the .dump and .load should be done in the assembly parser and
not have any need for an MCStreamer API.  Changed the code for now so these
just produce an error saying these specific directives are not yet implemented
since they are likely no longer used and may never need to be implemented.

Removed:
    llvm/trunk/test/MC/AsmParser/directive_dump_and_load.s
Modified:
    llvm/trunk/include/llvm/MC/MCStreamer.h
    llvm/trunk/lib/MC/MCAsmStreamer.cpp
    llvm/trunk/tools/llvm-mc/AsmParser.cpp
    llvm/trunk/tools/llvm-mc/AsmParser.h

Modified: llvm/trunk/include/llvm/MC/MCStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCStreamer.h?rev=76462&r1=76461&r2=76462&view=diff

==============================================================================
--- llvm/trunk/include/llvm/MC/MCStreamer.h (original)
+++ llvm/trunk/include/llvm/MC/MCStreamer.h Mon Jul 20 15:25:37 2009
@@ -162,18 +162,6 @@
     /// @param AbortReason - The reason assembly is terminated, if non-NULL.
     virtual void AbortAssembly(const char *AbortReason) = 0;
 
-    /// DumpSymbolsandMacros - Dump to the specified file in @param FileName all
-    /// symbols and macros at this point in the assembly.
-    ///
-    /// @param FileName - The file to dump the symbols and macros into.
-    virtual void DumpSymbolsandMacros(const char *FileName) = 0;
-
-    /// LoadSymbolsandMacros - Load from the specified file in @param FileName
-    /// symbols and macros into the assembler at this point in the assembly.
-    ///
-    /// @param FileName - The file to load the symbols and macros from.
-    virtual void LoadSymbolsandMacros(const char *FileName) = 0;
-
     /// @}
     /// @name Generating Data
     /// @{

Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=76462&r1=76461&r2=76462&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Mon Jul 20 15:25:37 2009
@@ -57,10 +57,6 @@
 
     virtual void AbortAssembly(const char *AbortReason = NULL);
 
-    virtual void DumpSymbolsandMacros(const char *FileName);
-
-    virtual void LoadSymbolsandMacros(const char *FileName);
-
     virtual void EmitBytes(const char *Data, unsigned Length);
 
     virtual void EmitValue(const MCValue &Value, unsigned Size);
@@ -144,14 +140,6 @@
   
 }
 
-void MCAsmStreamer::DumpSymbolsandMacros(const char *FileName) {
-  OS << ".dump" << ' ' << FileName << '\n';
-}
-
-void MCAsmStreamer::LoadSymbolsandMacros(const char *FileName) {
-  OS << ".load" << ' ' << FileName << '\n';
-}
-
 void MCAsmStreamer::EmitAssignment(MCSymbol *Symbol, const MCValue &Value,
                                    bool MakeAbsolute) {
   assert(!Symbol->getSection() && "Cannot assign to a label!");

Removed: llvm/trunk/test/MC/AsmParser/directive_dump_and_load.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/directive_dump_and_load.s?rev=76461&view=auto

==============================================================================
--- llvm/trunk/test/MC/AsmParser/directive_dump_and_load.s (original)
+++ llvm/trunk/test/MC/AsmParser/directive_dump_and_load.s (removed)
@@ -1,8 +0,0 @@
-# RUN: llvm-mc -triple i386-unknown-unknown %s | FileCheck %s
-
-# CHECK: TEST0:
-# CHECK: .dump "somefile"
-# CHECK: .load "jack and jill"
-TEST0:  
-	.dump       "somefile"
- .load  "jack and jill"

Modified: llvm/trunk/tools/llvm-mc/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.cpp?rev=76462&r1=76461&r2=76462&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.cpp (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.cpp Mon Jul 20 15:25:37 2009
@@ -539,9 +539,9 @@
     if (!strcmp(IDVal, ".include"))
       return ParseDirectiveInclude();
     if (!strcmp(IDVal, ".dump"))
-      return ParseDirectiveDarwinDumpOrLoad(/*IsDump=*/true);
+      return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsDump=*/true);
     if (!strcmp(IDVal, ".load"))
-      return ParseDirectiveDarwinDumpOrLoad(/*IsLoad=*/false);
+      return ParseDirectiveDarwinDumpOrLoad(IDLoc, /*IsLoad=*/false);
 
     Warning(IDLoc, "ignoring directive for now");
     EatToEndOfStatement();
@@ -1197,11 +1197,11 @@
 
 /// ParseDirectiveDarwinDumpOrLoad
 ///  ::= ( .dump | .load ) "filename"
-bool AsmParser::ParseDirectiveDarwinDumpOrLoad(bool IsDump) {
+bool AsmParser::ParseDirectiveDarwinDumpOrLoad(SMLoc IDLoc, bool IsDump) {
   if (Lexer.isNot(asmtok::String))
     return TokError("expected string in '.dump' or '.load' directive");
   
-  const char *Str = Lexer.getCurStrVal();
+  Lexer.getCurStrVal();
 
   Lexer.Lex();
 
@@ -1210,10 +1210,12 @@
   
   Lexer.Lex();
 
+  // FIXME: If/when .dump and .load are implemented they will be done in the
+  // the assembly parser and not have any need for an MCStreamer API.
   if (IsDump)
-    Out.DumpSymbolsandMacros(Str);
+    Warning(IDLoc, "ignoring directive .dump for now");
   else
-    Out.LoadSymbolsandMacros(Str);
+    Warning(IDLoc, "ignoring directive .load for now");
 
   return false;
 }

Modified: llvm/trunk/tools/llvm-mc/AsmParser.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/AsmParser.h?rev=76462&r1=76461&r2=76462&view=diff

==============================================================================
--- llvm/trunk/tools/llvm-mc/AsmParser.h (original)
+++ llvm/trunk/tools/llvm-mc/AsmParser.h Mon Jul 20 15:25:37 2009
@@ -127,7 +127,7 @@
   // Darwin specific ".subsections_via_symbols"
   bool ParseDirectiveDarwinSubsectionsViaSymbols();
   // Darwin specific .dump and .load
-  bool ParseDirectiveDarwinDumpOrLoad(bool IsDump);
+  bool ParseDirectiveDarwinDumpOrLoad(SMLoc IDLoc, bool IsDump);
 
   bool ParseDirectiveAbort(); // ".abort"
   bool ParseDirectiveInclude(); // ".include"





More information about the llvm-commits mailing list