[PATCH] [-cxx-abi microsoft] Mangle __uuidof correctly into template parameters

David Majnemer david.majnemer at gmail.com
Mon Aug 12 17:25:51 PDT 2013



================
Comment at: lib/CodeGen/CodeGenModule.cpp:1052
@@ -1062,2 +1051,3 @@
+  StringRef Uuid = E->getUuidAsStringRef(Context);
   std::string Name = "_GUID_" + Uuid.lower();
   std::replace(Name.begin(), Name.end(), '-', '_');
----------------
Reid Kleckner wrote:
> It seems unfortunate that we're duplicating this computation.  We could raise it up into CXXUuidOfExpr.
They are sorta different semantically because you can end up with a template arg harboring a __uuidof expression but no global constant emitted. I don't know what you would call the combination of _GUID_ prefix and UUID lower-case suffix.

They would be semantically related if they had something to do with a VarDecl or some such entity.

================
Comment at: lib/AST/MicrosoftMangle.cpp:867
@@ +866,3 @@
+  if (UE) {
+    StringRef Uuid = UE->getUuidAsStringRef(Context.getASTContext());
+    std::string Name = "_GUID_" + Uuid.lower();
----------------
Reid Kleckner wrote:
> Please put a comment here about what mangling we're emulating.  It's a DeclRefExpr to a global struct of type __s_GUID with the uuid in the name?
Sure thing.


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



More information about the cfe-commits mailing list