mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
UseListOrder: Don't give constant IDs to GlobalValues
Since initializers of GlobalValues are being assigned IDs before GlobalValues themselves, explicitly exclude GlobalValues from the constant pool. Added targeted test in `test/Bitcode/use-list-order.ll` and added two more RUN lines in `test/Assembly`. This is part of PR5680. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -80,12 +80,15 @@ static OrderMap orderModule(const Module *M) {
|
||||
// implicitly.
|
||||
for (const GlobalVariable &G : M->globals())
|
||||
if (G.hasInitializer())
|
||||
orderValue(G.getInitializer(), OM);
|
||||
if (!isa<GlobalValue>(G.getInitializer()))
|
||||
orderValue(G.getInitializer(), OM);
|
||||
for (const GlobalAlias &A : M->aliases())
|
||||
orderValue(A.getAliasee(), OM);
|
||||
if (!isa<GlobalValue>(A.getAliasee()))
|
||||
orderValue(A.getAliasee(), OM);
|
||||
for (const Function &F : *M)
|
||||
if (F.hasPrefixData())
|
||||
orderValue(F.getPrefixData(), OM);
|
||||
if (!isa<GlobalValue>(F.getPrefixData()))
|
||||
orderValue(F.getPrefixData(), OM);
|
||||
OM.LastGlobalConstantID = OM.size();
|
||||
|
||||
// Initializers of GlobalValues are processed in
|
||||
|
Reference in New Issue
Block a user