[llvm-commits] [llvm] r94230 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DIE.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/CodeGen/AsmPrinter/DwarfException.cpp lib/CodeGen/AsmPrinter/DwarfPrinter.cpp lib/CodeGen/AsmPrinter/DwarfPrinter.h lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp

Chris Lattner sabre at nondot.org
Fri Jan 22 14:09:00 PST 2010


Author: lattner
Date: Fri Jan 22 16:09:00 2010
New Revision: 94230

URL: http://llvm.org/viewvc/llvm-project?rev=94230&view=rev
Log:
inline away the trivial AsmPrinter::EOL() method.

Modified:
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
    llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Jan 22 16:09:00 2010
@@ -262,7 +262,6 @@
 
     /// EOL - Print a newline character to asm stream.  If a comment is present
     /// then it will be printed first.  Comments should not contain '\n'.
-    void EOL() const;
     void EOL(const Twine &Comment) const;
     void EOL(const Twine &Comment, unsigned Encoding) const;
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Jan 22 16:09:00 2010
@@ -695,10 +695,6 @@
 
 /// EOL - Print a newline character to asm stream.  If a comment is present
 /// then it will be printed first.  Comments should not contain '\n'.
-void AsmPrinter::EOL() const {
-  O << '\n';
-}
-
 void AsmPrinter::EOL(const Twine &Comment) const {
   if (VerboseAsm && !Comment.isTriviallyEmpty()) {
     O.PadToColumn(MAI->getCommentColumn());

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.cpp Fri Jan 22 16:09:00 2010
@@ -22,6 +22,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/Format.h"
+#include "llvm/Support/FormattedStream.h"
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
@@ -400,7 +401,7 @@
 
   const SmallVector<DIEAbbrevData, 8> &AbbrevData = Abbrev.getData();
   for (unsigned i = 0, N = Values.size(); i < N; ++i) {
-    Asm->EOL();
+    Asm->O << '\n';
     Values[i]->EmitValue(D, AbbrevData[i].getForm());
   }
 }

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Jan 22 16:09:00 2010
@@ -26,6 +26,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/System/Path.h"
 using namespace llvm;
@@ -1771,13 +1772,15 @@
     for (unsigned i = 1, e = getNumSourceIds()+1; i != e; ++i) {
       // Remember source id starts at 1.
       std::pair<unsigned, unsigned> Id = getSourceDirectoryAndFileIds(i);
+      // FIXME: don't use sys::path for this!  This should not depend on the
+      // host.
       sys::Path FullPath(getSourceDirectoryName(Id.first));
       bool AppendOk =
         FullPath.appendComponent(getSourceFileName(Id.second));
       assert(AppendOk && "Could not append filename to directory!");
       AppendOk = false;
       Asm->EmitFile(i, FullPath.str());
-      Asm->EOL();
+      Asm->O << '\n';
     }
   }
 
@@ -2345,7 +2348,7 @@
   unsigned AbbrevNumber = Die->getAbbrevNumber();
   const DIEAbbrev *Abbrev = Abbreviations[AbbrevNumber - 1];
 
-  Asm->EOL();
+  Asm->O << '\n';
 
   // Emit the code (index) for the abbreviation.
   Asm->EmitULEB128Bytes(AbbrevNumber);
@@ -2426,8 +2429,7 @@
   Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
   Asm->EmitInt8(0); Asm->EOL("Extra Pad For GDB");
   EmitLabel("info_end", ModuleCU->getID());
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// emitAbbreviations - Emit the abbreviation section.
@@ -2452,15 +2454,14 @@
 
       // Emit the abbreviations data.
       Abbrev->Emit(Asm);
-
-      Asm->EOL();
+      Asm->O << '\n';
     }
 
     // Mark end of abbreviations.
     Asm->EmitULEB128Bytes(0); Asm->EOL("EOM(3)");
 
     EmitLabel("abbrev_end", 0);
-    Asm->EOL();
+    Asm->O << '\n';
   }
 }
 
@@ -2476,8 +2477,10 @@
 
   // Mark end of matrix.
   Asm->EmitInt8(0); Asm->EOL("DW_LNE_end_sequence");
-  Asm->EmitULEB128Bytes(1); Asm->EOL();
-  Asm->EmitInt8(1); Asm->EOL();
+  Asm->EmitULEB128Bytes(1);
+  Asm->O << '\n';
+  Asm->EmitInt8(1);
+  Asm->O << '\n';
 }
 
 /// emitDebugLines - Emit source line information.
@@ -2567,7 +2570,7 @@
       O << '\t' << MAI->getCommentString() << " Section"
         << S->getName() << '\n';
     }*/
-    Asm->EOL();
+    Asm->O << '\n';
 
     // Dwarf assumes we start with first line of first source file.
     unsigned Source = 1;
@@ -2582,7 +2585,7 @@
       if (LineInfo.getLine() == 0) continue;
 
       if (!Asm->isVerbose())
