This is an archive of the discontinued LLVM Phabricator instance.

[AST] Refactor PredefinedExpr
ClosedPublic

Authored by riccibruno on Oct 23 2018, 1:03 PM.

Details

Summary

Make the following changes to PredefinedExpr:

  1. Move PredefinedExpr below StringLiteral so that it can use its definition.
  2. Rename IdentType to IdentKind to be more in line with clang's conventions.
  3. Move the location and the IdentKind into the newly available space of the bit-fields of Stmt.
  4. Only store the function name when needed. When parsing all of Boost, of the 1357 PredefinedExpr 919 have no function name.

Diff Detail

Repository
rC Clang

Event Timeline

riccibruno created this revision.Oct 23 2018, 1:03 PM
rjmccall added inline comments.Oct 24 2018, 5:22 PM
include/clang/AST/Expr.h
1687

"always" would be clearer than "in fact".

include/clang/AST/Stmt.h
279

Since you're changing this around anyway, please make it a "kind" rather than a "type". Even if it's just the field name for now, it's progress.

283

Not sure why this is abbreviated.

lib/AST/Expr.cpp
470

!= nullptr is clearer.

riccibruno marked 4 inline comments as done.
riccibruno retitled this revision from [AST] Pack PredefinedExpr to [AST] Refactor PredefinedExpr.
riccibruno edited the summary of this revision. (Show Details)

Address rjmcall's comments. In particular use "Kind" instead of "Type" and propagate
the change to the users. Change the title to "[AST] Refactor PredefinedExpr" since this
patch is doing various changes to PredefinedExpr.

rjmccall accepted this revision.Oct 26 2018, 9:21 PM

LGTM.

include/clang/AST/Stmt.h
279

Thank you! That was more than I expected, but it's definitely better this way.

This revision is now accepted and ready to land.Oct 26 2018, 9:21 PM
This revision was automatically updated to reflect the committed changes.