hanchenye-llvm-project/clang/lib/AST
Bruno Ricci e64aee87a0 [AST] Update the comments of the various Expr::Ignore* + Related cleanups
The description of what the various Expr::Ignore* do has drifted from the
actual implementation.

Inspection reveals that IgnoreParenImpCasts() is not equivalent to doing
IgnoreParens() + IgnoreImpCasts() until reaching a fixed point, but
IgnoreParenCasts() is equivalent to doing IgnoreParens() + IgnoreCasts()
until reaching a fixed point. There is also a fair amount of duplication
in the various Expr::Ignore* functions which increase the chance of further
future inconsistencies. In preparation for the next patch which will factor
out the implementation of the various Expr::Ignore*, do the following cleanups:

Remove Stmt::IgnoreImplicit, in favor of Expr::IgnoreImplicit. IgnoreImplicit
is the only function among all of the Expr::Ignore* which is available in Stmt.
There are only a few users of Stmt::IgnoreImplicit. They can just use instead
Expr::IgnoreImplicit like they have to do for the other Ignore*.

Move Expr::IgnoreImpCasts() from Expr.h to Expr.cpp. This made no difference
in the run-time with my usual benchmark (-fsyntax-only on all of Boost).

While we are at it, make IgnoreParenNoopCasts take a const reference to the
ASTContext for const correctness.

Update the comments to match what the Expr::Ignore* are actually doing.
I am not sure that listing exactly what each Expr::Ignore* do is optimal,
but it certainly looks better than the current state which is in my opinion
between misleading and just plain wrong.

The whole patch is NFC (if you count removing Stmt::IgnoreImplicit as NFC).

Differential Revision: https://reviews.llvm.org/D57266

Reviewed By: aaron.ballman

llvm-svn: 353006
2019-02-03 19:50:56 +00:00
..
APValue.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTConsumer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTContext.cpp Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00
ASTDiagnostic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTDumper.cpp [AST] Extract ASTNodeTraverser class from ASTDumper 2019-02-03 14:06:54 +00:00
ASTImporter.cpp Remove unused variable to silence compiler warning 2019-01-29 06:53:31 +00:00
ASTImporterLookupTable.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTStructuralEquivalence.cpp Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00
ASTTypeTraits.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AttrImpl.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt [ASTImporter] Add importer specific lookup 2018-12-17 13:53:12 +00:00
CXXABI.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CXXInheritance.cpp [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
Comment.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommentBriefParser.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommentCommandTraits.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommentLexer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommentParser.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CommentSema.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ComparisonCategories.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DataCollection.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Decl.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclBase.cpp [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
DeclCXX.cpp Fix handling of usual deallocation functions in various configuratios. 2019-02-03 03:44:31 +00:00
DeclFriend.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclGroup.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclObjC.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclOpenMP.cpp Don't use ASTContext in DeclOpenMP.h because it's still incomplete. 2019-02-01 21:19:20 +00:00
DeclPrinter.cpp [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
DeclTemplate.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeclarationName.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Expr.cpp [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
ExprCXX.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExprClassification.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExprConstant.cpp Add a new builtin: __builtin_dynamic_object_size 2019-01-30 20:34:53 +00:00
ExprObjC.cpp Fix "control reaches end of non-void function" warning. NFCI. 2019-01-25 11:36:51 +00:00
ExternalASTMerger.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExternalASTSource.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FormatString.cpp OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
FormatStringParsing.h OpenCL: Improve vector printf warnings 2018-12-01 22:16:27 +00:00
InheritViz.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ItaniumCXXABI.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ItaniumMangle.cpp [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
Linkage.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Mangle.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MicrosoftCXXABI.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MicrosoftMangle.cpp [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive. 2019-02-01 20:25:04 +00:00
NSAPI.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NestedNameSpecifier.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ODRHash.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
OSLog.cpp os_log: Allow specifying mask type in format string. 2018-11-06 07:05:14 +00:00
OpenMPClause.cpp [clang][OpenMP] OMPFlushClause is synthetic, no such clause exists 2019-01-28 17:04:11 +00:00
ParentMap.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PrintfFormatString.cpp OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
QualTypeNames.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RawCommentList.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RecordLayout.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RecordLayoutBuilder.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ScanfFormatString.cpp OpenCL: Use length modifier for warning on vector printf arguments 2019-01-29 20:49:54 +00:00
SelectorLocationsKind.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Stmt.cpp [AST] Update the comments of the various Expr::Ignore* + Related cleanups 2019-02-03 19:50:56 +00:00
StmtCXX.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StmtIterator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StmtObjC.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StmtOpenMP.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StmtPrinter.cpp Re-commit "[AST] Introduce GenericSelectionExpr::Association" 2019-01-29 12:57:11 +00:00
StmtProfile.cpp Re-commit "[AST] Introduce GenericSelectionExpr::Association" 2019-01-29 12:57:11 +00:00
StmtViz.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TemplateBase.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TemplateName.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TextNodeDumper.cpp [ASTDump] Add a flag indicating whether a CXXThisExpr is implicit 2019-02-03 18:20:27 +00:00
Type.cpp [Sema] Fix Modified Type in address_space AttributedType 2019-01-24 00:11:35 +00:00
TypeLoc.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TypePrinter.cpp Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00
VTTBuilder.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
VTableBuilder.cpp Rename getTypeQualifiers to getMethodQualifiers. 2019-01-28 11:37:49 +00:00