aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2008-11-03 11:16:43 +0000
committerMatthijs Kooijman <matthijs@stdin.nl>2008-11-03 11:16:43 +0000
commit2530f5fe4324ddbed07c9a9b44fca63e81e96c0e (patch)
tree21b1e901c5aebd0075af59de48252fefc900b07f /llvm/lib/CodeGen/MachineFunction.cpp
parent8cc7be369c9467383d08576fdd433d771835fb92 (diff)
downloadllvm-2530f5fe4324ddbed07c9a9b44fca63e81e96c0e.zip
llvm-2530f5fe4324ddbed07c9a9b44fca63e81e96c0e.tar.gz
llvm-2530f5fe4324ddbed07c9a9b44fca63e81e96c0e.tar.bz2
Make MachineFrameInfo::print not crash when no TargetFrameInfo is available.
llvm-svn: 58606
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 3229f072..b14c19d 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -396,7 +396,8 @@ int MachineFrameInfo::CreateFixedObject(uint64_t Size, int64_t SPOffset,
void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
- int ValOffset = MF.getTarget().getFrameInfo()->getOffsetOfLocalArea();
+ const TargetFrameInfo *FI = MF.getTarget().getFrameInfo();
+ int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
const StackObject &SO = Objects[i];