diff options
author | Vedant Kumar <vsk@apple.com> | 2015-12-19 07:30:44 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2015-12-19 07:30:44 +0000 |
commit | e069c4b6d14d54e1d6e7656316b67ea573a4d48e (patch) | |
tree | 3cd25b069999bc65fb32fa6db44594a149a235f3 /llvm/lib/Bitcode | |
parent | be7525d4fa6258b56aebe061d0a670d172103225 (diff) | |
download | bcm5719-llvm-e069c4b6d14d54e1d6e7656316b67ea573a4d48e.tar.gz bcm5719-llvm-e069c4b6d14d54e1d6e7656316b67ea573a4d48e.zip |
Revert "[IR] Move optional data in llvm::Function into a hungoff uselist"
This reverts commit r256090.
This broke llvm-clang-lld-x86_64-debian-fast.
llvm-svn: 256091
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index faf82a7926e..2a9b4490ffb 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -87,9 +87,15 @@ static OrderMap orderModule(const Module &M) { if (!isa<GlobalValue>(A.getAliasee())) orderValue(A.getAliasee(), OM); for (const Function &F : M) { - for (const Use &U : F.operands()) - if (!isa<GlobalValue>(U.get())) - orderValue(U.get(), OM); + 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); } OM.LastGlobalConstantID = OM.size(); @@ -267,8 +273,12 @@ static UseListOrderStack predictUseListOrder(const Module &M) { for (const GlobalAlias &A : M.aliases()) predictValueUseListOrder(A.getAliasee(), nullptr, OM, Stack); for (const Function &F : M) { - for (const Use &U : F.operands()) - predictValueUseListOrder(U.get(), nullptr, OM, Stack); + if (F.hasPrefixData()) + predictValueUseListOrder(F.getPrefixData(), nullptr, OM, Stack); + if (F.hasPrologueData()) + predictValueUseListOrder(F.getPrologueData(), nullptr, OM, Stack); + if (F.hasPersonalityFn()) + predictValueUseListOrder(F.getPersonalityFn(), nullptr, OM, Stack); } return Stack; @@ -311,10 +321,20 @@ ValueEnumerator::ValueEnumerator(const Module &M, for (const GlobalAlias &GA : M.aliases()) EnumerateValue(GA.getAliasee()); - // Enumerate any optional Function data. + // Enumerate the prefix data constants. for (const Function &F : M) - for (const Use &U : F.operands()) - EnumerateValue(U.get()); + if (F.hasPrefixData()) + EnumerateValue(F.getPrefixData()); + + // Enumerate the prologue data constants. + for (const Function &F : M) + if (F.hasPrologueData()) + EnumerateValue(F.getPrologueData()); + + // Enumerate the personality functions. + for (Module::const_iterator I = M.begin(), E = M.end(); I != E; ++I) + if (I->hasPersonalityFn()) + EnumerateValue(I->getPersonalityFn()); // Enumerate the metadata type. // |