diff options
| author | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
|---|---|---|
| committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-14 09:23:33 +0000 |
| commit | 600c6fa13de5c407dc36dbb0ab73807868741ae0 (patch) | |
| tree | 49817b316c4fdaa56d9d16ebf2555303d1a990e0 /lib/Transforms/IPO/GlobalDCE.cpp | |
| parent | 93338c197185f946619794ce011ec27b5b6250e2 (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/IPO/GlobalDCE.cpp')
| -rw-r--r-- | lib/Transforms/IPO/GlobalDCE.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index db378b0d0b286..9c652b996aebb 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -47,7 +47,6 @@ namespace { void GlobalIsNeeded(GlobalValue *GV); void MarkUsedGlobalsAsNeeded(Constant *C); - bool SafeToDestroyConstant(Constant* C); bool RemoveUnusedGlobalValue(GlobalValue &GV); }; } @@ -211,17 +210,3 @@ bool GlobalDCE::RemoveUnusedGlobalValue(GlobalValue &GV) { GV.removeDeadConstantUsers(); return GV.use_empty(); } - -// SafeToDestroyConstant - It is safe to destroy a constant iff it is only used -// by constants itself. Note that constants cannot be cyclic, so this test is -// pretty easy to implement recursively. -// -bool GlobalDCE::SafeToDestroyConstant(Constant *C) { - for (Value::use_iterator I = C->use_begin(), E = C->use_end(); I != E; ++I) - if (Constant *User = dyn_cast<Constant>(*I)) { - if (!SafeToDestroyConstant(User)) return false; - } else { - return false; - } - return true; -} |
