mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[SROA] Pass Twine by const reference. NFCI.
Fixes clang-tidy warnings.
This commit is contained in:
parent
fe6ca64874
commit
7112c481fb
@ -1398,7 +1398,8 @@ static void speculateSelectInstLoads(SelectInst &SI) {
|
||||
/// This will return the BasePtr if that is valid, or build a new GEP
|
||||
/// instruction using the IRBuilder if GEP-ing is needed.
|
||||
static Value *buildGEP(IRBuilderTy &IRB, Value *BasePtr,
|
||||
SmallVectorImpl<Value *> &Indices, Twine NamePrefix) {
|
||||
SmallVectorImpl<Value *> &Indices,
|
||||
const Twine &NamePrefix) {
|
||||
if (Indices.empty())
|
||||
return BasePtr;
|
||||
|
||||
@ -1423,7 +1424,7 @@ static Value *buildGEP(IRBuilderTy &IRB, Value *BasePtr,
|
||||
static Value *getNaturalGEPWithType(IRBuilderTy &IRB, const DataLayout &DL,
|
||||
Value *BasePtr, Type *Ty, Type *TargetTy,
|
||||
SmallVectorImpl<Value *> &Indices,
|
||||
Twine NamePrefix) {
|
||||
const Twine &NamePrefix) {
|
||||
if (Ty == TargetTy)
|
||||
return buildGEP(IRB, BasePtr, Indices, NamePrefix);
|
||||
|
||||
@ -1468,7 +1469,7 @@ static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL,
|
||||
Value *Ptr, Type *Ty, APInt &Offset,
|
||||
Type *TargetTy,
|
||||
SmallVectorImpl<Value *> &Indices,
|
||||
Twine NamePrefix) {
|
||||
const Twine &NamePrefix) {
|
||||
if (Offset == 0)
|
||||
return getNaturalGEPWithType(IRB, DL, Ptr, Ty, TargetTy, Indices,
|
||||
NamePrefix);
|
||||
@ -1543,7 +1544,7 @@ static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL,
|
||||
static Value *getNaturalGEPWithOffset(IRBuilderTy &IRB, const DataLayout &DL,
|
||||
Value *Ptr, APInt Offset, Type *TargetTy,
|
||||
SmallVectorImpl<Value *> &Indices,
|
||||
Twine NamePrefix) {
|
||||
const Twine &NamePrefix) {
|
||||
PointerType *Ty = cast<PointerType>(Ptr->getType());
|
||||
|
||||
// Don't consider any GEPs through an i8* as natural unless the TargetTy is
|
||||
@ -1584,7 +1585,8 @@ static Value *getNaturalGEPWithOffset(IRBuilderTy &IRB, const DataLayout &DL,
|
||||
/// a single GEP as possible, thus making each GEP more independent of the
|
||||
/// surrounding code.
|
||||
static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr,
|
||||
APInt Offset, Type *PointerTy, Twine NamePrefix) {
|
||||
APInt Offset, Type *PointerTy,
|
||||
const Twine &NamePrefix) {
|
||||
// Even though we don't look through PHI nodes, we could be called on an
|
||||
// instruction in an unreachable block, which may be on a cycle.
|
||||
SmallPtrSet<Value *, 4> Visited;
|
||||
|
Loading…
Reference in New Issue
Block a user