Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6963309

Browse filesBrowse files
[Frontend] Avoid creating a temporary instance of std::string (NFC) (#140326)
Since getLastArgValue returns StringRef, and the constructor of SmallString accepts StringRef, we do not need to go through a temporary instance of std::string.
1 parent dfac044 commit 6963309
Copy full SHA for 6963309

File tree

1 file changed

+1
-2
lines changed
Filter options

1 file changed

+1
-2
lines changed

‎clang/lib/Frontend/CompilerInvocation.cpp

Copy file name to clipboardExpand all lines: clang/lib/Frontend/CompilerInvocation.cpp
+1-2
Original file line numberDiff line numberDiff line change
@@ -2055,8 +2055,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
20552055
// The memory profile runtime appends the pid to make this name more unique.
20562056
const char *MemProfileBasename = "memprof.profraw";
20572057
if (Args.hasArg(OPT_fmemory_profile_EQ)) {
2058-
SmallString<128> Path(
2059-
std::string(Args.getLastArgValue(OPT_fmemory_profile_EQ)));
2058+
SmallString<128> Path(Args.getLastArgValue(OPT_fmemory_profile_EQ));
20602059
llvm::sys::path::append(Path, MemProfileBasename);
20612060
Opts.MemoryProfileOutput = std::string(Path);
20622061
} else if (Args.hasArg(OPT_fmemory_profile))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.