diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-09-07 11:23:39 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-09-07 12:31:30 +0200 |
commit | 0478720157f6413fad7595b8eff9c70d2d99b637 (patch) | |
tree | 9c54d6569bc28712c4c23db3aba4705b35e8f16b /llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp | |
parent | 56d1f3138b532f4e195a5aaba9ea65a8bcb8adb4 (diff) | |
download | llvm-0478720157f6413fad7595b8eff9c70d2d99b637.zip llvm-0478720157f6413fad7595b8eff9c70d2d99b637.tar.gz llvm-0478720157f6413fad7595b8eff9c70d2d99b637.tar.bz2 |
[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
457226e02a6e8533eaaa864a3fd7c8eeccd2bf58 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
Diffstat (limited to 'llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp')
0 files changed, 0 insertions, 0 deletions