Change MachineInstrBuilder::addDisp to copy over target flags by default.
[oota-llvm.git] / include / llvm / Support / FormattedStream.h
index 09ab17c446e0b67ba507f238ffc2411affe17893..21635dcfb688f964a244daecef604745bbc23421 100644 (file)
@@ -1,4 +1,4 @@
-//===-- llvm/CodeGen/FormattedStream.h - Formatted streams ------*- C++ -*-===//
+//===-- llvm/Support/FormattedStream.h - Formatted streams ------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -55,14 +55,15 @@ namespace llvm
     ///
     const char *Scanned;
 
-    virtual void write_impl(const char *Ptr, size_t Size);
+    virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
 
     /// current_pos - Return the current position within the stream,
     /// not counting the bytes currently in the buffer.
-    virtual uint64_t current_pos() const { 
-      // This has the same effect as calling TheStream.current_pos(),
-      // but that interface is private.
-      return TheStream->tell() - TheStream->GetNumBytesInBuffer();
+    virtual uint64_t current_pos() const LLVM_OVERRIDE {
+      // Our current position in the stream is all the contents which have been
+      // written to the underlying stream (*not* the current position of the
+      // underlying stream).
+      return TheStream->tell();
     }
 
     /// ComputeColumn - Examine the given output buffer and figure out which
@@ -119,7 +120,7 @@ namespace llvm
     /// space.
     ///
     /// \param NewCol - The column to move to.
-    void PadToColumn(unsigned NewCol);
+    formatted_raw_ostream &PadToColumn(unsigned NewCol);
 
   private:
     void releaseStream() {
@@ -144,6 +145,10 @@ formatted_raw_ostream &fouts();
 /// standard error.  Use it like: ferrs() << "foo" << "bar";
 formatted_raw_ostream &ferrs();
 
+/// fdbgs() - This returns a reference to a formatted_raw_ostream for
+/// debug output.  Use it like: fdbgs() << "foo" << "bar";
+formatted_raw_ostream &fdbgs();
+
 } // end llvm namespace