forked from OSchip/llvm-project
Fix some unused variable, control reaches end of non-void function,
and uninitialized use options. llvm-svn: 62270
This commit is contained in:
parent
8bdc698336
commit
435bbe0254
|
@ -1219,6 +1219,7 @@ bool Expr::isEvaluatable(ASTContext &Ctx) const {
|
||||||
APSInt Expr::EvaluateAsInt(ASTContext &Ctx) const {
|
APSInt Expr::EvaluateAsInt(ASTContext &Ctx) const {
|
||||||
EvalResult EvalResult;
|
EvalResult EvalResult;
|
||||||
bool Result = Evaluate(EvalResult, Ctx);
|
bool Result = Evaluate(EvalResult, Ctx);
|
||||||
|
Result = Result;
|
||||||
assert(Result && "Could not evaluate expression");
|
assert(Result && "Could not evaluate expression");
|
||||||
assert(EvalResult.Val.isInt() && "Expression did not evaluate to integer");
|
assert(EvalResult.Val.isInt() && "Expression did not evaluate to integer");
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ void SymbolRef::print(llvm::raw_ostream& os) const {
|
||||||
|
|
||||||
SymbolRef SymbolManager::getSymbol(const MemRegion* R) {
|
SymbolRef SymbolManager::getSymbol(const MemRegion* R) {
|
||||||
switch (R->getKind()) {
|
switch (R->getKind()) {
|
||||||
|
default:
|
||||||
|
assert(0 && "unprocessed region");
|
||||||
case MemRegion::VarRegionKind:
|
case MemRegion::VarRegionKind:
|
||||||
return getSymbol(cast<VarRegion>(R)->getDecl());
|
return getSymbol(cast<VarRegion>(R)->getDecl());
|
||||||
|
|
||||||
|
@ -38,8 +40,6 @@ SymbolRef SymbolManager::getSymbol(const MemRegion* R) {
|
||||||
const FieldRegion* FR = cast<FieldRegion>(R);
|
const FieldRegion* FR = cast<FieldRegion>(R);
|
||||||
return getFieldSymbol(FR->getSuperRegion(), FR->getDecl());
|
return getFieldSymbol(FR->getSuperRegion(), FR->getDecl());
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
assert(0 && "unprocessed region");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -301,15 +301,14 @@ RValue CodeGenFunction::EmitObjCPropertyGet(const Expr *Exp) {
|
||||||
EmitScalarExpr(E->getBase()),
|
EmitScalarExpr(E->getBase()),
|
||||||
false, CallArgList());
|
false, CallArgList());
|
||||||
}
|
}
|
||||||
else if (const ObjCKVCRefExpr *E = dyn_cast<ObjCKVCRefExpr>(Exp)) {
|
else {
|
||||||
|
const ObjCKVCRefExpr *E = cast<ObjCKVCRefExpr>(Exp);
|
||||||
Selector S = E->getGetterMethod()->getSelector();
|
Selector S = E->getGetterMethod()->getSelector();
|
||||||
return CGM.getObjCRuntime().
|
return CGM.getObjCRuntime().
|
||||||
GenerateMessageSend(*this, Exp->getType(), S,
|
GenerateMessageSend(*this, Exp->getType(), S,
|
||||||
EmitScalarExpr(E->getBase()),
|
EmitScalarExpr(E->getBase()),
|
||||||
false, CallArgList());
|
false, CallArgList());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
assert (0 && "bad expression node in EmitObjCPropertyGet");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
|
void CodeGenFunction::EmitObjCPropertySet(const Expr *Exp,
|
||||||
|
|
|
@ -490,7 +490,7 @@ Sema::LookupQualifiedName(DeclContext *LookupCtx, DeclarationName Name,
|
||||||
// the result of the lookup.
|
// the result of the lookup.
|
||||||
// FIXME: support using declarations!
|
// FIXME: support using declarations!
|
||||||
QualType SubobjectType;
|
QualType SubobjectType;
|
||||||
int SubobjectNumber;
|
int SubobjectNumber = 0;
|
||||||
for (BasePaths::paths_iterator Path = Paths.begin(), PathEnd = Paths.end();
|
for (BasePaths::paths_iterator Path = Paths.begin(), PathEnd = Paths.end();
|
||||||
Path != PathEnd; ++Path) {
|
Path != PathEnd; ++Path) {
|
||||||
const BasePathElement &PathElement = Path->back();
|
const BasePathElement &PathElement = Path->back();
|
||||||
|
|
Loading…
Reference in New Issue