Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: src/IceInstARM32.cpp

Issue 1221643012: Subzero: Add -Wshadow to the build. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Change the previous underscore naming style Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/IceInstARM32.cpp
diff --git a/src/IceInstARM32.cpp b/src/IceInstARM32.cpp
index 0476934e6f77b01c796c476127b9e5018f707185..3699d96e20df8d8c6df6be129381423bd371ebea 100644
--- a/src/IceInstARM32.cpp
+++ b/src/IceInstARM32.cpp
@@ -153,21 +153,22 @@ void InstARM32Pred::emitCmpLike(const char *Opcode, const InstARM32Pred *Inst,
Inst->getSrc(1)->emit(Func);
}
-OperandARM32Mem::OperandARM32Mem(Cfg * /* Func */, Type Ty, Variable *Base,
- ConstantInteger32 *ImmOffset, AddrMode Mode)
- : OperandARM32(kMem, Ty), Base(Base), ImmOffset(ImmOffset), Index(nullptr),
- ShiftOp(kNoShift), ShiftAmt(0), Mode(Mode) {
+OperandARM32Mem::OperandARM32Mem(Cfg * /* Func */, Type Ty, Variable *MyBase,
+ ConstantInteger32 *MyImmOffset,
+ AddrMode MyMode)
+ : OperandARM32(kMem, Ty), Base(MyBase), ImmOffset(MyImmOffset),
+ Index(nullptr), ShiftOp(kNoShift), ShiftAmt(0), Mode(MyMode) {
// The Neg modes are only needed for Reg +/- Reg.
assert(!isNegAddrMode());
NumVars = 1;
Vars = &this->Base;
}
-OperandARM32Mem::OperandARM32Mem(Cfg *Func, Type Ty, Variable *Base,
- Variable *Index, ShiftKind ShiftOp,
- uint16_t ShiftAmt, AddrMode Mode)
- : OperandARM32(kMem, Ty), Base(Base), ImmOffset(0), Index(Index),
- ShiftOp(ShiftOp), ShiftAmt(ShiftAmt), Mode(Mode) {
+OperandARM32Mem::OperandARM32Mem(Cfg *Func, Type Ty, Variable *MyBase,
+ Variable *MyIndex, ShiftKind MyShiftOp,
+ uint16_t MyShiftAmt, AddrMode MyMode)
+ : OperandARM32(kMem, Ty), Base(MyBase), ImmOffset(0), Index(MyIndex),
+ ShiftOp(MyShiftOp), ShiftAmt(MyShiftAmt), Mode(MyMode) {
NumVars = 2;
Vars = Func->allocateArrayOf<Variable *>(2);
Vars[0] = Base;
@@ -187,8 +188,8 @@ bool OperandARM32Mem::canHoldOffset(Type Ty, bool SignExt, int32_t Offset) {
}
OperandARM32FlexImm::OperandARM32FlexImm(Cfg * /* Func */, Type Ty,
- uint32_t Imm, uint32_t RotateAmt)
- : OperandARM32Flex(kFlexImm, Ty), Imm(Imm), RotateAmt(RotateAmt) {
+ uint32_t MyImm, uint32_t MyRotateAmt)
+ : OperandARM32Flex(kFlexImm, Ty), Imm(MyImm), RotateAmt(MyRotateAmt) {
NumVars = 0;
Vars = nullptr;
}
@@ -213,10 +214,11 @@ bool OperandARM32FlexImm::canHoldImm(uint32_t Immediate, uint32_t *RotateAmt,
return false;
}
-OperandARM32FlexReg::OperandARM32FlexReg(Cfg *Func, Type Ty, Variable *Reg,
- ShiftKind ShiftOp, Operand *ShiftAmt)
- : OperandARM32Flex(kFlexReg, Ty), Reg(Reg), ShiftOp(ShiftOp),
- ShiftAmt(ShiftAmt) {
+OperandARM32FlexReg::OperandARM32FlexReg(Cfg *Func, Type Ty, Variable *MyReg,
+ ShiftKind MyShiftOp,
+ Operand *MyShiftAmt)
+ : OperandARM32Flex(kFlexReg, Ty), Reg(MyReg), ShiftOp(MyShiftOp),
+ ShiftAmt(MyShiftAmt) {
NumVars = 1;
Variable *ShiftVar = llvm::dyn_cast_or_null<Variable>(ShiftAmt);
if (ShiftVar)
@@ -228,17 +230,17 @@ OperandARM32FlexReg::OperandARM32FlexReg(Cfg *Func, Type Ty, Variable *Reg,
}
InstARM32AdjustStack::InstARM32AdjustStack(Cfg *Func, Variable *SP,
- SizeT Amount, Operand *SrcAmount)
- : InstARM32(Func, InstARM32::Adjuststack, 2, SP), Amount(Amount) {
+ SizeT MyAmount, Operand *SrcAmount)
+ : InstARM32(Func, InstARM32::Adjuststack, 2, SP), Amount(MyAmount) {
addSource(SP);
addSource(SrcAmount);
}
-InstARM32Br::InstARM32Br(Cfg *Func, const CfgNode *TargetTrue,
- const CfgNode *TargetFalse,
- const InstARM32Label *Label, CondARM32::Cond Pred)
+InstARM32Br::InstARM32Br(Cfg *Func, const CfgNode *MyTargetTrue,
+ const CfgNode *MyTargetFalse,
+ const InstARM32Label *MyLabel, CondARM32::Cond Pred)
: InstARM32Pred(Func, InstARM32::Br, 0, nullptr, Pred),
- TargetTrue(TargetTrue), TargetFalse(TargetFalse), Label(Label) {}
+ TargetTrue(MyTargetTrue), TargetFalse(MyTargetFalse), Label(MyLabel) {}
bool InstARM32Br::optimizeBranch(const CfgNode *NextNode) {
// If there is no next block, then there can be no fallthrough to
@@ -310,8 +312,8 @@ InstARM32Ldr::InstARM32Ldr(Cfg *Func, Variable *Dest, OperandARM32Mem *Mem,
addSource(Mem);
}
-InstARM32Pop::InstARM32Pop(Cfg *Func, const VarList &Dests)
- : InstARM32(Func, InstARM32::Pop, 0, nullptr), Dests(Dests) {
+InstARM32Pop::InstARM32Pop(Cfg *Func, const VarList &MyDests)
+ : InstARM32(Func, InstARM32::Pop, 0, nullptr), Dests(MyDests) {
// Track modifications to Dests separately via FakeDefs.
// Also, a pop instruction affects the stack pointer and so it should not
// be allowed to be automatically dead-code eliminated. This is automatic
@@ -341,12 +343,12 @@ InstARM32Str::InstARM32Str(Cfg *Func, Variable *Value, OperandARM32Mem *Mem,
InstARM32Trap::InstARM32Trap(Cfg *Func)
: InstARM32(Func, InstARM32::Trap, 0, nullptr) {}
-InstARM32Umull::InstARM32Umull(Cfg *Func, Variable *DestLo, Variable *DestHi,
+InstARM32Umull::InstARM32Umull(Cfg *Func, Variable *DestLo, Variable *MyDestHi,
Variable *Src0, Variable *Src1,
CondARM32::Cond Predicate)
: InstARM32Pred(Func, InstARM32::Umull, 2, DestLo, Predicate),
// DestHi is expected to have a FakeDef inserted by the lowering code.
- DestHi(DestHi) {
+ DestHi(MyDestHi) {
addSource(Src0);
addSource(Src1);
}
@@ -400,17 +402,17 @@ template <> void InstARM32Mov::emit(const Cfg *Func) const {
assert(getSrcSize() == 1);
Variable *Dest = getDest();
if (Dest->hasReg()) {
- IceString Opcode = "mov";
+ IceString MyOpcode = "mov";
Operand *Src0 = getSrc(0);
if (const auto *Src0V = llvm::dyn_cast<Variable>(Src0)) {
if (!Src0V->hasReg()) {
- Opcode = IceString("ldr"); // Always use the whole stack slot.
+ MyOpcode = IceString("ldr"); // Always use the whole stack slot.
}
} else {
if (llvm::isa<OperandARM32Mem>(Src0))
- Opcode = IceString("ldr") + getWidthString(Dest->getType());
+ MyOpcode = IceString("ldr") + getWidthString(Dest->getType());
}
- Str << "\t" << Opcode << getPredicate() << "\t";
+ Str << "\t" << MyOpcode << getPredicate() << "\t";
getDest()->emit(Func);
Str << ", ";
getSrc(0)->emit(Func);
@@ -895,17 +897,13 @@ void OperandARM32FlexImm::emit(const Cfg *Func) const {
if (!BuildDefs::dump())
return;
Ostream &Str = Func->getContext()->getStrEmit();
- uint32_t Imm = getImm();
- uint32_t RotateAmt = getRotateAmt();
- Str << "#" << Utils::rotateRight32(Imm, 2 * RotateAmt);
+ Str << "#" << Utils::rotateRight32(getImm(), 2 * getRotateAmt());
}
void OperandARM32FlexImm::dump(const Cfg * /* Func */, Ostream &Str) const {
if (!BuildDefs::dump())
return;
- uint32_t Imm = getImm();
- uint32_t RotateAmt = getRotateAmt();
- Str << "#(" << Imm << " ror 2*" << RotateAmt << ")";
+ Str << "#(" << getImm() << " ror 2*" << getRotateAmt() << ")";
}
void OperandARM32FlexReg::emit(const Cfg *Func) const {
@@ -922,7 +920,6 @@ void OperandARM32FlexReg::emit(const Cfg *Func) const {
void OperandARM32FlexReg::dump(const Cfg *Func, Ostream &Str) const {
if (!BuildDefs::dump())
return;
- Variable *Reg = getReg();
if (Func)
Reg->dump(Func);
else
« src/IceInstARM32.h ('K') | « src/IceInstARM32.h ('k') | src/IceInstX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698