Skip to content

Commit 2f3fa0b

Browse files
committed
clang-format
1 parent 2f1c4b5 commit 2f3fa0b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,20 +2090,21 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
20902090

20912091
// Check for partially undefined constant vectors
20922092
// TODO: scalable vectors (this is hard because we do not have IRBuilder)
2093-
if ( isa<FixedVectorType>(V->getType())
2094-
&& isa<Constant>(V)
2095-
&& (cast<Constant>(V))->containsUndefOrPoisonElement()
2096-
&& PropagateShadow
2097-
&& PoisonUndef) {
2098-
unsigned NumElems = (cast<FixedVectorType>(V->getType()))->getNumElements();
2093+
if (isa<FixedVectorType>(V->getType()) && isa<Constant>(V) &&
2094+
(cast<Constant>(V))->containsUndefOrPoisonElement() &&
2095+
PropagateShadow && PoisonUndef) {
2096+
unsigned NumElems =
2097+
(cast<FixedVectorType>(V->getType()))->getNumElements();
20992098
SmallVector<Constant *, 32> ShadowVector(NumElems);
21002099
for (unsigned i = 0; i != NumElems; ++i) {
21012100
Constant *Elem = (cast<Constant>(V))->getAggregateElement(i);
2102-
ShadowVector[i] = isa<UndefValue>(Elem) ? getPoisonedShadow(Elem) : getCleanShadow(Elem);
2101+
ShadowVector[i] = isa<UndefValue>(Elem) ? getPoisonedShadow(Elem)
2102+
: getCleanShadow(Elem);
21032103
}
21042104

21052105
Value *ShadowConstant = ConstantVector::get(ShadowVector);
2106-
LLVM_DEBUG(dbgs() << "Partial undef constant vector: " << *V << " ==> " << *ShadowConstant << "\n");
2106+
LLVM_DEBUG(dbgs() << "Partial undef constant vector: " << *V << " ==> "
2107+
<< *ShadowConstant << "\n");
21072108

21082109
return ShadowConstant;
21092110
}

0 commit comments

Comments
 (0)