summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-08-05 09:00:43 +0000
committerGuillaume Chatelet <gchatelet@google.com>2019-08-05 09:00:43 +0000
commit65e4b47aad33184ede8537c786cc80e6b8c32e92 (patch)
tree78abb50c221d0816da7787f7e5e5829dbe46af81 /llvm/lib/IR/DataLayout.cpp
parent3046ef5c1101ff2b9480897a6b52d7d41a8ecf34 (diff)
downloadbcm5719-llvm-65e4b47aad33184ede8537c786cc80e6b8c32e92.tar.gz
bcm5719-llvm-65e4b47aad33184ede8537c786cc80e6b8c32e92.zip
[LLVM][Alignment] Introduce Alignment Type in DataLayout
Summary: This is patch is part of a serie 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, jfb, jakehehrlich Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65521 Make getFunctionPtrAlign() return MaybeAlign llvm-svn: 367817
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index 6e0ebbd4a73..ab90388fae3 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -182,9 +182,9 @@ void DataLayout::reset(StringRef Desc) {
LayoutMap = nullptr;
BigEndian = false;
AllocaAddrSpace = 0;
- StackNaturalAlign = 0;
+ StackNaturalAlign.reset();
ProgramAddrSpace = 0;
- FunctionPtrAlign = 0;
+ FunctionPtrAlign.reset();
TheFunctionPtrAlignType = FunctionPtrAlignType::Independent;
ManglingMode = MM_None;
NonIntegralAddressSpaces.clear();
@@ -378,7 +378,7 @@ void DataLayout::parseSpecifier(StringRef Desc) {
}
break;
case 'S': { // Stack natural alignment.
- StackNaturalAlign = inBytes(getInt(Tok));
+ StackNaturalAlign = MaybeAlign(inBytes(getInt(Tok)));
break;
}
case 'F': {
@@ -394,7 +394,7 @@ void DataLayout::parseSpecifier(StringRef Desc) {
"datalayout string");
}
Tok = Tok.substr(1);
- FunctionPtrAlign = inBytes(getInt(Tok));
+ FunctionPtrAlign = MaybeAlign(inBytes(getInt(Tok)));
break;
}
case 'P': { // Function address space.
OpenPOWER on IntegriCloud