diff options
| author | Guillaume Chatelet <gchatelet@google.com> | 2019-09-12 15:20:36 +0000 |
|---|---|---|
| committer | Guillaume Chatelet <gchatelet@google.com> | 2019-09-12 15:20:36 +0000 |
| commit | af11cc7eb5da320066d88a8f6d015e6296f0da25 (patch) | |
| tree | 8b2da3ac0f4a3b206edd98e49cc89917fecb6e5b /llvm/lib/CodeGen | |
| parent | 0866dbfa1a8b36db16f58d1bd60688474d1b9474 (diff) | |
| download | bcm5719-llvm-af11cc7eb5da320066d88a8f6d015e6296f0da25.tar.gz bcm5719-llvm-af11cc7eb5da320066d88a8f6d015e6296f0da25.zip | |
[Alignment] Move OffsetToAlignment to Alignment.h
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet, JDevlieghere, alexshap, rupprecht, jhenderson
Subscribers: sdardis, nemanjai, hiraditya, kbarton, jakehehrlich, jrtc27, MaskRay, atanasyan, jsji, seiya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D67499
llvm-svn: 371742
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/BranchRelaxation.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index c17f2ec4483..9be64c42f0c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2555,8 +2555,8 @@ void DwarfDebug::emitDebugARanges() { unsigned TupleSize = PtrSize * 2; // 7.20 in the Dwarf specs requires the table to be aligned to a tuple. - unsigned Padding = - OffsetToAlignment(sizeof(int32_t) + ContentSize, TupleSize); + unsigned Padding = offsetToAlignment(sizeof(int32_t) + ContentSize, + llvm::Align(TupleSize)); ContentSize += Padding; ContentSize += (List.size() + 1) * TupleSize; diff --git a/llvm/lib/CodeGen/BranchRelaxation.cpp b/llvm/lib/CodeGen/BranchRelaxation.cpp index d027d5b154e..3abfd147b09 100644 --- a/llvm/lib/CodeGen/BranchRelaxation.cpp +++ b/llvm/lib/CodeGen/BranchRelaxation.cpp @@ -71,11 +71,11 @@ class BranchRelaxation : public MachineFunctionPass { const llvm::Align ParentAlign = MBB.getParent()->getAlignment(); if (Align <= ParentAlign) - return PO + OffsetToAlignment(PO, Align.value()); + return PO + offsetToAlignment(PO, Align); // The alignment of this MBB is larger than the function's alignment, so we // can't tell whether or not it will insert nops. Assume that it will. - return PO + Align.value() + OffsetToAlignment(PO, Align.value()); + return PO + Align.value() + offsetToAlignment(PO, Align); } }; |

