@@ -1392,9 +1392,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
1392
1392
std::tie (ShadowPtr, OriginPtr) =
1393
1393
getShadowOriginPtr (Addr, IRB, ShadowTy, Alignment, /* isStore*/ true );
1394
1394
1395
- StoreInst *NewSI = IRB.CreateAlignedStore (Shadow, ShadowPtr, Alignment);
1395
+ [[maybe_unused]] StoreInst *NewSI =
1396
+ IRB.CreateAlignedStore (Shadow, ShadowPtr, Alignment);
1396
1397
LLVM_DEBUG (dbgs () << " STORE: " << *NewSI << " \n " );
1397
- (void )NewSI;
1398
1398
1399
1399
if (SI->isAtomic ())
1400
1400
SI->setOrdering (addReleaseOrdering (SI->getOrdering ()));
@@ -2021,18 +2021,16 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
2021
2021
Value *Shadow = ShadowMap[V];
2022
2022
if (!Shadow) {
2023
2023
LLVM_DEBUG (dbgs () << " No shadow: " << *V << " \n " << *(I->getParent ()));
2024
- (void )I;
2025
2024
assert (Shadow && " No shadow for a value" );
2026
2025
}
2027
2026
return Shadow;
2028
2027
}
2029
2028
// Handle fully undefined values
2030
2029
// (partially undefined constant vectors are handled later)
2031
- if (UndefValue *U = dyn_cast<UndefValue>(V)) {
2030
+ if ([[maybe_unused]] UndefValue *U = dyn_cast<UndefValue>(V)) {
2032
2031
Value *AllOnes = (PropagateShadow && PoisonUndef) ? getPoisonedShadow (V)
2033
2032
: getCleanShadow (V);
2034
2033
LLVM_DEBUG (dbgs () << " Undef: " << *U << " ==> " << *AllOnes << " \n " );
2035
- (void )U;
2036
2034
return AllOnes;
2037
2035
}
2038
2036
if (Argument *A = dyn_cast<Argument>(V)) {
@@ -2081,10 +2079,9 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
2081
2079
} else {
2082
2080
Value *Base = getShadowPtrForArgument (EntryIRB, ArgOffset);
2083
2081
const Align CopyAlign = std::min (ArgAlign, kShadowTLSAlignment );
2084
- Value *Cpy = EntryIRB.CreateMemCpy (CpShadowPtr, CopyAlign, Base,
2085
- CopyAlign, Size);
2082
+ [[maybe_unused]] Value *Cpy = EntryIRB.CreateMemCpy (
2083
+ CpShadowPtr, CopyAlign, Base, CopyAlign, Size);
2086
2084
LLVM_DEBUG (dbgs () << " ByValCpy: " << *Cpy << " \n " );
2087
- (void )Cpy;
2088
2085
2089
2086
if (MS.TrackOrigins ) {
2090
2087
Value *OriginPtr = getOriginPtrForArgument (EntryIRB, ArgOffset);
@@ -5566,7 +5563,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
5566
5563
insertShadowCheck (A, &CB);
5567
5564
Size = DL.getTypeAllocSize (A->getType ());
5568
5565
} else {
5569
- Value *Store = nullptr ;
5566
+ [[maybe_unused]] Value *Store = nullptr ;
5570
5567
// Compute the Shadow for arg even if it is ByVal, because
5571
5568
// in that case getShadow() will copy the actual arg shadow to
5572
5569
// __msan_param_tls.
@@ -5623,7 +5620,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
5623
5620
getOriginPtrForArgument (IRB, ArgOffset));
5624
5621
}
5625
5622
}
5626
- (void )Store;
5627
5623
assert (Store != nullptr );
5628
5624
LLVM_DEBUG (dbgs () << " Param:" << *Store << " \n " );
5629
5625
}
0 commit comments