diff options
author | Tyker <tyker1@outlook.com> | 2019-11-16 17:04:34 +0100 |
---|---|---|
committer | Tyker <tyker1@outlook.com> | 2019-11-16 17:56:09 +0100 |
commit | 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982 (patch) | |
tree | 727588f22579140c098d5a56d37162fa6dd775c4 /clang/lib/AST/ASTContext.cpp | |
parent | 423f541c1a322963cf482683fe9777ef0692082d (diff) | |
download | bcm5719-llvm-08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982.tar.gz bcm5719-llvm-08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982.zip |
[NFC] Refactor representation of materialized temporaries
Summary:
this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718
Reviewers: rsmith, martong, shafik
Reviewed By: rsmith
Subscribers: rnkovacs, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69360
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index cda51ec755a..752c100aab2 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -875,10 +875,6 @@ ASTContext::~ASTContext() { A != AEnd; ++A) A->second->~AttrVec(); - for (std::pair<const MaterializeTemporaryExpr *, APValue *> &MTVPair : - MaterializedTemporaryValues) - MTVPair.second->~APValue(); - for (const auto &Value : ModuleInitializers) Value.second->~PerModuleInitializers(); @@ -10324,21 +10320,6 @@ unsigned ASTContext::getParameterIndex(const ParmVarDecl *D) const { return I->second; } -APValue * -ASTContext::getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E, - bool MayCreate) { - assert(E && E->getStorageDuration() == SD_Static && - "don't need to cache the computed value for this temporary"); - if (MayCreate) { - APValue *&MTVI = MaterializedTemporaryValues[E]; - if (!MTVI) - MTVI = new (*this) APValue; - return MTVI; - } - - return MaterializedTemporaryValues.lookup(E); -} - QualType ASTContext::getStringLiteralArrayType(QualType EltTy, unsigned Length) const { // A C++ string literal has a const-qualified element type (C++ 2.13.4p1). |