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

Reid Kleckner rnk at google.com
Mon Nov 18 13:50:14 PST 2013


  Ah, now that I've read through, I see that the patches were mixed together.


================
Comment at: include/clang/Sema/Scope.h:20
@@ -19,2 +19,3 @@
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/raw_ostream.h"
 
----------------
You can get by with a forward decl for raw_ostream.

================
Comment at: lib/AST/MicrosoftMangle.cpp:126
@@ +125,3 @@
+      return false;
+    //  return getAnonymousStructId(cast<TagDecl>(ND));
+
----------------
Some commented out code here and below.

================
Comment at: lib/AST/MicrosoftMangle.cpp:111
@@ +110,3 @@
+                                             raw_ostream &Out);
+  bool getNextDiscriminator(const NamedDecl *ND, uint64_t &disc) {
+    const DeclContext *DC = getEffectiveDeclContext(ND);
----------------
This can live near mangleNestedName.

================
Comment at: lib/AST/ItaniumCXXABI.cpp:44
@@ +43,3 @@
+
+  virtual unsigned getManglingNumber(const TagDecl *TD, Scope *) {
+    return ++TagManglingNumbers[TD->getIdentifier()];
----------------
Adding this overload and TagManglingNumbers seems like a separate change you can just commit.

================
Comment at: test/CodeGenCXX/microsoft-abi-static-initializers.cpp:27
@@ -26,3 +26,1 @@
 // CHECK-LABEL: define void @"\01?StaticLocal@@YAXXZ"()
-// CHECK: load i32* @"\01?$S1@?1??StaticLocal@@YAXXZ at 4IA"
-// CHECK: store i32 {{.*}}, i32* @"\01?$S1@?1??StaticLocal@@YAXXZ at 4IA"
----------------
Were these names wrong?


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



More information about the cfe-commits mailing list