aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-12-01 09:07:11 -0800
committerFelipe de Azevedo Piovezan <fpiovezan@apple.com>2023-12-04 10:23:04 -0800
commit7a86cc6c4ca11e37d5985d4fc902658ab6ad0e22 (patch)
treead88a05859ee2308e93cc1778b4783cdb37fe814 /clang/lib/Frontend/CompilerInvocation.cpp
parent503dbe75a042af2af35b90d23153752c66dcbf25 (diff)
downloadllvm-7a86cc6c4ca11e37d5985d4fc902658ab6ad0e22.zip
llvm-7a86cc6c4ca11e37d5985d4fc902658ab6ad0e22.tar.gz
llvm-7a86cc6c4ca11e37d5985d4fc902658ab6ad0e22.tar.bz2
[lldb][NFC] Remove unnecessary std::string temporaries
The existing code was taking three substrings from a regex match and converting to std::strings prior to using them. This may have been done to address null-termination concerns, but this is not the case: 1. `name` was being used to call `c_str()` and then implicitly converted back to a `StringRef` on the call to `ToAddress`. While the path `const char *` -> `StringRef` requires null-termination, we can simply use the original StringRef. 2. `str_offset` was being converted back to a StringRef in order to call a member method. Member methods can't handle non-null termination. 3. `sign` simply had it's 0-th element accessed.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions