hliao marked an inline comment as done.
hliao added inline comments.
================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:789
+ return Name;
+ return std::move(("__device_stub__" + Name).str());
+}
----------------
tra wrote:
> I suspect `return "__device_stub__" + Name;` would do. StringRef will convert
> to std::string and copy elision should avoid unnecessary copy.
"__device__stub__" + Name results in Twine, where not copy is generated. Only
the final str() converts Twine into std::string involving copies. Otherwise,
there's one copy from Name to std::string and another copy by std::string
operator+, right?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63335/new/
https://reviews.llvm.org/D63335
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits