Simplify code to equivalent code. No need to test for null after cast<>, use

takeAs<> instead of cast<>(.take()). Fix 80-column violation in whitespace after
comment.

llvm-svn: 191170
This commit is contained in:
Nick Lewycky 2013-09-22 10:06:57 +00:00
parent ed4265c24e
commit 0f29289bb4
1 changed files with 5 additions and 9 deletions

View File

@ -340,9 +340,7 @@ void Sema::ActOnParamUnparsedDefaultArgument(Decl *param,
return;
ParmVarDecl *Param = cast<ParmVarDecl>(param);
if (Param)
Param->setUnparsedDefaultArg();
UnparsedDefaultArgLocs[Param] = ArgLoc;
}
@ -353,9 +351,7 @@ void Sema::ActOnParamDefaultArgumentError(Decl *param) {
return;
ParmVarDecl *Param = cast<ParmVarDecl>(param);
Param->setInvalidDecl();
UnparsedDefaultArgLocs.erase(Param);
}
@ -11154,7 +11150,7 @@ VarDecl *Sema::BuildExceptionDeclaration(Scope *S,
else {
// If the constructor used was non-trivial, set this as the
// "initializer".
CXXConstructExpr *construct = cast<CXXConstructExpr>(result.take());
CXXConstructExpr *construct = result.takeAs<CXXConstructExpr>();
if (!construct->getConstructor()->isTrivial()) {
Expr *init = MaybeCreateExprWithCleanups(construct);
ExDecl->setInit(init);