@@ -1049,7 +1049,7 @@ class IRBuilderBase {
10491049
10501050 // / Create a call to llvm.stacksave
10511051 CallInst *CreateStackSave (const Twine &Name = " " ) {
1052- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1052+ const DataLayout &DL = BB->getDataLayout ();
10531053 return CreateIntrinsic (Intrinsic::stacksave, {DL.getAllocaPtrType (Context)},
10541054 {}, nullptr , Name);
10551055 }
@@ -1770,14 +1770,14 @@ class IRBuilderBase {
17701770
17711771 AllocaInst *CreateAlloca (Type *Ty, unsigned AddrSpace,
17721772 Value *ArraySize = nullptr , const Twine &Name = " " ) {
1773- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1773+ const DataLayout &DL = BB->getDataLayout ();
17741774 Align AllocaAlign = DL.getPrefTypeAlign (Ty);
17751775 return Insert (new AllocaInst (Ty, AddrSpace, ArraySize, AllocaAlign), Name);
17761776 }
17771777
17781778 AllocaInst *CreateAlloca (Type *Ty, Value *ArraySize = nullptr ,
17791779 const Twine &Name = " " ) {
1780- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1780+ const DataLayout &DL = BB->getDataLayout ();
17811781 Align AllocaAlign = DL.getPrefTypeAlign (Ty);
17821782 unsigned AddrSpace = DL.getAllocaAddrSpace ();
17831783 return Insert (new AllocaInst (Ty, AddrSpace, ArraySize, AllocaAlign), Name);
@@ -1815,7 +1815,7 @@ class IRBuilderBase {
18151815 LoadInst *CreateAlignedLoad (Type *Ty, Value *Ptr, MaybeAlign Align,
18161816 bool isVolatile, const Twine &Name = " " ) {
18171817 if (!Align) {
1818- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1818+ const DataLayout &DL = BB->getDataLayout ();
18191819 Align = DL.getABITypeAlign (Ty);
18201820 }
18211821 return Insert (new LoadInst (Ty, Ptr, Twine (), isVolatile, *Align), Name);
@@ -1824,7 +1824,7 @@ class IRBuilderBase {
18241824 StoreInst *CreateAlignedStore (Value *Val, Value *Ptr, MaybeAlign Align,
18251825 bool isVolatile = false ) {
18261826 if (!Align) {
1827- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1827+ const DataLayout &DL = BB->getDataLayout ();
18281828 Align = DL.getABITypeAlign (Val->getType ());
18291829 }
18301830 return Insert (new StoreInst (Val, Ptr, isVolatile, *Align));
@@ -1841,7 +1841,7 @@ class IRBuilderBase {
18411841 AtomicOrdering FailureOrdering,
18421842 SyncScope::ID SSID = SyncScope::System) {
18431843 if (!Align) {
1844- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1844+ const DataLayout &DL = BB->getDataLayout ();
18451845 Align = llvm::Align (DL.getTypeStoreSize (New->getType ()));
18461846 }
18471847
@@ -1854,7 +1854,7 @@ class IRBuilderBase {
18541854 AtomicOrdering Ordering,
18551855 SyncScope::ID SSID = SyncScope::System) {
18561856 if (!Align) {
1857- const DataLayout &DL = BB->getModule ()-> getDataLayout ();
1857+ const DataLayout &DL = BB->getDataLayout ();
18581858 Align = llvm::Align (DL.getTypeStoreSize (Val->getType ()));
18591859 }
18601860
0 commit comments