[PATCH] D9403: llvm.noalias - Clang CodeGen for local restrict-qualified pointers

hfinkel at anl.gov hfinkel at anl.gov
Sat Jul 11 07:06:11 PDT 2015


hfinkel added inline comments.

================
Comment at: lib/CodeGen/CGDecl.cpp:1219-1224
@@ +1218,8 @@
+
+  std::string Name = CurFn->getName();
+  Name += ": ";
+  Name += D.getName();
+
+  llvm::MDNode *Scope =
+    MDB.createAnonymousAliasScope(NoAliasDomain, Name);
+  addNoAliasScope(Scope);
----------------
majnemer wrote:
> It's a shame that `createAnonymousAARoot` doesn't take a twine, it would save a memory allocation through here.
I'm not sure what you're proposing, exactly. MDBuilder::createString takes a StringRef (and, correspondingly MDString::get does). If createAnonymousAARoot took a Twine, it would need to allocate some SmallVector and then call toStringRef. Is that what you have in mind?



http://reviews.llvm.org/D9403







More information about the cfe-commits mailing list