projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Utils: Simplify MapMetadata(), NFC
[oota-llvm.git]
/
lib
/
Transforms
/
Utils
/
UnifyFunctionExitNodes.cpp
diff --git
a/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
b/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
index 8cf62196cc159009c59c574fd55db95613500392..0c2fc0a972b53c931706a5f9fd82bb13563a9e67 100644
(file)
--- a/
lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
+++ b/
lib/Transforms/Utils/UnifyFunctionExitNodes.cpp
@@
-16,11
+16,11
@@
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/BasicBlock.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
+#include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Type.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar.h"
-#include "llvm/Type.h"
using namespace llvm;
char UnifyFunctionExitNodes::ID = 0;
using namespace llvm;
char UnifyFunctionExitNodes::ID = 0;
@@
-59,7
+59,7
@@
bool UnifyFunctionExitNodes::runOnFunction(Function &F) {
// Then unreachable blocks.
if (UnreachableBlocks.empty()) {
// Then unreachable blocks.
if (UnreachableBlocks.empty()) {
- UnreachableBlock =
0
;
+ UnreachableBlock =
nullptr
;
} else if (UnreachableBlocks.size() == 1) {
UnreachableBlock = UnreachableBlocks.front();
} else {
} 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()) {
// 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
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);
BasicBlock *NewRetBlock = BasicBlock::Create(F.getContext(),
"UnifiedReturnBlock", &F);
- PHINode *PN =
0
;
+ PHINode *PN =
nullptr
;
if (F.getReturnType()->isVoidTy()) {
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(),
} else {
// If the function doesn't return void... add a PHI node to the block...
PN = PHINode::Create(F.getReturnType(), ReturningBlocks.size(),