Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API as
authorKevin Enderby <enderby@apple.com>
Mon, 20 Jul 2009 20:25:37 +0000 (20:25 +0000)
committerKevin Enderby <enderby@apple.com>
Mon, 20 Jul 2009 20:25:37 +0000 (20:25 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76462 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCStreamer.h
lib/MC/MCAsmStreamer.cpp
test/MC/AsmParser/directive_dump_and_load.s [deleted file]
tools/llvm-mc/AsmParser.cpp
tools/llvm-mc/AsmParser.h

index 7d92a16507ef7a46e0594976a9103271d929dd71..67fe8d402dcc97d98f79c4e146f7d9d9be63fcd2 100644 (file)
@@ -162,18 +162,6 @@ namespace llvm {
     /// @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
     /// @{
index e1812cee59ff77df47b9fb7d988a3a19b01d2ef4..a4a1525bee5c97826481982aee6b3382dbbba64d 100644 (file)
@@ -57,10 +57,6 @@ namespace {
 
     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::AbortAssembly(const char *AbortReason) {
   
 }
 
-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!");
diff --git a/test/MC/AsmParser/directive_dump_and_load.s b/test/MC/AsmParser/directive_dump_and_load.s
deleted file mode 100644 (file)
index c810244..0000000
+++ /dev/null
@@ -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"
index 066879ff48d0aeda586159b740aaf933d1c13c43..1b9ca052a31f2d4aae2229c7a2196e13d44e67d8 100644 (file)
@@ -539,9 +539,9 @@ bool AsmParser::ParseStatement() {
     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 @@ bool AsmParser::ParseDirectiveInclude() {
 
 /// 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 @@ bool AsmParser::ParseDirectiveDarwinDumpOrLoad(bool IsDump) {
   
   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;
 }
index d9f4b4c197be9915d5842cda70744ee3bab82ca5..b3190b124bd7e642229cc4c875b5445e7601c7f5 100644 (file)
@@ -127,7 +127,7 @@ private:
   // 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"