summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CacheTokens.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-19 03:06:06 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-19 03:06:06 +0000
commit13156b689e67e2857769f96adad141203d844e16 (patch)
treedcb4058a1a9dd9a0466a5d6ee8eacefc8981358d /clang/lib/Frontend/CacheTokens.cpp
parent8e6cf9e5791083103ea711200b8315520c502adb (diff)
downloadbcm5719-llvm-13156b689e67e2857769f96adad141203d844e16.tar.gz
bcm5719-llvm-13156b689e67e2857769f96adad141203d844e16.zip
Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.
llvm-svn: 222306
Diffstat (limited to 'clang/lib/Frontend/CacheTokens.cpp')
-rw-r--r--clang/lib/Frontend/CacheTokens.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp
index 23f22ada7fc..d909d526b51 100644
--- a/clang/lib/Frontend/CacheTokens.cpp
+++ b/clang/lib/Frontend/CacheTokens.cpp
@@ -270,17 +270,17 @@ void PTHWriter::EmitToken(const Token& T) {
StringRef s(T.getLiteralData(), T.getLength());
// Get the string entry.
- llvm::StringMapEntry<OffsetOpt> *E = &CachedStrs.GetOrCreateValue(s);
+ auto &E = *CachedStrs.insert(std::make_pair(s, OffsetOpt())).first;
// If this is a new string entry, bump the PTH offset.
- if (!E->getValue().hasOffset()) {
- E->getValue().setOffset(CurStrOffset);
- StrEntries.push_back(E);
+ if (!E.second.hasOffset()) {
+ E.second.setOffset(CurStrOffset);
+ StrEntries.push_back(&E);
CurStrOffset += s.size() + 1;
}
// Emit the relative offset into the PTH file for the spelling string.
- Emit32(E->getValue().getOffset());
+ Emit32(E.second.getOffset());
}
// Emit the offset into the original source file of this token so that we
OpenPOWER on IntegriCloud