diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2013-09-16 01:08:15 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2013-09-16 01:08:15 +0000 |
commit | 1e3037f0be430ef2339838bbdede11f45658bd82 (patch) | |
tree | 685847478f3c9e31c3e1fa7f63f5f605e5f43f80 /lib/Transforms/IPO | |
parent | fabfb5d5880354983c89c6f475312dd359e5bb03 (diff) | |
download | external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.zip external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.tar.gz external_llvm-1e3037f0be430ef2339838bbdede11f45658bd82.tar.bz2 |
Implement function prefix data as an IR feature.
Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html
Differential Revision: http://llvm-reviews.chandlerc.com/D1191
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r-- | lib/Transforms/IPO/GlobalDCE.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/GlobalDCE.cpp b/lib/Transforms/IPO/GlobalDCE.cpp index 201f320..901295d 100644 --- a/lib/Transforms/IPO/GlobalDCE.cpp +++ b/lib/Transforms/IPO/GlobalDCE.cpp @@ -179,6 +179,9 @@ void GlobalDCE::GlobalIsNeeded(GlobalValue *G) { // any globals used will be marked as needed. Function *F = cast<Function>(G); + if (F->hasPrefixData()) + MarkUsedGlobalsAsNeeded(F->getPrefixData()); + for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) for (User::op_iterator U = I->op_begin(), E = I->op_end(); U != E; ++U) |