This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Use autos in lib/AST/Expr.cpp
AbandonedPublic

Authored by Eugene.Zelenko on Dec 9 2015, 11:00 AM.

Details

Summary

Autos are also used for pointer variables assigned via casts or memory allocation. Patch includes other minor cleanups.

Build and regressions were fine on RHEL 6.

Diff Detail

Event Timeline

Eugene.Zelenko retitled this revision from to [Clang] Use autos in lib/AST/Expr.cpp.
Eugene.Zelenko updated this object.
Eugene.Zelenko added reviewers: hans, aaron.ballman.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: cfe-commits.
aaron.ballman added inline comments.Dec 10 2015, 11:18 AM
lib/AST/Expr.cpp
67

Again, I don't think it is an improvement when the deduced type is on a different line (here and elsewhere).

1956

Is this line still required? I thought InitExprs was already a vector of Stmt objects. I think it should be a const auto * instead of const auto & as well.

3715

Hmmm, I'm not certain this is an improvement. It lacks the information that SubExprs is a pointer to a pointer, and it lacks the constness information. I would revert this one (and the next two).

lib/AST/Expr.cpp
1956

Will fix in commit.

3715

But all of this is mentioned in reinterpret_cast.

aaron.ballman added inline comments.Dec 10 2015, 12:01 PM
lib/AST/Expr.cpp
3715

It is, but our usual rule is to put the cv-qualifiers and &/* as part of the auto signature so that the type properties are easier to identify, which is what makes this one kind of challenging. Since Stmt is the same length as auto, I think leaving it as-is may be less confusing.

Eugene.Zelenko abandoned this revision.Jan 14 2016, 6:48 PM