mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-21 00:32:23 +00:00
b71d1b2fe2
This definitely slows down asm output so put it under an -asm-exuberant flag. This information is useful when doing static analysis of performance issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78567 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
//===----------------- IOManip.h - iostream manipulators ---------*- C++ -*===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Manipulators to do special-purpose formatting.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
namespace llvm {
|
|
/// Indent - Insert spaces into the character output stream. The
|
|
/// "level" is multiplied by the "scale" to calculate the number of
|
|
/// spaces to insert. "level" can represent something like loop
|
|
/// nesting level, for example.
|
|
///
|
|
class Indent {
|
|
public:
|
|
explicit Indent(int lvl, int amt = 2)
|
|
: level(lvl), scale(amt) {}
|
|
|
|
template<typename OStream>
|
|
OStream &operator()(OStream &out) const {
|
|
for(int i = 0; i < level*scale; ++i) {
|
|
out << " ";
|
|
}
|
|
return out;
|
|
}
|
|
|
|
private:
|
|
int level;
|
|
int scale;
|
|
};
|
|
|
|
template<typename OStream>
|
|
OStream &operator<<(OStream &out, const Indent &indent)
|
|
{
|
|
return(indent(out));
|
|
}
|
|
}
|