Skip to content

Commit 0c1013b

Browse files
authored
[IR][NFC] Rename UncondBrInst 'IfTrue' argument to 'Target' (#187631)
Follow-up on @slackito's suggestion about the naming of the variable and discussion with @aengelke in #187196
1 parent 0ae0ee0 commit 0c1013b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/include/llvm/IR/Instructions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,7 +3139,7 @@ class UncondBrInst : public BranchInst {
31393139
constexpr static IntrusiveOperandsAllocMarker AllocMarker{1};
31403140

31413141
UncondBrInst(const UncondBrInst &BI);
3142-
LLVM_ABI explicit UncondBrInst(BasicBlock *IfTrue,
3142+
LLVM_ABI explicit UncondBrInst(BasicBlock *Target,
31433143
InsertPosition InsertBefore);
31443144

31453145
protected:
@@ -3149,9 +3149,9 @@ class UncondBrInst : public BranchInst {
31493149
LLVM_ABI UncondBrInst *cloneImpl() const;
31503150

31513151
public:
3152-
static UncondBrInst *Create(BasicBlock *IfTrue,
3152+
static UncondBrInst *Create(BasicBlock *Target,
31533153
InsertPosition InsertBefore = nullptr) {
3154-
return new (AllocMarker) UncondBrInst(IfTrue, InsertBefore);
3154+
return new (AllocMarker) UncondBrInst(Target, InsertBefore);
31553155
}
31563156

31573157
/// Transparently provide more efficient getOperand methods.

llvm/lib/IR/Instructions.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,11 +1192,10 @@ UnreachableInst::UnreachableInst(LLVMContext &Context,
11921192
// Suppress deprecation warnings from BranchInst.
11931193
LLVM_SUPPRESS_DEPRECATED_DECLARATIONS_PUSH
11941194

1195-
UncondBrInst::UncondBrInst(BasicBlock *IfTrue, InsertPosition InsertBefore)
1196-
: BranchInst(Type::getVoidTy(IfTrue->getContext()), Instruction::UncondBr,
1195+
UncondBrInst::UncondBrInst(BasicBlock *Target, InsertPosition InsertBefore)
1196+
: BranchInst(Type::getVoidTy(Target->getContext()), Instruction::UncondBr,
11971197
AllocMarker, InsertBefore) {
1198-
assert(IfTrue && "Branch destination may not be null!");
1199-
Op<-1>() = IfTrue;
1198+
Op<-1>() = Target;
12001199
}
12011200

12021201
UncondBrInst::UncondBrInst(const UncondBrInst &BI)

0 commit comments

Comments
 (0)