diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:44:37 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-07-18 00:44:37 +0000 |
commit | 518310cb0d136906ff0a99d7a24cb460794de5bf (patch) | |
tree | d8ad6b32edf261c90ce2c190f4c74dc3d044502f /lib/Transforms/IPO/Inliner.cpp | |
parent | 593eb952281138e1877adbfb11b88b6e32fdd732 (diff) |
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 8fca96812b..ed5efe22ac 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "Inliner.h" -#include "llvm/Constants.h" // ConstantPointerRef should die #include "llvm/Module.h" #include "llvm/iOther.h" #include "llvm/iTerminators.h" @@ -174,9 +173,9 @@ bool Inliner::doFinalization(CallGraph &CG) { // If the only remaining use of the function is a dead constant // pointer ref, remove it. if (F && F->hasOneUse()) - if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(F->use_back())) - if (CPR->use_empty()) { - CPR->destroyConstant(); + if (Function *GV = dyn_cast<Function>(F->use_back())) + if (GV->removeDeadConstantUsers()) { + delete GV; if (F->hasInternalLinkage()) { // There *MAY* be an edge from the external call node to this // function. If so, remove it. |