forked from OSchip/llvm-project
Make llvm::ConvertDebugDeclareToDebugValue() be a void function (NFC)
The routines llvm::ConvertDebugDeclareToDebugValue() always returned a true value which was never checked at the call site; change the function return type to void. This NFC cleanup was approved in the review https://reviews.llvm.org/D23715 llvm-svn: 281964
This commit is contained in:
parent
96a56bd0c6
commit
22b5dbc8bf
|
@ -258,17 +258,17 @@ Value *EmitGEPOffset(IRBuilderTy *Builder, const DataLayout &DL, User *GEP,
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
|
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
StoreInst *SI, DIBuilder &Builder);
|
StoreInst *SI, DIBuilder &Builder);
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
|
/// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
LoadInst *LI, DIBuilder &Builder);
|
LoadInst *LI, DIBuilder &Builder);
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic after a phi of an alloca'd value
|
/// Inserts a llvm.dbg.value intrinsic after a phi of an alloca'd value
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
PHINode *LI, DIBuilder &Builder);
|
PHINode *LI, DIBuilder &Builder);
|
||||||
|
|
||||||
/// Lowers llvm.dbg.declare intrinsics into appropriate set of
|
/// Lowers llvm.dbg.declare intrinsics into appropriate set of
|
||||||
|
|
|
@ -1073,7 +1073,7 @@ static bool PhiHasDebugValue(DILocalVariable *DIVar,
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
|
/// Inserts a llvm.dbg.value intrinsic before a store to an alloca'd value
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
StoreInst *SI, DIBuilder &Builder) {
|
StoreInst *SI, DIBuilder &Builder) {
|
||||||
auto *DIVar = DDI->getVariable();
|
auto *DIVar = DDI->getVariable();
|
||||||
auto *DIExpr = DDI->getExpression();
|
auto *DIExpr = DDI->getExpression();
|
||||||
|
@ -1114,19 +1114,18 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
} else if (!LdStHasDebugValue(DIVar, DIExpr, SI))
|
} else if (!LdStHasDebugValue(DIVar, DIExpr, SI))
|
||||||
Builder.insertDbgValueIntrinsic(SI->getOperand(0), 0, DIVar, DIExpr,
|
Builder.insertDbgValueIntrinsic(SI->getOperand(0), 0, DIVar, DIExpr,
|
||||||
DDI->getDebugLoc(), SI);
|
DDI->getDebugLoc(), SI);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
|
/// Inserts a llvm.dbg.value intrinsic before a load of an alloca'd value
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
LoadInst *LI, DIBuilder &Builder) {
|
LoadInst *LI, DIBuilder &Builder) {
|
||||||
auto *DIVar = DDI->getVariable();
|
auto *DIVar = DDI->getVariable();
|
||||||
auto *DIExpr = DDI->getExpression();
|
auto *DIExpr = DDI->getExpression();
|
||||||
assert(DIVar && "Missing variable");
|
assert(DIVar && "Missing variable");
|
||||||
|
|
||||||
if (LdStHasDebugValue(DIVar, DIExpr, LI))
|
if (LdStHasDebugValue(DIVar, DIExpr, LI))
|
||||||
return true;
|
return;
|
||||||
|
|
||||||
// We are now tracking the loaded value instead of the address. In the
|
// We are now tracking the loaded value instead of the address. In the
|
||||||
// future if multi-location support is added to the IR, it might be
|
// future if multi-location support is added to the IR, it might be
|
||||||
|
@ -1135,24 +1134,22 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
Instruction *DbgValue = Builder.insertDbgValueIntrinsic(
|
Instruction *DbgValue = Builder.insertDbgValueIntrinsic(
|
||||||
LI, 0, DIVar, DIExpr, DDI->getDebugLoc(), (Instruction *)nullptr);
|
LI, 0, DIVar, DIExpr, DDI->getDebugLoc(), (Instruction *)nullptr);
|
||||||
DbgValue->insertAfter(LI);
|
DbgValue->insertAfter(LI);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inserts a llvm.dbg.value intrinsic after a phi
|
/// Inserts a llvm.dbg.value intrinsic after a phi
|
||||||
/// that has an associated llvm.dbg.decl intrinsic.
|
/// that has an associated llvm.dbg.decl intrinsic.
|
||||||
bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
void llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
|
||||||
PHINode *APN, DIBuilder &Builder) {
|
PHINode *APN, DIBuilder &Builder) {
|
||||||
auto *DIVar = DDI->getVariable();
|
auto *DIVar = DDI->getVariable();
|
||||||
auto *DIExpr = DDI->getExpression();
|
auto *DIExpr = DDI->getExpression();
|
||||||
assert(DIVar && "Missing variable");
|
assert(DIVar && "Missing variable");
|
||||||
|
|
||||||
if (PhiHasDebugValue(DIVar, DIExpr, APN))
|
if (PhiHasDebugValue(DIVar, DIExpr, APN))
|
||||||
return true;
|
return;
|
||||||
|
|
||||||
Instruction *DbgValue = Builder.insertDbgValueIntrinsic(
|
Instruction *DbgValue = Builder.insertDbgValueIntrinsic(
|
||||||
APN, 0, DIVar, DIExpr, DDI->getDebugLoc(), (Instruction *)nullptr);
|
APN, 0, DIVar, DIExpr, DDI->getDebugLoc(), (Instruction *)nullptr);
|
||||||
DbgValue->insertBefore(&*APN->getParent()->getFirstInsertionPt());
|
DbgValue->insertBefore(&*APN->getParent()->getFirstInsertionPt());
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determine whether this alloca is either a VLA or an array.
|
/// Determine whether this alloca is either a VLA or an array.
|
||||||
|
|
Loading…
Reference in New Issue