summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2015-12-19 07:08:56 +0000
committerVedant Kumar <vsk@apple.com>2015-12-19 07:08:56 +0000
commitbe7525d4fa6258b56aebe061d0a670d172103225 (patch)
tree2d8c22808a0c1e89b2110bbb3383e382db5c5f00 /llvm/lib/IR/AsmWriter.cpp
parent034c4cd58aa757c5b7de8f1ffcf3cb3063ed294b (diff)
downloadbcm5719-llvm-be7525d4fa6258b56aebe061d0a670d172103225.tar.gz
bcm5719-llvm-be7525d4fa6258b56aebe061d0a670d172103225.zip
[IR] Move optional data in llvm::Function into a hungoff uselist
Make personality functions, prefix data, and prologue data hungoff operands of Function. This is based on the email thread "[RFC] Clean up the way we store optional Function data" on llvm-dev. Thanks to sanjoyd, majnemer, rnk, loladiro, and dexonsmith for feedback! Differential Revision: http://reviews.llvm.org/D13829 llvm-svn: 256090
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r--llvm/lib/IR/AsmWriter.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 51a0faee81c..124fc56e78f 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -103,17 +103,9 @@ static OrderMap orderModule(const Module *M) {
orderValue(&A, OM);
}
for (const Function &F : *M) {
- if (F.hasPrefixData())
- if (!isa<GlobalValue>(F.getPrefixData()))
- orderValue(F.getPrefixData(), OM);
-
- if (F.hasPrologueData())
- if (!isa<GlobalValue>(F.getPrologueData()))
- orderValue(F.getPrologueData(), OM);
-
- if (F.hasPersonalityFn())
- if (!isa<GlobalValue>(F.getPersonalityFn()))
- orderValue(F.getPersonalityFn(), OM);
+ for (const Use &U : F.operands())
+ if (!isa<GlobalValue>(U.get()))
+ orderValue(U.get(), OM);
orderValue(&F, OM);
@@ -263,8 +255,8 @@ static UseListOrderStack predictUseListOrder(const Module *M) {
for (const GlobalAlias &A : M->aliases())
predictValueUseListOrder(A.getAliasee(), nullptr, OM, Stack);
for (const Function &F : *M)
- if (F.hasPrefixData())
- predictValueUseListOrder(F.getPrefixData(), nullptr, OM, Stack);
+ for (const Use &U : F.operands())
+ predictValueUseListOrder(U.get(), nullptr, OM, Stack);
return Stack;
}
OpenPOWER on IntegriCloud