[llvm-commits] [llvm] r76602 - /llvm/trunk/include/llvm/Support/Dump.h

Bill Wendling isanbard at gmail.com
Tue Jul 21 14:37:51 PDT 2009


On Tue, Jul 21, 2009 at 11:21 AM, David Greene<greened at obbligato.org> wrote:
> Author: greened
> Date: Tue Jul 21 13:21:46 2009
> New Revision: 76602
>
> URL: http://llvm.org/viewvc/llvm-project?rev=76602&view=rev
> Log:
>
> Add a small utility class to configure IR printers.  This will allow
> printers to do neat and wonderful things when printing debug
> information.  The ideas is to allow passes to configer printers to emit
> pass-specific information when dumping IR.
>
> Added:
>    llvm/trunk/include/llvm/Support/Dump.h
>
> +#ifndef LLVM_SUPPORT_DUMP_H
> +#define LLVM_SUPPORT_DUMP_H
> +
> +namespace llvm {
> +
> +class MachineBasicBlock;
> +class MachineInstr;
> +
> +// PrefixPrinter - Print some additional information before printing
> +// basic blocks and instructions.
> +class PrefixPrinter {
> +public:
> +  virtual ~PrefixPrinter() {}
> +
> +  virtual std::string operator()(const MachineBasicBlock &) const {
> +    return("");
> +  };
> +
> +  virtual std::string operator()(const MachineInstr &) const {
> +    return("");
> +  };
> +};

This won't work because there's no "#include <string>" in this header.
And we don't want that in a header to begin with, if we can avoid it.
:) Why not make these pure-virtual methods?

I'm really not in love with this class at all...

-bw




More information about the llvm-commits mailing list