[PATCH] Avoid extra back reference key lookup in msmangler

Timur Iskhodzhanov timurrrr at google.com
Sun Jun 15 06:05:45 PDT 2014


Looks good overall.

================
Comment at: lib/AST/MicrosoftMangle.cpp:615
@@ +614,3 @@
+    size_t Size = NameBackReferences.size();
+    BackRefMap::MapEntryTy &Entry =
+        NameBackReferences.GetOrCreateValue(Name, Size);
----------------
You probably want

  std::tie(I, Inserted) = NameBackReferences.insert(...)

See `MicrosoftCXXABI::getAddrOfVTable` as an example.

================
Comment at: lib/AST/MicrosoftMangle.cpp:694
@@ -673,1 +693,3 @@
+    llvm::SmallString<64> TemplateMangling;
+    llvm::raw_svector_ostream Stream(TemplateMangling);
     MicrosoftCXXNameMangler Extra(Context, Stream);
----------------
Am I right that you need `raw_svector_ostream` just to use `SmallString` instead of `string`?

http://reviews.llvm.org/D4130






More information about the cfe-commits mailing list