mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 06:26:07 +00:00
[DFSan] Change placeholders from undef
to poison
(#131534)
Use `poison` to create dummy phi nodes instead of `undef`.
This commit is contained in:
parent
ccf2109471
commit
1b31646757
@ -3447,9 +3447,9 @@ void DFSanVisitor::visitPHINode(PHINode &PN) {
|
||||
PN.getIterator());
|
||||
|
||||
// Give the shadow phi node valid predecessors to fool SplitEdge into working.
|
||||
Value *UndefShadow = UndefValue::get(ShadowTy);
|
||||
Value *PoisonShadow = PoisonValue::get(ShadowTy);
|
||||
for (BasicBlock *BB : PN.blocks())
|
||||
ShadowPN->addIncoming(UndefShadow, BB);
|
||||
ShadowPN->addIncoming(PoisonShadow, BB);
|
||||
|
||||
DFSF.setShadow(&PN, ShadowPN);
|
||||
|
||||
@ -3457,9 +3457,9 @@ void DFSanVisitor::visitPHINode(PHINode &PN) {
|
||||
if (DFSF.DFS.shouldTrackOrigins()) {
|
||||
OriginPN = PHINode::Create(DFSF.DFS.OriginTy, PN.getNumIncomingValues(), "",
|
||||
PN.getIterator());
|
||||
Value *UndefOrigin = UndefValue::get(DFSF.DFS.OriginTy);
|
||||
Value *PoisonOrigin = PoisonValue::get(DFSF.DFS.OriginTy);
|
||||
for (BasicBlock *BB : PN.blocks())
|
||||
OriginPN->addIncoming(UndefOrigin, BB);
|
||||
OriginPN->addIncoming(PoisonOrigin, BB);
|
||||
DFSF.setOrigin(&PN, OriginPN);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user