[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead...
[oota-llvm.git] / lib / MC / MCContext.cpp
index 4152d6344e9c5389280686ad26dd451a56adf582..6f0c391769f483d249a1078000de7869151cee97 100644 (file)
@@ -44,7 +44,7 @@ MCContext::MCContext(const MCAsmInfo *mai, const MCRegisterInfo *mri,
     CompilationDir.clear();
 
   SecureLogFile = getenv("AS_SECURE_LOG_FILE");
-  SecureLog = 0;
+  SecureLog = nullptr;
   SecureLogUsed = false;
 
   if (SrcMgr && SrcMgr->getNumBuffers() > 0)
@@ -250,7 +250,7 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
               SectionKind Kind, unsigned EntrySize, StringRef Group) {
   // Do the lookup, if we have a hit, return it.
   auto IterBool = ELFUniquingMap.insert(
-      std::make_pair(SectionGroupPair(Section, Group), (MCSectionELF *)0));
+      std::make_pair(SectionGroupPair(Section, Group), nullptr));
   auto &Entry = *IterBool.first;
   if (!IterBool.second) return Entry.second;
 
@@ -259,7 +259,7 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
     EntrySize = MCSectionELF::DetermineEntrySize(Kind);
   }
 
-  MCSymbol *GroupSym = NULL;
+  MCSymbol *GroupSym = nullptr;
   if (!Group.empty())
     GroupSym = GetOrCreateSymbol(Group);
 
@@ -273,7 +273,7 @@ getELFSection(StringRef Section, unsigned Type, unsigned Flags,
 const MCSectionELF *MCContext::CreateELFGroupSection() {
   MCSectionELF *Result =
     new (*this) MCSectionELF(".group", ELF::SHT_GROUP, 0,
-                             SectionKind::getReadOnly(), 4, NULL);
+                             SectionKind::getReadOnly(), 4, nullptr);
   return Result;
 }
 
@@ -284,12 +284,12 @@ MCContext::getCOFFSection(StringRef Section, unsigned Characteristics,
   // Do the lookup, if we have a hit, return it.
 
   SectionGroupPair P(Section, COMDATSymName);
-  auto IterBool = COFFUniquingMap.insert(std::make_pair(P, (MCSectionCOFF *)0));
+  auto IterBool = COFFUniquingMap.insert(std::make_pair(P, nullptr));
   auto Iter = IterBool.first;
   if (!IterBool.second)
     return Iter->second;
 
-  const MCSymbol *COMDATSymbol = NULL;
+  const MCSymbol *COMDATSymbol = nullptr;
   if (!COMDATSymName.empty())
     COMDATSymbol = GetOrCreateSymbol(COMDATSymName);
 
@@ -311,7 +311,7 @@ const MCSectionCOFF *MCContext::getCOFFSection(StringRef Section) {
   SectionGroupPair P(Section, "");
   auto Iter = COFFUniquingMap.find(P);
   if (Iter == COFFUniquingMap.end())
-    return 0;
+    return nullptr;
   return Iter->second;
 }