summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Execution.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Tooling/Execution.cpp')
-rw-r--r--clang/lib/Tooling/Execution.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/clang/lib/Tooling/Execution.cpp b/clang/lib/Tooling/Execution.cpp
index 5d6559fb2b4..7ae67747acb 100644
--- a/clang/lib/Tooling/Execution.cpp
+++ b/clang/lib/Tooling/Execution.cpp
@@ -21,16 +21,7 @@ static llvm::cl::opt<std::string>
llvm::cl::init("standalone"));
void InMemoryToolResults::addResult(StringRef Key, StringRef Value) {
- auto Intern = [&](StringRef &V) {
- auto R = Strings.insert(V);
- if (R.second) { // A new entry, create a new string copy.
- *R.first = StringsPool.save(V);
- }
- V = *R.first;
- };
- Intern(Key);
- Intern(Value);
- KVResults.push_back({Key, Value});
+ KVResults.push_back({Strings.save(Key), Strings.save(Value)});
}
std::vector<std::pair<llvm::StringRef, llvm::StringRef>>
OpenPOWER on IntegriCloud