diff options
| author | Nico Weber <thakis@chromium.org> | 2019-11-17 02:09:25 -0500 |
|---|---|---|
| committer | Nico Weber <thakis@chromium.org> | 2019-11-17 02:09:25 -0500 |
| commit | c9276fbfdf0c7caf1576b2db562286d7cec7e53b (patch) | |
| tree | b584cd30cae5f36372ed6fd48cb2cc4abec54dfa /clang/lib/AST/DeclCXX.cpp | |
| parent | cc6b85390170725d2341416af2b2ab8ea6c25d83 (diff) | |
| download | bcm5719-llvm-c9276fbfdf0c7caf1576b2db562286d7cec7e53b.tar.gz bcm5719-llvm-c9276fbfdf0c7caf1576b2db562286d7cec7e53b.zip | |
Revert "[NFC] Refactor representation of materialized temporaries"
This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982.
It broke ./ClangdTests/FindExplicitReferencesTest.All
on the bots, see comments on https://reviews.llvm.org/D69360
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
| -rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index bca560c40ae..58b50de944e 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -2796,34 +2796,6 @@ NamespaceAliasDecl::CreateDeserialized(ASTContext &C, unsigned ID) { SourceLocation(), nullptr); } -void LifetimeExtendedTemporaryDecl::anchor() {} - -/// Retrieve the storage duration for the materialized temporary. -StorageDuration LifetimeExtendedTemporaryDecl::getStorageDuration() const { - const ValueDecl *ExtendingDecl = getExtendingDecl(); - if (!ExtendingDecl) - return SD_FullExpression; - // FIXME: This is not necessarily correct for a temporary materialized - // within a default initializer. - if (isa<FieldDecl>(ExtendingDecl)) - return SD_Automatic; - // FIXME: This only works because storage class specifiers are not allowed - // on decomposition declarations. - if (isa<BindingDecl>(ExtendingDecl)) - return ExtendingDecl->getDeclContext()->isFunctionOrMethod() ? SD_Automatic - : SD_Static; - return cast<VarDecl>(ExtendingDecl)->getStorageDuration(); -} - -APValue *LifetimeExtendedTemporaryDecl::getOrCreateValue(bool MayCreate) const { - assert(getStorageDuration() == SD_Static && - "don't need to cache the computed value for this temporary"); - if (MayCreate && !Value) - Value = (new (getASTContext()) APValue); - assert(Value && "may not be null"); - return Value; -} - void UsingShadowDecl::anchor() {} UsingShadowDecl::UsingShadowDecl(Kind K, ASTContext &C, DeclContext *DC, |

