summaryrefslogtreecommitdiff
path: root/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-04-09 06:08:46 +0000
committerCraig Topper <craig.topper@gmail.com>2014-04-09 06:08:46 +0000
commitec0f0bc6afa8d2c1f427ec55264fc78738b83ef6 (patch)
tree9fd922368890f4c0e51831dc17d85d7f793a15c3 /lib/IR/DataLayout.cpp
parent8a0d1c8f06391add493d0ff4b7344fce3420d2d5 (diff)
downloadllvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.gz
llvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.bz2
llvm-ec0f0bc6afa8d2c1f427ec55264fc78738b83ef6.tar.xz
[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DataLayout.cpp')
-rw-r--r--lib/IR/DataLayout.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/IR/DataLayout.cpp b/lib/IR/DataLayout.cpp
index 6c183872a3..d85081629c 100644
--- a/lib/IR/DataLayout.cpp
+++ b/lib/IR/DataLayout.cpp
@@ -178,7 +178,7 @@ static const LayoutAlignElem DefaultAlignments[] = {
void DataLayout::reset(StringRef Desc) {
clear();
- LayoutMap = 0;
+ LayoutMap = nullptr;
LittleEndian = false;
StackNaturalAlign = 0;
ManglingMode = MM_None;
@@ -344,7 +344,7 @@ void DataLayout::parseSpecifier(StringRef Desc) {
}
}
-DataLayout::DataLayout(const Module *M) : LayoutMap(0) {
+DataLayout::DataLayout(const Module *M) : LayoutMap(nullptr) {
const DataLayout *Other = M->getDataLayout();
if (Other)
*this = *Other;
@@ -488,7 +488,7 @@ void DataLayout::clear() {
Alignments.clear();
Pointers.clear();
delete static_cast<StructLayoutMap *>(LayoutMap);
- LayoutMap = 0;
+ LayoutMap = nullptr;
}
DataLayout::~DataLayout() {
@@ -687,7 +687,7 @@ unsigned DataLayout::getABITypeAlignment(Type *Ty) const {
/// getABIIntegerTypeAlignment - Return the minimum ABI-required alignment for
/// an integer type of the specified bitwidth.
unsigned DataLayout::getABIIntegerTypeAlignment(unsigned BitWidth) const {
- return getAlignmentInfo(INTEGER_ALIGN, BitWidth, true, 0);
+ return getAlignmentInfo(INTEGER_ALIGN, BitWidth, true, nullptr);
}
unsigned DataLayout::getPrefTypeAlignment(Type *Ty) const {
@@ -719,7 +719,7 @@ Type *DataLayout::getSmallestLegalIntType(LLVMContext &C, unsigned Width) const
for (unsigned LegalIntWidth : LegalIntWidths)
if (Width <= LegalIntWidth)
return Type::getIntNTy(C, LegalIntWidth);
- return 0;
+ return nullptr;
}
unsigned DataLayout::getLargestLegalIntTypeSize() const {