-        Asm->EOL();
+        Asm->O << '\n';
       else {
         std::pair<unsigned, unsigned> SourceID =
           getSourceDirectoryAndFileIds(LineInfo.getSourceID());
@@ -2641,7 +2644,7 @@
     emitEndOfLineMatrix(1);
 
   EmitLabel("line_end", 0);
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// emitCommonDebugFrame - Emit common frame info into a debug frame section.
@@ -2685,8 +2688,7 @@
 
   Asm->EmitAlignment(2, 0, 0, false);
   EmitLabel("debug_frame_common_end", 0);
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// emitFunctionDebugFrame - Emit per function frame info into a debug frame
@@ -2721,8 +2723,7 @@
 
   Asm->EmitAlignment(2, 0, 0, false);
   EmitLabel("debug_frame_end", DebugFrameInfo.Number);
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// emitDebugPubNames - Emit visible names into a debug pubnames section.
@@ -2760,8 +2761,7 @@
 
   Asm->EmitInt32(0); Asm->EOL("End Mark");
   EmitLabel("pubnames_end", ModuleCU->getID());
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 void DwarfDebug::emitDebugPubTypes() {
@@ -2796,8 +2796,7 @@
 
   Asm->EmitInt32(0); Asm->EOL("End Mark");
   EmitLabel("pubtypes_end", ModuleCU->getID());
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// emitDebugStr - Emit visible names into a debug str section.
@@ -2817,10 +2816,11 @@
 
       // Emit the string itself.
       const std::string &String = StringPool[StringID];
-      Asm->EmitString(String); Asm->EOL();
+      Asm->EmitString(String);
+      Asm->O << '\n';
     }
 
-    Asm->EOL();
+    Asm->O << '\n';
   }
 }
 
@@ -2830,7 +2830,6 @@
   // Start the dwarf loc section.
   Asm->OutStreamer.SwitchSection(
                               Asm->getObjFileLowering().getDwarfLocSection());
-  Asm->EOL();
 }
 
 /// EmitDebugARanges - Emit visible names into a debug aranges section.
@@ -2866,8 +2865,6 @@
   Asm->EmitInt32(0); Asm->EOL("EOM (1)");
   Asm->EmitInt32(0); Asm->EOL("EOM (2)");
 #endif
-
-  Asm->EOL();
 }
 
 /// emitDebugRanges - Emit visible names into a debug ranges section.
@@ -2876,7 +2873,6 @@
   // Start the dwarf ranges section.
   Asm->OutStreamer.SwitchSection(
                             Asm->getObjFileLowering().getDwarfRangesSection());
-  Asm->EOL();
 }
 
 /// emitDebugMacInfo - Emit visible names into a debug macinfo section.
@@ -2886,7 +2882,6 @@
       Asm->getObjFileLowering().getDwarfMacroInfoSection()) {
     // Start the dwarf macinfo section.
     Asm->OutStreamer.SwitchSection(LineInfo);
-    Asm->EOL();
   }
 }
 
@@ -2917,7 +2912,7 @@
 
   Asm->OutStreamer.SwitchSection(
                         Asm->getObjFileLowering().getDwarfDebugInlineSection());
-  Asm->EOL();
+
   EmitDifference("debug_inlined_end", 1,
                  "debug_inlined_begin", 1, true);
   Asm->EOL("Length of Debug Inlined Information Entry");
@@ -2965,5 +2960,5 @@
   }
 
   EmitLabel("debug_inlined_end", 1);
-  Asm->EOL();
+  Asm->O << '\n';
 }

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfException.cpp Fri Jan 22 16:09:00 2010
@@ -30,8 +30,8 @@
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Support/Dwarf.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
-#include "llvm/Support/raw_ostream.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringExtras.h"
 using namespace llvm;
@@ -214,8 +214,7 @@
   // holes which confuse readers of eh_frame.
   Asm->EmitAlignment(TD->getPointerSize() == 4 ? 2 : 3, 0, 0, false);
   EmitLabel("eh_frame_common_end", Index);
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// EmitFDE - Emit the Frame Description Entry (FDE) for the function.
@@ -325,12 +324,10 @@
     // on unused functions (calling undefined externals) being dead-stripped to
     // link correctly.  Yes, there really is.
     if (MMI->isUsedFunction(EHFrameInfo.function))
-      if (const char *UsedDirective = MAI->getUsedDirective()) {
+      if (const char *UsedDirective = MAI->getUsedDirective())
         O << UsedDirective << *EHFrameInfo.FunctionEHSym << "\n\n";
-      }
   }
-
-  Asm->EOL();
+  Asm->O << '\n';
 }
 
 /// SharedTypeIds - How many leading type ids two landing pads have in common.
@@ -942,7 +939,7 @@
     if (TypeID != 0)
       Asm->EOL("Exception specification");
     else
-      Asm->EOL();
+      Asm->O << '\n';
   }
 
   Asm->EmitAlignment(2, 0, 0, false);

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp Fri Jan 22 16:09:00 2010
@@ -174,7 +174,7 @@
       Asm->EmitInt8(dwarf::DW_CFA_advance_loc4);
       Asm->EOL("DW_CFA_advance_loc4");
       EmitDifference("label", LabelID, BaseLabel, BaseLabelID, true);
-      Asm->EOL();
+      Asm->O << '\n';
 
       BaseLabelID = LabelID;
       BaseLabel = "label";

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfPrinter.h Fri Jan 22 16:09:00 2010
@@ -17,7 +17,7 @@
 #include "DwarfLabel.h"
 #include "llvm/CodeGen/MachineLocation.h"
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/FormattedStream.h"
 #include <vector>
 
 namespace llvm {

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp?rev=94230&r1=94229&r2=94230&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp Fri Jan 22 16:09:00 2010
@@ -21,7 +21,7 @@
 #include "llvm/Target/TargetLoweringObjectFile.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/FormattedStream.h"
 using namespace llvm;
 
 namespace {
@@ -105,8 +105,7 @@
   AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getDataSection());
   EmitCamlGlobal(getModule(), OS, AP, MAI, "data_end");
 
-  OS << AddressDirective << 0; // FIXME: Why does ocaml emit this??
-  AP.EOL();
+  OS << AddressDirective << 0 << '\n'; // FIXME: Why does ocaml emit this??
 
   AP.OutStreamer.SwitchSection(AP.getObjFileLowering().getDataSection());
   EmitCamlGlobal(getModule(), OS, AP, MAI, "frametable");





More information about the llvm-commits mailing list