diff options
author | Craig Topper <craig.topper@intel.com> | 2020-05-21 15:23:00 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2020-05-21 15:23:29 -0700 |
commit | f96a7706d9f0afe33ee4a1f55ba7daec926e4ffe (patch) | |
tree | 0dab62b8952d285ab777af31c7dbab680ee84a1d /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | fc937806efd71eb3803b35d0920bb7d76bc3040b (diff) | |
download | llvm-f96a7706d9f0afe33ee4a1f55ba7daec926e4ffe.zip llvm-f96a7706d9f0afe33ee4a1f55ba7daec926e4ffe.tar.gz llvm-f96a7706d9f0afe33ee4a1f55ba7daec926e4ffe.tar.bz2 |
[Target] Use Align in TargetLoweringObjectFile::getSectionForConstant.
Differential Revision: https://reviews.llvm.org/D80363
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a3bfd65..5a5cde4 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -842,7 +842,7 @@ bool TargetLoweringObjectFileELF::shouldPutJumpTableInFunctionSection( /// information, return a section that it should be placed in. MCSection *TargetLoweringObjectFileELF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, - unsigned &Align) const { + Align &Alignment) const { if (Kind.isMergeableConst4() && MergeableConst4Section) return MergeableConst4Section; if (Kind.isMergeableConst8() && MergeableConst8Section) @@ -1194,7 +1194,7 @@ MCSection *TargetLoweringObjectFileMachO::SelectSectionForGlobal( MCSection *TargetLoweringObjectFileMachO::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, - unsigned &Align) const { + Align &Alignment) const { // If this constant requires a relocation, we have to put it in the data // segment, not in the text segment. if (Kind.isData() || Kind.isReadOnlyWithRel()) @@ -1777,7 +1777,7 @@ static std::string scalarConstantToHexString(const Constant *C) { MCSection *TargetLoweringObjectFileCOFF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, - unsigned &Align) const { + Align &Alignment) const { if (Kind.isMergeableConst() && C && getContext().getAsmInfo()->hasCOFFComdatConstants()) { // This creates comdat sections with the given symbol name, but unless @@ -1789,25 +1789,25 @@ MCSection *TargetLoweringObjectFileCOFF::getSectionForConstant( COFF::IMAGE_SCN_LNK_COMDAT; std::string COMDATSymName; if (Kind.isMergeableConst4()) { - if (Align <= 4) { + if (Alignment <= 4) { COMDATSymName = "__real@" + scalarConstantToHexString(C); - Align = 4; + Alignment = Align(4); } } else if (Kind.isMergeableConst8()) { - if (Align <= 8) { + if (Alignment <= 8) { COMDATSymName = "__real@" + scalarConstantToHexString(C); - Align = 8; + Alignment = Align(8); } } else if (Kind.isMergeableConst16()) { // FIXME: These may not be appropriate for non-x86 architectures. - if (Align <= 16) { + if (Alignment <= 16) { COMDATSymName = "__xmm@" + scalarConstantToHexString(C); - Align = 16; + Alignment = Align(16); } } else if (Kind.isMergeableConst32()) { - if (Align <= 32) { + if (Alignment <= 32) { COMDATSymName = "__ymm@" + scalarConstantToHexString(C); - Align = 32; + Alignment = Align(32); } } @@ -1817,10 +1817,10 @@ MCSection *TargetLoweringObjectFileCOFF::getSectionForConstant( COFF::IMAGE_COMDAT_SELECT_ANY); } - return TargetLoweringObjectFile::getSectionForConstant(DL, Kind, C, Align); + return TargetLoweringObjectFile::getSectionForConstant(DL, Kind, C, + Alignment); } - //===----------------------------------------------------------------------===// // Wasm //===----------------------------------------------------------------------===// @@ -2096,7 +2096,7 @@ bool TargetLoweringObjectFileXCOFF::shouldPutJumpTableInFunctionSection( /// information, return a section that it should be placed in. MCSection *TargetLoweringObjectFileXCOFF::getSectionForConstant( const DataLayout &DL, SectionKind Kind, const Constant *C, - unsigned &Align) const { + Align &Alignment) const { //TODO: Enable emiting constant pool to unique sections when we support it. return ReadOnlySection; } |