diff options
| author | Reid Kleckner <rnk@google.com> | 2019-10-10 01:10:01 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-10-10 01:10:01 +0000 |
| commit | c34385d07c7d59447bf836b740f032235391d121 (patch) | |
| tree | 78e30b3299264ab557a9b6f86602e358f899ba6c /clang/lib/Sema | |
| parent | 9d8f0b3519c4e9e4e2a3d3b19ea0caf9ef3f85ce (diff) | |
| download | bcm5719-llvm-c34385d07c7d59447bf836b740f032235391d121.tar.gz bcm5719-llvm-c34385d07c7d59447bf836b740f032235391d121.zip | |
Revert [mangle] Fix mangling where an extra mangle context is required.
This reverts r374200 (git commit fd18e94697c987d5f24e25aa4e27adaffff3cce4)
Causes crashes just compiling `int main() {}` on my machine.
llvm-svn: 374268
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index b05ed75e879..a76a840f26e 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -352,13 +352,21 @@ Sema::getCurrentMangleNumberContext(const DeclContext *DC, // -- the initializers of inline variables case VariableTemplate: // -- the initializers of templated variables - return &Context.getManglingNumberContext(ASTContext::NeedExtraManglingDecl, - ManglingContextDecl); + return &ExprEvalContexts.back().getMangleNumberingContext(Context); } llvm_unreachable("unexpected context"); } +MangleNumberingContext & +Sema::ExpressionEvaluationContextRecord::getMangleNumberingContext( + ASTContext &Ctx) { + assert(ManglingContextDecl && "Need to have a context declaration"); + if (!MangleNumbering) + MangleNumbering = Ctx.createMangleNumberingContext(); + return *MangleNumbering; +} + CXXMethodDecl *Sema::startLambdaDefinition( CXXRecordDecl *Class, SourceRange IntroducerRange, TypeSourceInfo *MethodTypeInfo, SourceLocation EndLoc, |

