mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
uselistorder: Thread bit through ValueEnumerator
Canonicalize access to whether to preserve use-list order in bitcode on a `bool` stored in `ValueEnumerator`. Next step, expose this as a `bool` through `WriteBitcodeToFile()`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234956 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -2047,6 +2047,9 @@ static void WriteUseList(ValueEnumerator &VE, UseListOrder &&Order,
|
||||
|
||||
static void WriteUseListBlock(const Function *F, ValueEnumerator &VE,
|
||||
BitstreamWriter &Stream) {
|
||||
assert(VE.shouldPreserveUseListOrder() &&
|
||||
"Expected to be preserving use-list order");
|
||||
|
||||
auto hasMore = [&]() {
|
||||
return !VE.UseListOrders.empty() && VE.UseListOrders.back().F == F;
|
||||
};
|
||||
@ -2127,7 +2130,7 @@ static void WriteFunction(const Function &F, ValueEnumerator &VE,
|
||||
|
||||
if (NeedsMetadataAttachment)
|
||||
WriteMetadataAttachment(F, VE, Stream);
|
||||
if (shouldPreserveBitcodeUseListOrder())
|
||||
if (VE.shouldPreserveUseListOrder())
|
||||
WriteUseListBlock(&F, VE, Stream);
|
||||
VE.purgeFunction();
|
||||
Stream.ExitBlock();
|
||||
@ -2318,7 +2321,7 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
|
||||
Stream.EmitRecord(bitc::MODULE_CODE_VERSION, Vals);
|
||||
|
||||
// Analyze the module, enumerating globals, functions, etc.
|
||||
ValueEnumerator VE(*M);
|
||||
ValueEnumerator VE(*M, shouldPreserveBitcodeUseListOrder());
|
||||
|
||||
// Emit blockinfo, which defines the standard abbreviations etc.
|
||||
WriteBlockInfo(VE, Stream);
|
||||
@ -2351,7 +2354,7 @@ static void WriteModule(const Module *M, BitstreamWriter &Stream) {
|
||||
WriteValueSymbolTable(M->getValueSymbolTable(), VE, Stream);
|
||||
|
||||
// Emit module-level use-lists.
|
||||
if (shouldPreserveBitcodeUseListOrder())
|
||||
if (VE.shouldPreserveUseListOrder())
|
||||
WriteUseListBlock(nullptr, VE, Stream);
|
||||
|
||||
// Emit function bodies.
|
||||
|
Reference in New Issue
Block a user