[PATCH] [-cxx-abi microsoft] Implement local manglings accurately

Charles Davis cdavis5x at gmail.com
Tue Mar 4 17:32:02 PST 2014


  A few minor nits; otherwise, LGTM (though, as usual, you should really wait for the others to give their LGs).


================
Comment at: include/clang/AST/ASTContext.h:368
@@ -367,2 +367,3 @@
   llvm::DenseMap<const NamedDecl *, unsigned> MangleNumbers;
+  llvm::DenseMap<const VarDecl *, unsigned> StaticLocalNumbers;
 
----------------
This should have a doc comment explaining what exactly this is for.

================
Comment at: include/clang/AST/MangleNumberingContext.h:39
@@ -38,2 +38,3 @@
 public:
+  MangleNumberingContext() {}
   virtual ~MangleNumberingContext() {}
----------------
Is this really necessary?

================
Comment at: include/clang/Parse/Parser.h:743-748
@@ -737,7 +742,8 @@
   public:
     // ParseScope - Construct a new object to manage a scope in the
     // parser Self where the new Scope is created with the flags
     // ScopeFlags, but only when ManageScope is true (the default). If
     // ManageScope is false, this object does nothing.
-    ParseScope(Parser *Self, unsigned ScopeFlags, bool ManageScope = true)
+    ParseScope(Parser *Self, unsigned ScopeFlags, bool EnteredScope = true,
+               bool BeforeCompoundStmt = false)
       : Self(Self) {
----------------
This comment needs to be updated.

================
Comment at: lib/AST/MicrosoftMangle.cpp:743-744
@@ -726,2 +742,4 @@
+void MicrosoftCXXNameMangler::mangleNestedName(const NamedDecl *ND) {
   // <postfix> ::= <unqualified-name> [<postfix>]
   //           ::= <substitution> [<postfix>]
+  const DeclContext *DC = ND->getDeclContext();
----------------
You should probably update the BNF here, too.

================
Comment at: lib/Parse/ParseStmt.cpp:1623-1624
@@ +1622,4 @@
+  ParseScope InnerScope(this, Scope::DeclScope, C99orCXXorObjC,
+                        Tok.is(tok::l_brace));
+  // The body of the for loop has the same local mangling number as the
+  // for-init-statement.
----------------
There should be an empty line between these two lines.


http://llvm-reviews.chandlerc.com/D2953



More information about the cfe-commits mailing list