summaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-10-10 01:14:22 +0000
committerReid Kleckner <rnk@google.com>2019-10-10 01:14:22 +0000
commit4d26f8932d77306049f2815dbddc44b9c39895c5 (patch)
tree2eb60e26eb3c9d85087ef3d93c3288aaeb781016 /lib/AST/ASTContext.cpp
parentfa29e307035ae592247836aef3e3c401cb9ff559 (diff)
downloadclang-4d26f8932d77306049f2815dbddc44b9c39895c5.tar.gz
Re-land [mangle] Fix mangling where an extra mangle context is required.
This reverts r374268 (git commit c34385d07c7d59447bf836b740f032235391d121) I think I reverted this by mistake, so I'm relanding it. While my bisect found this revision, I think the crashes I'm seeing locally must be environmental. Maybe the version of clang I'm using miscompiles tot clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index a41b64ffcc..8dd57f2bd2 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -10261,6 +10261,16 @@ ASTContext::getManglingNumberContext(const DeclContext *DC) {
return *MCtx;
}
+MangleNumberingContext &
+ASTContext::getManglingNumberContext(NeedExtraManglingDecl_t, const Decl *D) {
+ assert(LangOpts.CPlusPlus); // We don't need mangling numbers for plain C.
+ std::unique_ptr<MangleNumberingContext> &MCtx =
+ ExtraMangleNumberingContexts[D];
+ if (!MCtx)
+ MCtx = createMangleNumberingContext();
+ return *MCtx;
+}
+
std::unique_ptr<MangleNumberingContext>
ASTContext::createMangleNumberingContext() const {
return ABI->createMangleNumberingContext();