summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Globals.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-02-15 21:27:20 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-02-15 21:27:20 +0000
commit780d2fe31929c597af6f41cd06dad75241c38ddf (patch)
treead7a08f5cf8ca08626d35f9ec55051a4f0c4fa87 /llvm/lib/VMCore/Globals.cpp
parent3818d9763d1317ed7964ceee33e55561a5b54103 (diff)
downloadbcm5719-llvm-780d2fe31929c597af6f41cd06dad75241c38ddf.tar.gz
bcm5719-llvm-780d2fe31929c597af6f41cd06dad75241c38ddf.zip
A function with no Module owner isn't materializable. This fixes F->dump() for
functions not embedded within modules. llvm-svn: 96272
Diffstat (limited to 'llvm/lib/VMCore/Globals.cpp')
-rw-r--r--llvm/lib/VMCore/Globals.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Globals.cpp b/llvm/lib/VMCore/Globals.cpp
index f149c446b43..489ec650e07 100644
--- a/llvm/lib/VMCore/Globals.cpp
+++ b/llvm/lib/VMCore/Globals.cpp
@@ -44,10 +44,10 @@ static bool removeDeadUsersOfConstant(const Constant *C) {
}
bool GlobalValue::isMaterializable() const {
- return getParent()->isMaterializable(this);
+ return getParent() && getParent()->isMaterializable(this);
}
bool GlobalValue::isDematerializable() const {
- return getParent()->isDematerializable(this);
+ return getParent() && getParent()->isDematerializable(this);
}
bool GlobalValue::Materialize(std::string *ErrInfo) {
return getParent()->Materialize(this, ErrInfo);
OpenPOWER on IntegriCloud