[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 19 14:53:49 PDT 2020


zequanwu updated this revision to Diff 265031.
zequanwu added a comment.

Remove check for context of `LambdaContextDecl`.
Update test cases.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80153/new/

https://reviews.llvm.org/D80153

Files:
  clang/lib/AST/MicrosoftMangle.cpp


Index: clang/lib/AST/MicrosoftMangle.cpp
===================================================================
--- clang/lib/AST/MicrosoftMangle.cpp
+++ clang/lib/AST/MicrosoftMangle.cpp
@@ -947,12 +947,11 @@
 
           mangleSourceName(Name);
 
-          // If the context of a closure type is an initializer for a class
-          // member (static or nonstatic), it is encoded in a qualified name.
+          // If the context is a variable or a class member, it is encoded
+          // in a qualified name.
           if (LambdaManglingNumber && LambdaContextDecl) {
             if ((isa<VarDecl>(LambdaContextDecl) ||
-                 isa<FieldDecl>(LambdaContextDecl)) &&
-                LambdaContextDecl->getDeclContext()->isRecord()) {
+                 isa<FieldDecl>(LambdaContextDecl))) {
               mangleUnqualifiedName(cast<NamedDecl>(LambdaContextDecl));
             }
           }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80153.265031.patch
Type: text/x-patch
Size: 908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200519/15a868e5/attachment-0001.bin>


More information about the cfe-commits mailing list