diff options
author | Sean Fertile <sd.fertile@gmail.com> | 2021-05-14 13:55:13 -0400 |
---|---|---|
committer | Sean Fertile <sd.fertile@gmail.com> | 2021-08-05 21:19:16 -0400 |
commit | 23651c5ae02a209ff214e4283dddb5ab65d1003a (patch) | |
tree | b3053670d3a5334e9cd3588ed0e0aac1cc0a73c6 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 5fc7b1a260f2d33a70cf5202ce9f780f1fbf5f2c (diff) | |
download | llvm-23651c5ae02a209ff214e4283dddb5ab65d1003a.zip llvm-23651c5ae02a209ff214e4283dddb5ab65d1003a.tar.gz llvm-23651c5ae02a209ff214e4283dddb5ab65d1003a.tar.bz2 |
[PowerPC][AIX] Create multiple constant sections.
Fixes issue where late materialized constants can be more strictly
aligned then their containing csect.
Differential Revision: https://reviews.llvm.org/D103103
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index add34ec..3383f5a 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2414,7 +2414,20 @@ bool TargetLoweringObjectFileXCOFF::shouldPutJumpTableInFunctionSection( MCSection *TargetLoweringObjectFileXCOFF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, Align &Alignment) const { - //TODO: Enable emiting constant pool to unique sections when we support it. + // TODO: Enable emiting constant pool to unique sections when we support it. + if (Alignment > Align(16)) + report_fatal_error("Alignments greater than 16 not yet supported."); + + if (Alignment == Align(8)) { + assert(ReadOnly8Section && "Section should always be initialized."); + return ReadOnly8Section; + } + + if (Alignment == Align(16)) { + assert(ReadOnly16Section && "Section should always be initialized."); + return ReadOnly16Section; + } + return ReadOnlySection; } |