[polly] r273435 - clang-tidy: apply modern-use-nullptr fixes

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 09:22:01 PDT 2016


Author: grosser
Date: Wed Jun 22 11:22:00 2016
New Revision: 273435

URL: http://llvm.org/viewvc/llvm-project?rev=273435&view=rev
Log:
clang-tidy: apply modern-use-nullptr fixes

Instead of using 0 or NULL use the C++11 nullptr symbol when referencing null
pointers.

This cleanup was suggested by Eugene Zelenko <eugene.zelenko at gmail.com> in
http://reviews.llvm.org/D21488 and was split out to increase readability.

Modified:
    polly/trunk/lib/Analysis/DependenceInfo.cpp
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/lib/CodeGen/LoopGenerators.cpp
    polly/trunk/lib/Transform/ScheduleOptimizer.cpp

Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=273435&r1=273434&r2=273435&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Wed Jun 22 11:22:00 2016
@@ -244,7 +244,7 @@ void Dependences::addPrivatizationDepend
   // dependency cycles in the privatization dependences. To make sure this
   // will not happen we remove all negative dependences after we computed
   // the transitive closure.
-  TC_RED = isl_union_map_transitive_closure(isl_union_map_copy(RED), 0);
+  TC_RED = isl_union_map_transitive_closure(isl_union_map_copy(RED), nullptr);
 
   // FIXME: Apply the current schedule instead of assuming the identity schedule
   //        here. The current approach is only valid as long as we compute the

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=273435&r1=273434&r2=273435&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Wed Jun 22 11:22:00 2016
@@ -452,7 +452,7 @@ bool ScopDetection::isValidCallInst(Call
   Function *CalledFunction = CI.getCalledFunction();
 
   // Indirect calls are not supported.
-  if (CalledFunction == 0)
+  if (CalledFunction == nullptr)
     return false;
 
   if (AllowModrefCall) {

Modified: polly/trunk/lib/CodeGen/LoopGenerators.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/LoopGenerators.cpp?rev=273435&r1=273434&r2=273435&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/LoopGenerators.cpp (original)
+++ polly/trunk/lib/CodeGen/LoopGenerators.cpp Wed Jun 22 11:22:00 2016
@@ -289,7 +289,7 @@ ParallelLoopGenerator::storeValuesIntoSt
   BasicBlock &EntryBB = Builder.GetInsertBlock()->getParent()->getEntryBlock();
   Instruction *IP = &*EntryBB.getFirstInsertionPt();
   StructType *Ty = StructType::get(Builder.getContext(), Members);
-  AllocaInst *Struct = new AllocaInst(Ty, 0, "polly.par.userContext", IP);
+  AllocaInst *Struct = new AllocaInst(Ty, nullptr, "polly.par.userContext", IP);
 
   // Mark the start of the lifetime for the parameter struct.
   ConstantInt *SizeOf = Builder.getInt64(DL.getTypeAllocSize(Ty));
@@ -338,8 +338,8 @@ Value *ParallelLoopGenerator::createSubF
 
   // Fill up basic block HeaderBB.
   Builder.SetInsertPoint(HeaderBB);
-  LBPtr = Builder.CreateAlloca(LongType, 0, "polly.par.LBPtr");
-  UBPtr = Builder.CreateAlloca(LongType, 0, "polly.par.UBPtr");
+  LBPtr = Builder.CreateAlloca(LongType, nullptr, "polly.par.LBPtr");
+  UBPtr = Builder.CreateAlloca(LongType, nullptr, "polly.par.UBPtr");
   UserContext = Builder.CreateBitCast(
       &*SubFn->arg_begin(), StructData->getType(), "polly.par.userContext");
 

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=273435&r1=273434&r2=273435&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Wed Jun 22 11:22:00 2016
@@ -198,7 +198,7 @@ getIsolateOptions(__isl_take isl_set *Is
   IsolateRelation = isl_map_move_dims(IsolateRelation, isl_dim_out, 0,
                                       isl_dim_in, Dims - 1, 1);
   auto *IsolateOption = isl_map_wrap(IsolateRelation);
-  auto *Id = isl_id_alloc(isl_set_get_ctx(IsolateOption), "isolate", NULL);
+  auto *Id = isl_id_alloc(isl_set_get_ctx(IsolateOption), "isolate", nullptr);
   return isl_union_set_from_set(isl_set_set_tuple_id(IsolateOption, Id));
 }
 
@@ -211,7 +211,7 @@ getIsolateOptions(__isl_take isl_set *Is
 static __isl_give isl_union_set *getAtomicOptions(__isl_take isl_ctx *Ctx) {
   auto *Space = isl_space_set_alloc(Ctx, 0, 1);
   auto *AtomicOption = isl_set_universe(Space);
-  auto *Id = isl_id_alloc(Ctx, "atomic", NULL);
+  auto *Id = isl_id_alloc(Ctx, "atomic", nullptr);
   return isl_union_set_from_set(isl_set_set_tuple_id(AtomicOption, Id));
 }
 




More information about the llvm-commits mailing list