class TargetData;
class TargetRegisterClass;
+class MachineFunction;
#include <vector>
class MachineFrameInfo {
/// print - Used by the MachineFunction printer to print information about
/// stack objects. Implemented in MachineFunction.cpp
///
- void print(std::ostream &OS) const;
+ void print(const MachineFunction &MF, std::ostream &OS) const;
- /// dump - Call print(std::cerr) to be called from the debugger.
- void dump() const;
+ /// dump - Call print(MF, std::cerr) to be called from the debugger.
+ void dump(const MachineFunction &MF) const;
};
#endif
<< "\"\n";
// Print Frame Information
- getFrameInfo()->print(OS);
+ getFrameInfo()->print(*this, OS);
// Print Constant Pool
getConstantPool()->print(OS);
}
-void MachineFrameInfo::print(std::ostream &OS) const {
+void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
+ int ValOffset = MF.getTarget().getFrameInfo().getOffsetOfLocalArea();
+
for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
const StackObject &SO = Objects[i];
OS << " <fi #" << (int)(i-NumFixedObjects) << "> is ";
if (i < NumFixedObjects)
OS << " fixed";
if (i < NumFixedObjects || SO.SPOffset != -1) {
+ int Off = SO.SPOffset + ValOffset;
OS << " at location [SP";
- if (SO.SPOffset > 0)
- OS << "+" << SO.SPOffset;
- else if (SO.SPOffset < 0)
- OS << SO.SPOffset;
+ if (Off > 0)
+ OS << "+" << Off;
+ else if (Off < 0)
+ OS << Off;
OS << "]";
}
OS << "\n";
OS << " Stack frame contains variable sized objects\n";
}
-void MachineFrameInfo::dump() const { print(std::cerr); }
+void MachineFrameInfo::dump(const MachineFunction &MF) const {
+ print(MF, std::cerr);
+}
//===----------------------------------------------------------------------===//