]> granicus.if.org Git - llvm/commitdiff
Remove spurious cast of nullptr. NFC.
authorSerge Guelton <sguelton@quarkslab.com>
Thu, 11 May 2017 08:53:00 +0000 (08:53 +0000)
committerSerge Guelton <sguelton@quarkslab.com>
Thu, 11 May 2017 08:53:00 +0000 (08:53 +0000)
Conversion rules allow automatic casting of nullptr to any pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302780 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterCoalescer.cpp
lib/Support/Unix/Process.inc
lib/Target/Mips/MipsOptimizePICCall.cpp
lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
lib/Transforms/Utils/CloneModule.cpp

index bf44ee8453b613ed129338d439b0e99c920bc6aa..1803ea2b924901cc90cab1560fee72a4f24106bb 100644 (file)
@@ -3214,7 +3214,7 @@ RegisterCoalescer::copyCoalesceInMBB(MachineBasicBlock *MBB) {
     CurrList(WorkList.begin() + PrevSize, WorkList.end());
   if (copyCoalesceWorkList(CurrList))
     WorkList.erase(std::remove(WorkList.begin() + PrevSize, WorkList.end(),
-                               (MachineInstr*)nullptr), WorkList.end());
+                               nullptr), WorkList.end());
 }
 
 void RegisterCoalescer::coalesceLocals() {
index 16f8f5a98e5244f05a628ec8aaa0032d3061c28c..1d0143c6716e00edd9d99054644fd139e60ed45f 100644 (file)
@@ -347,7 +347,7 @@ static bool terminalHasColors(int fd) {
   MutexGuard G(*TermColorMutex);
 
   int errret = 0;
-  if (setupterm((char *)nullptr, fd, &errret) != 0)
+  if (setupterm(nullptr, fd, &errret) != 0)
     // Regardless of why, if we can't get terminfo, we shouldn't try to print
     // colors.
     return false;
@@ -369,7 +369,7 @@ static bool terminalHasColors(int fd) {
 
   // Now extract the structure allocated by setupterm and free its memory
   // through a really silly dance.
-  struct term *termp = set_curterm((struct term *)nullptr);
+  struct term *termp = set_curterm(nullptr);
   (void)del_curterm(termp); // Drop any errors here.
 
   // Return true if we found a color capabilities for the current terminal.
index 68dcbdfb4211fb1207fc360294029f1b851d62b5..f8d9c34556bcc18310972746c31accf7627b46d2 100644 (file)
@@ -257,7 +257,7 @@ bool OptimizePICCall::isCallViaRegister(MachineInstr &MI, unsigned &Reg,
 
   // Get the instruction that loads the function address from the GOT.
   Reg = MO->getReg();
-  Val = (Value*)nullptr;
+  Val = nullptr;
   MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo();
   MachineInstr *DefMI = MRI.getVRegDef(Reg);
 
index 68884ce25bf8c00734364ddb94ac6e3a838e8f05..659cb9df00a2c27b773985f88ac5370fcd09cc40 100644 (file)
@@ -179,7 +179,7 @@ void filterModule(
     else
       GO = new GlobalVariable(
           *M, GA->getValueType(), false, GlobalValue::ExternalLinkage,
-          (Constant *)nullptr, "", (GlobalVariable *)nullptr,
+          nullptr, "", nullptr,
           GA->getThreadLocalMode(), GA->getType()->getAddressSpace());
     GO->takeName(GA);
     GA->replaceAllUsesWith(GO);
index 4e9d67252d6c5bd50a9559ab6152526212b890cd..5444b752de829d84b34cb5ee853bedf609f1fcfd 100644 (file)
@@ -96,7 +96,7 @@ std::unique_ptr<Module> llvm::CloneModule(
       else
         GV = new GlobalVariable(
             *New, I->getValueType(), false, GlobalValue::ExternalLinkage,
-            (Constant *)nullptr, I->getName(), (GlobalVariable *)nullptr,
+            nullptr, I->getName(), nullptr,
             I->getThreadLocalMode(), I->getType()->getAddressSpace());
       VMap[&*I] = GV;
       // We do not copy attributes (mainly because copying between different