llvm-project/clang/lib/AST
Raphael Isemann 0478720157 [clang] Prevent that Decl::dump on a CXXRecordDecl deserialises further declarations.
Decl::dump is primarily used for debugging to visualise the current state of a
declaration. Usually Decl::dump just displays the current state of the Decl and
doesn't actually change any of its state, however since commit
457226e02a the method actually started loading
additional declarations from the ExternalASTSource. This causes that calling
Decl::dump during a debugging session now actually does permanent changes to the
AST and will cause the debugged program run to deviate from the original run.

The change that caused this behaviour is the addition of
`hasConstexprDestructor` (which is called from the TextNodeDumper) which
performs a lookup into the current CXXRecordDecl to find the destructor. All
other similar methods just return their respective bit in the DefinitionData
(which obviously doesn't have such side effects).

This just changes the node printer to emit "unknown_constexpr" in case a
CXXRecordDecl is dumped that could potentially call into the ExternalASTSource
instead of the usually empty string/"constexpr". For CXXRecordDecls that can
safely be dumped the old behaviour is preserved

Reviewed By: bruno

Differential Revision: https://reviews.llvm.org/D80878
2020-09-07 12:31:30 +02:00
..
Interp [clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString 2020-08-05 13:54:37 +01:00
APValue.cpp Add proper move ctor/move assign to APValue. NFCI. 2020-09-06 13:02:11 +02:00
ASTConcept.cpp [Concepts] Transform constraints of non-template functions to ConstantEvaluated 2020-01-25 23:00:24 +02: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 [Sema][AArch64] Support arm_sve_vector_bits attribute 2020-08-27 10:38:32 +00:00
ASTDiagnostic.cpp [clang][nearly-NFC] Remove some superfluous uses of NamedDecl::getNameAsString 2020-08-05 13:54:37 +01:00
ASTDumper.cpp [clang] Rework how and when APValues are dumped 2020-07-06 22:03:08 +01:00
ASTImporter.cpp [AST] add parenthesis locations for IfStmt and SwitchStmt 2020-08-10 19:19:51 -07:00
ASTImporterLookupTable.cpp [ASTImporter] Add Visitor for TypedefNameDecl's 2020-07-28 11:52:29 -05:00
ASTStructuralEquivalence.cpp [Matrix] Add matrix type to Clang. 2020-05-11 18:55:45 +01:00
ASTTypeTraits.cpp [clang] Allow DynTypedNode to store a TemplateArgumentLoc 2020-08-10 03:09:18 -04:00
AttrImpl.cpp [OPENMP]Fix PR47158, case 3: allow devic_typein nested declare target region. 2020-08-24 09:58:37 -04:00
CMakeLists.txt Extract infrastructure to ignore intermediate expressions into `clang/AST/IgnoreExpr.h` 2020-09-07 09:32:30 +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 Remove unused parameter from CXXRecordDecl::forallBases [NFC] 2020-02-29 14:23:44 +01:00
Comment.cpp Fix "pointer is null" static analyzer warning. NFCI. 2020-01-07 13:41:52 +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 Explicitly include <cassert> when using assert 2020-03-02 22:45:28 +01:00
CommentLexer.cpp [AST] CommentLexer - Remove (optional) Invalid parameter from getSpelling. 2019-09-18 12:11:16 +00:00
CommentParser.cpp Adds a warning when an inline Doxygen comment has no argument 2019-08-05 08:05:16 +00:00
CommentSema.cpp [AST] Remove DeclCXX.h dep on ASTContext.h 2020-04-06 10:09:01 -07:00
ComparisonCategories.cpp [AST] Remove DeclCXX.h dep on ASTContext.h 2020-04-06 10:09:01 -07:00
ComputeDependence.cpp [clang] Set the error-bit for ill-formed semantic InitListExpr. 2020-07-21 09:39:44 +02:00
DataCollection.cpp Avoid SourceManager.h include in RawCommentList.h, add missing incs 2020-02-27 13:49:40 -08:00
Decl.cpp Make -fvisibility-inlines-hidden apply to static local variables in inline functions on Darwin 2020-09-02 12:19:12 -04:00
DeclBase.cpp [clang] Exclude invalid destructors from lookups. 2020-08-26 19:29:30 +02:00
DeclCXX.cpp [clang][NFC] Pass the ASTContext to CXXRecordDecl::setCaptures 2020-07-29 14:55:15 +01: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 [clang] Rename Decl::isHidden() to isUnconditionallyVisible(). 2020-06-12 09:33:42 +02:00
DeclOpenMP.cpp [OPENMP]Redesign of OMPExecutableDirective/OMPDeclarativeDirective representation. 2020-08-06 12:25:19 -04:00
DeclPrinter.cpp [clang][NFC] DeclPrinter: use NamedDecl::getDeclName instead of NamedDecl::printName to print the name of enumerations, namespaces and template parameters. 2020-08-05 13:54:38 +01:00
DeclTemplate.cpp [clang][NFC] Remove spurious +x flag on DeclTemplate.cpp and DeclTemplate.h 2020-08-05 13:54:30 +01:00
DeclarationName.cpp [OpenMP] `omp begin/end declare variant` - part 2, sema ("+CG") 2020-03-27 02:30:58 -05:00
Expr.cpp [Ignore Expressions][NFC] Refactor to better use `IgnoreExpr.h` and nits 2020-09-07 09:32:30 +00:00
ExprCXX.cpp [AST][FPEnv] Keep FP options in trailing storage of CallExpr 2020-07-24 12:04:19 +07:00
ExprClassification.cpp [AST][RecoveryExpr] Fix the value category for recovery expr. 2020-07-08 13:55:07 +02:00
ExprConcepts.cpp [AST] Make Expr::setDependence protected and remove add/removeDependence. NFC 2020-03-19 21:54:40 +01:00
ExprConstant.cpp Revert "Canonicalize declaration pointers when forming APValues." 2020-09-04 10:13:28 -04:00
ExprObjC.cpp [AST] Move dependence computations into a separate file 2020-03-17 09:22:31 +01:00
ExternalASTMerger.cpp Modernize llvm::Error handling in ExternalASTMerger 2019-11-14 13:58:32 +01:00
ExternalASTSource.cpp Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
FormatString.cpp [Sema] Emit a -Wformat warning for printf("%s", (void*)p) 2020-07-10 15:10:24 -04:00
FormatStringParsing.h Add a missing header comment, NFC 2019-08-13 22:01:39 +00:00
IgnoreExpr.cpp Extract infrastructure to ignore intermediate expressions into `clang/AST/IgnoreExpr.h` 2020-09-07 09:32:30 +00:00
InheritViz.cpp Silence static analyzer getAs<RecordType> null dereference warnings. NFCI. 2019-10-03 11:22:48 +00:00
ItaniumCXXABI.cpp [c++20] Fix some ambiguities in our mangling of lambdas with explicit 2019-09-05 01:23:47 +00:00
ItaniumMangle.cpp Reland "[CodeGen][AArch64] Support arm_sve_vector_bits attribute" 2020-08-28 15:57:09 +00:00
JSONNodeDumper.cpp [Sema][AArch64] Support arm_sve_vector_bits attribute 2020-08-27 10:38:32 +00:00
Linkage.h [AST] Split parent map traversal logic into ParentMapContext.h 2020-01-24 13:42:28 -08:00
Mangle.cpp Mangle.cpp - fix implicit Format.h dependency. NFC. 2020-06-23 14:42:30 +01:00
MicrosoftCXXABI.cpp Separate the MS inheritance model enum from the attribute, NFC 2019-11-22 16:06:30 -08:00
MicrosoftMangle.cpp [OpenCL] Add global_device and global_host address spaces 2020-07-29 17:24:53 +03:00
NSAPI.cpp [ARM] Add __bf16 as new Bfloat16 C Type 2020-06-05 10:32:43 +01:00
NestedNameSpecifier.cpp [AST][RecoveryExpr] Avoid spurious 'missing typename' diagnostic when the NNS contains errors. 2020-06-30 16:18:32 +02:00
ODRHash.cpp [ODRHash] Remove use of 'whitelist'. 2020-06-19 18:39:30 -07:00
OSLog.cpp [clang][NFC] Add 'override' keyword to virtual function overrides 2020-07-14 08:59:57 -07:00
OpenMPClause.cpp [OpenMP] Implement TR8 `present` motion modifier in Clang (1/2) 2020-07-29 12:18:45 -04:00
ParentMap.cpp [OPENMP]Fix PR42632: crash on the analysis of the OpenMP constructs. 2019-07-17 18:03:39 +00:00
ParentMapContext.cpp Remove clang::ast_type_traits namespace in favor of clang 2020-02-13 10:46:47 -08:00
PrintfFormatString.cpp [ARM] Add __bf16 as new Bfloat16 C Type 2020-06-05 10:32:43 +01:00
QualTypeNames.cpp Fix crash in getFullyQualifiedName for inline namespace 2019-12-28 16:35:51 +03:00
RawCommentList.cpp [clang] fix undefined behaviour in RawComment::getFormattedText() 2020-04-06 10:48:25 +02:00
RecordLayout.cpp [AIX] Implement AIX special alignment rule about double/long double 2020-07-27 15:13:03 -04:00
RecordLayoutBuilder.cpp [AST] Get field size in chars rather than bits in RecordLayoutBuilder. 2020-08-20 10:29:29 +02:00
ScanfFormatString.cpp Fix parameter name comments using clang-tidy. NFC. 2019-07-16 04:46:31 +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] add parenthesis locations for IfStmt and SwitchStmt 2020-08-10 19:19:51 -07: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 [OPENMP]Redesign of OMPExecutableDirective/OMPDeclarativeDirective representation. 2020-08-06 12:25:19 -04:00
StmtPrinter.cpp [OPENMP]Simplify representation for atomic, critical, master and section 2020-08-07 09:58:23 -04:00
StmtProfile.cpp [OPENMP50]Codegen for inscan reductions in worksharing directives. 2020-06-04 16:29:33 -04: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 Don't print `&` as part of reference template arguments. 2020-04-15 00:07:12 -07:00
TemplateName.cpp [AST] rename DependencyFlags.h => DependenceFlags.h, NFC 2020-03-16 13:54:21 +01:00
TextNodeDumper.cpp [clang] Prevent that Decl::dump on a CXXRecordDecl deserialises further declarations. 2020-09-07 12:31:30 +02:00
Type.cpp [Sema][AArch64] Support arm_sve_vector_bits attribute 2020-08-27 10:38:32 +00:00
TypeLoc.cpp [ARM] Add __bf16 as new Bfloat16 C Type 2020-06-05 10:32:43 +01:00
TypePrinter.cpp [Sema][AArch64] Support arm_sve_vector_bits attribute 2020-08-27 10:38:32 +00:00
VTTBuilder.cpp Silence static analyzer getAs<RecordType> null dereference warnings. NFCI. 2019-10-03 11:22:48 +00:00
VTableBuilder.cpp [c++20] consteval functions don't get vtable slots. 2020-06-30 18:22:09 -07:00