diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-14 13:52:02 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-11-14 14:21:17 +0000 |
| commit | ba229113a9e740e06ca03208cbcdde5bf24d710a (patch) | |
| tree | ef021b785d199912fc8f743acb71f3220338ffd7 /llvm/lib | |
| parent | b5f94adbf389069727ebf2dd15bcb0021cff18b1 (diff) | |
| download | bcm5719-llvm-ba229113a9e740e06ca03208cbcdde5bf24d710a.tar.gz bcm5719-llvm-ba229113a9e740e06ca03208cbcdde5bf24d710a.zip | |
SROA - fix uninitialized variable warnings. NFCI.
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index d9f42b9d855..c1f1a7a09a5 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -362,7 +362,7 @@ private: /// The beginning and ending offsets of the alloca for this /// partition. - uint64_t BeginOffset, EndOffset; + uint64_t BeginOffset = 0, EndOffset = 0; /// The start and end iterators of this partition. iterator SI, SJ; @@ -1683,7 +1683,7 @@ static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr, /// Compute the adjusted alignment for a load or store from an offset. static unsigned getAdjustedAlignment(Instruction *I, uint64_t Offset, const DataLayout &DL) { - unsigned Alignment; + unsigned Alignment = 0; Type *Ty; if (auto *LI = dyn_cast<LoadInst>(I)) { Alignment = LI->getAlignment(); @@ -2301,9 +2301,9 @@ class llvm::sroa::AllocaSliceRewriter // The new offsets of the slice currently being rewritten relative to the // original alloca. - uint64_t NewBeginOffset, NewEndOffset; + uint64_t NewBeginOffset = 0, NewEndOffset = 0; - uint64_t SliceSize; + uint64_t SliceSize = 0; bool IsSplittable = false; bool IsSplit = false; Use *OldUse = nullptr; @@ -3223,7 +3223,7 @@ class AggLoadStoreRewriter : public InstVisitor<AggLoadStoreRewriter, bool> { /// The current pointer use being rewritten. This is used to dig up the used /// value (as opposed to the user). - Use *U; + Use *U = nullptr; /// Used to calculate offsets, and hence alignment, of subobjects. const DataLayout &DL; |

