diff options
| author | Nick Lewycky <nicholas@mxc.ca> | 2010-02-15 21:27:20 +0000 |
|---|---|---|
| committer | Nick Lewycky <nicholas@mxc.ca> | 2010-02-15 21:27:20 +0000 |
| commit | eddc3a75ce105cc5c4d8520ff95183dd25cb59d5 (patch) | |
| tree | 85dee6fdbaafdb9987c7c8587a389d7d1b583e17 | |
| parent | d44f0724efb4bae8911427ebcb41c73a21727584 (diff) | |
| download | external_llvm-eddc3a75ce105cc5c4d8520ff95183dd25cb59d5.zip external_llvm-eddc3a75ce105cc5c4d8520ff95183dd25cb59d5.tar.gz external_llvm-eddc3a75ce105cc5c4d8520ff95183dd25cb59d5.tar.bz2 | |
A function with no Module owner isn't materializable. This fixes F->dump() for
functions not embedded within modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96272 91177308-0d34-0410-b5e6-96231b3b80d8
| -rw-r--r-- | lib/VMCore/Globals.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/VMCore/Globals.cpp b/lib/VMCore/Globals.cpp index f149c44..489ec65 100644 --- a/lib/VMCore/Globals.cpp +++ b/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); |
