Skip to content

Commit

Permalink
[NFC][msan] Init few vars later
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Jan 14, 2022
1 parent d72ebaf commit 71a4fde
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Expand Up @@ -3702,15 +3702,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
continue;
}
unsigned Size = 0;
Value *Store = nullptr;
// Compute the Shadow for arg even if it is ByVal, because
// in that case getShadow() will copy the actual arg shadow to
// __msan_param_tls.
Value *ArgShadow = getShadow(A);
Value *ArgShadowBase = getShadowPtrForArgument(A, IRB, ArgOffset);
LLVM_DEBUG(dbgs() << " Arg#" << i << ": " << *A
<< " Shadow: " << *ArgShadow << "\n");
bool ArgIsInitialized = false;
const DataLayout &DL = F.getParent()->getDataLayout();

bool ByVal = CB.paramHasAttr(i, Attribute::ByVal);
Expand All @@ -3721,6 +3712,15 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
insertShadowCheck(A, &CB);
Size = DL.getTypeAllocSize(A->getType());
} else {
bool ArgIsInitialized = false;
Value *Store = nullptr;
// Compute the Shadow for arg even if it is ByVal, because
// in that case getShadow() will copy the actual arg shadow to
// __msan_param_tls.
Value *ArgShadow = getShadow(A);
Value *ArgShadowBase = getShadowPtrForArgument(A, IRB, ArgOffset);
LLVM_DEBUG(dbgs() << " Arg#" << i << ": " << *A
<< " Shadow: " << *ArgShadow << "\n");
if (ByVal) {
// ByVal requires some special handling as it's too big for a single
// load
Expand Down

0 comments on commit 71a4fde

Please sign in to comment.