Skip to content

Commit 90737ba

Browse files
authored
Merge pull request rust-lang#170 from vext01/kill-dl
Remove superfluous `DataLayout DL(&M)`.
2 parents f7da93e + dfd5dee commit 90737ba

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

llvm/lib/YkIR/YkIRWriter.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ class YkIRWriter {
723723
// Eventually we will have to encode the alignment of the load into our IR
724724
// and have the trace code generator split up the loads where necessary.
725725
// The same will have to be done for store instructions.
726-
DataLayout DL(&M);
727726
if (I->isVolatile() || (I->getOrdering() != AtomicOrdering::NotAtomic) ||
728727
(I->getPointerAddressSpace() != 0) ||
729728
(I->getAlign() != DL.getPrefTypeAlign(I->getType()))) {
@@ -752,7 +751,6 @@ class YkIRWriter {
752751
//
753752
// See the comment in `serialiseLoadInst()` for context on misaligned memory
754753
// accesses.
755-
DataLayout DL(&M);
756754
if (I->isVolatile() || (I->getOrdering() != AtomicOrdering::NotAtomic) ||
757755
(I->getPointerAddressSpace() != 0) ||
758756
(I->getAlign() !=
@@ -1019,7 +1017,6 @@ class YkIRWriter {
10191017
// - vector casts
10201018
std::optional<CastKind> CK = getCastKind(I->getOpcode());
10211019
if (isa<PtrToIntInst>(I)) {
1022-
DataLayout DL(&M);
10231020
TypeSize SrcSize = DL.getTypeSizeInBits(I->getSrcTy());
10241021
TypeSize DstSize = DL.getTypeSizeInBits(I->getDestTy());
10251022
if (DstSize < SrcSize) {
@@ -1237,7 +1234,6 @@ class YkIRWriter {
12371234
void serialiseStructType(StructType *STy) {
12381235
serialiseTypeKind(TypeKindStruct);
12391236
unsigned NumFields = STy->getNumElements();
1240-
DataLayout DL(&M);
12411237
const StructLayout *SL = DL.getStructLayout(STy);
12421238
// num_fields:
12431239
OutStreamer.emitSizeT(NumFields);
@@ -1312,7 +1308,6 @@ class YkIRWriter {
13121308
// ty_idx:
13131309
OutStreamer.emitSizeT(typeIndex(NP->getType()));
13141310
// num_bytes:
1315-
DataLayout DL(&M);
13161311
assert(DL.getPointerSize(NP->getType()->getAddressSpace()) ==
13171312
sizeof(size_t));
13181313
OutStreamer.emitSizeT(sizeof(size_t));

0 commit comments

Comments
 (0)