mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-12 16:25:18 +00:00
[C++] Use 'nullptr'. Transforms edition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,7 +59,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
||||
|
||||
// Then unreachable blocks.
|
||||
if (UnreachableBlocks.empty()) {
|
||||
UnreachableBlock = 0;
|
||||
UnreachableBlock = nullptr;
|
||||
} else if (UnreachableBlocks.size() == 1) {
|
||||
UnreachableBlock = UnreachableBlocks.front();
|
||||
} else {
|
||||
@@ -77,7 +77,7 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
||||
|
||||
// Now handle return blocks.
|
||||
if (ReturningBlocks.empty()) {
|
||||
ReturnBlock = 0;
|
||||
ReturnBlock = nullptr;
|
||||
return false; // No blocks return
|
||||
} else if (ReturningBlocks.size() == 1) {
|
||||
ReturnBlock = ReturningBlocks.front(); // Already has a single return block
|
||||
@@ -91,9 +91,9 @@ bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
|
||||
BasicBlock *NewRetBlock = BasicBlock::Create(F.getContext(),
|
||||
"UnifiedReturnBlock", &F);
|
||||
|
||||
PHINode *PN = 0;
|
||||
PHINode *PN = nullptr;
|
||||
if (F.getReturnType()->isVoidTy()) {
|
||||
ReturnInst::Create(F.getContext(), NULL, NewRetBlock);
|
||||
ReturnInst::Create(F.getContext(), nullptr, NewRetBlock);
|
||||
} else {
|
||||
// If the function doesn't return void... add a PHI node to the block...
|
||||
PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(),
|
||||
|
Reference in New Issue
Block a user