[llvm-commits] CVS: llvm/lib/CodeGen/LiveInterval.cpp MachineBasicBlock.cpp MachineInstr.cpp

Bill Wendling isanbard at gmail.com
Fri Dec 15 15:10:53 PST 2006


Hold on. If you make these non-inlined, then the only chance for the  
compiler to remove potentially dead code (when o.stream() == 0) is  
through link time optimizations. Because this is still compiled by  
GCC right now, this won't be done and debug outputs will still be in  
the code. That is, they won't output anything, but the call will  
still be there.

-bw

On Dec 15, 2006, at 2:57 PM, Jeff Cohen wrote:

>
>
> Changes in directory llvm/lib/CodeGen:
>
> LiveInterval.cpp updated: 1.40 -> 1.41
> MachineBasicBlock.cpp updated: 1.36 -> 1.37
> MachineInstr.cpp updated: 1.138 -> 1.139
> ---
> Log message:
>
> An even better unbreakage...
>
> ---
> Diffs of the changes:  (+24 -0)
>
>  LiveInterval.cpp      |    7 +++++++
>  MachineBasicBlock.cpp |    5 +++++
>  MachineInstr.cpp      |   12 ++++++++++++
>  3 files changed, 24 insertions(+)
>
>
> Index: llvm/lib/CodeGen/LiveInterval.cpp
> diff -u llvm/lib/CodeGen/LiveInterval.cpp:1.40 llvm/lib/CodeGen/ 
> LiveInterval.cpp:1.41
> --- llvm/lib/CodeGen/LiveInterval.cpp:1.40	Wed Dec  6 19:30:31 2006
> +++ llvm/lib/CodeGen/LiveInterval.cpp	Fri Dec 15 16:57:14 2006
> @@ -24,6 +24,7 @@
>  #include "llvm/Target/MRegisterInfo.h"
>  #include <algorithm>
>  #include <map>
> +#include <ostream>
>  using namespace llvm;
>
>  // An example for liveAt():
> @@ -509,3 +510,9 @@
>  void LiveInterval::dump() const {
>    cerr << *this << "\n";
>  }
> +
> +
> +OStream& llvm::operator<<(OStream& os, const LiveRange &LR) {
> +  if (os.stream()) *os.stream() << LR;
> +  return os;
> +}
>
>
> Index: llvm/lib/CodeGen/MachineBasicBlock.cpp
> diff -u llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36 llvm/lib/ 
> CodeGen/MachineBasicBlock.cpp:1.37
> --- llvm/lib/CodeGen/MachineBasicBlock.cpp:1.36	Thu Dec  7 14:28:15  
> 2006
> +++ llvm/lib/CodeGen/MachineBasicBlock.cpp	Fri Dec 15 16:57:14 2006
> @@ -31,6 +31,11 @@
>    return OS;
>  }
>
> +OStream& llvm::operator<<(OStream &OS, const MachineBasicBlock  
> &MBB) {
> +  if (OS.stream()) *OS.stream() << MBB;
> +  return OS;
> +}
> +
>  // MBBs start out as #-1. When a MBB is added to a  
> MachineFunction, it
>  // gets the next available unique MBB number. If it is removed from a
>  // MachineFunction, it goes back to being #-1.
>
>
> Index: llvm/lib/CodeGen/MachineInstr.cpp
> diff -u llvm/lib/CodeGen/MachineInstr.cpp:1.138 llvm/lib/CodeGen/ 
> MachineInstr.cpp:1.139
> --- llvm/lib/CodeGen/MachineInstr.cpp:1.138	Wed Dec  6 19:30:31 2006
> +++ llvm/lib/CodeGen/MachineInstr.cpp	Fri Dec 15 16:57:14 2006
> @@ -18,6 +18,7 @@
>  #include "llvm/Target/MRegisterInfo.h"
>  #include "llvm/Support/LeakDetector.h"
>  #include "llvm/Support/Streams.h"
> +#include <ostream>
>  using namespace llvm;
>
>  /// MachineInstr ctor - This constructor creates a dummy  
> MachineInstr with
> @@ -363,3 +364,14 @@
>
>    return OS;
>  }
> +
> +OStream& llvm::operator<<(OStream& os, const MachineInstr& minstr) {
> +  if (os.stream()) *os.stream() << minstr;
> +  return os;
> +}
> +
> +OStream& llvm::operator<<(OStream& os, const MachineOperand& mop) {
> +  if (os.stream()) *os.stream() << mop;
> +  return os;
> +}
> +
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list