Commit f2e93b66 by JF Bastien

Fix build warnings

The following CL enables -Werror: https://codereview.chromium.org/863093002/ There were two warnings left in our subzero build: - Dead default cases because all of an enum's values were handled by the switch. - Use of C99 VLA. R=stichnot@chromium.org TEST= make check BUG= none Review URL: https://codereview.chromium.org/862853003
parent 819d7b56
...@@ -304,14 +304,15 @@ void CfgNode::advancedPhiLowering() { ...@@ -304,14 +304,15 @@ void CfgNode::advancedPhiLowering() {
return; return;
// Count the number of non-deleted Phi instructions. // Count the number of non-deleted Phi instructions.
struct { struct PhiDesc {
InstPhi *Phi; InstPhi *Phi;
Variable *Dest; Variable *Dest;
Operand *Src; Operand *Src;
bool Processed; bool Processed;
size_t NumPred; // number of entries whose Src is this Dest size_t NumPred; // number of entries whose Src is this Dest
int32_t Weight; // preference for topological order int32_t Weight; // preference for topological order
} Desc[getPhis().size()]; };
llvm::SmallVector<PhiDesc, 32> Desc(getPhis().size());
size_t NumPhis = 0; size_t NumPhis = 0;
for (Inst &I : Phis) { for (Inst &I : Phis) {
......
...@@ -589,9 +589,6 @@ private: ...@@ -589,9 +589,6 @@ private:
const Ice::Intrinsics::FullIntrinsicInfo *I) { const Ice::Intrinsics::FullIntrinsicInfo *I) {
Ice::SizeT ArgIndex = 0; Ice::SizeT ArgIndex = 0;
switch (I->validateCall(Call, ArgIndex)) { switch (I->validateCall(Call, ArgIndex)) {
default:
report_fatal_error("Unknown validation error for intrinsic call");
break;
case Ice::Intrinsics::IsValidCall: case Ice::Intrinsics::IsValidCall:
break; break;
case Ice::Intrinsics::BadReturnType: { case Ice::Intrinsics::BadReturnType: {
......
...@@ -2906,9 +2906,6 @@ void VariableSplit::dump(const Cfg *Func, Ostream &Str) const { ...@@ -2906,9 +2906,6 @@ void VariableSplit::dump(const Cfg *Func, Ostream &Str) const {
case High: case High:
Str << "high"; Str << "high";
break; break;
default:
Str << "???";
break;
} }
Str << "("; Str << "(";
if (Func) if (Func)
......
...@@ -108,9 +108,6 @@ public: ...@@ -108,9 +108,6 @@ public:
case Opt_2: case Opt_2:
translateO2(); translateO2();
break; break;
default:
Func->setError("Target doesn't specify lowering steps.");
break;
} }
} }
virtual void translateOm1() { virtual void translateOm1() {
......
...@@ -4710,14 +4710,6 @@ void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { ...@@ -4710,14 +4710,6 @@ void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) {
Str << "\n"; Str << "\n";
break; break;
} }
default: {
std::string Buffer;
llvm::raw_string_ostream StrBuf(Buffer);
StrBuf << "Unable to lower initializer: ";
Init->dump(StrBuf);
llvm::report_fatal_error(StrBuf.str());
break;
}
} }
} }
} else if (IsConstant || IsExternal) } else if (IsConstant || IsExternal)
......
...@@ -100,9 +100,6 @@ Ice::Ostream &operator<<(Ice::Ostream &Stream, ExtendedType::TypeKind Kind) { ...@@ -100,9 +100,6 @@ Ice::Ostream &operator<<(Ice::Ostream &Stream, ExtendedType::TypeKind Kind) {
case ExtendedType::FuncSig: case ExtendedType::FuncSig:
Stream << "FuncSig"; Stream << "FuncSig";
break; break;
default:
Stream << "??";
break;
} }
return Stream; return Stream;
} }
...@@ -1434,9 +1431,6 @@ private: ...@@ -1434,9 +1431,6 @@ private:
if (!ALLOW_DUMP) if (!ALLOW_DUMP)
return; return;
switch (Value) { switch (Value) {
default:
report_fatal_error("Unknown VectorIndexCheckValue");
break;
case VectorIndexNotVector: case VectorIndexNotVector:
Stream << "Vector index on non vector"; Stream << "Vector index on non vector";
break; break;
...@@ -2489,10 +2483,6 @@ void FunctionParser::ProcessRecord() { ...@@ -2489,10 +2483,6 @@ void FunctionParser::ProcessRecord() {
if (IntrinsicInfo) { if (IntrinsicInfo) {
Ice::SizeT ArgIndex = 0; Ice::SizeT ArgIndex = 0;
switch (IntrinsicInfo->validateCall(Inst, ArgIndex)) { switch (IntrinsicInfo->validateCall(Inst, ArgIndex)) {
default:
Error("Unknown validation error for intrinsic call");
// TODO(kschimpf) Remove error recovery once implementation complete.
break;
case Ice::Intrinsics::IsValidCall: case Ice::Intrinsics::IsValidCall:
break; break;
case Ice::Intrinsics::BadReturnType: { case Ice::Intrinsics::BadReturnType: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment