projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release Notes: RegisterScheduler::setDefault removed; by Mehdi Amini
[oota-llvm.git]
/
include
/
llvm
/
TableGen
/
StringToOffsetTable.h
diff --git
a/include/llvm/TableGen/StringToOffsetTable.h
b/include/llvm/TableGen/StringToOffsetTable.h
index a044a3c53f03157dba96e15606d64680f545866b..e3277036dc76a85062975ba201993fc9c67128ee 100644
(file)
--- a/
include/llvm/TableGen/StringToOffsetTable.h
+++ b/
include/llvm/TableGen/StringToOffsetTable.h
@@
-28,16
+28,16
@@
class StringToOffsetTable {
public:
unsigned GetOrAddStringOffset(StringRef Str, bool appendZero = true) {
public:
unsigned GetOrAddStringOffset(StringRef Str, bool appendZero = true) {
- StringMapEntry<unsigned> &Entry = StringOffset.GetOrCreateValue(Str, -1U);
- if (Entry.getValue() == -1U) {
+ auto IterBool =
+ StringOffset.insert(std::make_pair(Str, AggregateString.size()));
+ if (IterBool.second) {
// Add the string to the aggregate if this is the first time found.
// Add the string to the aggregate if this is the first time found.
- Entry.setValue(AggregateString.size());
AggregateString.append(Str.begin(), Str.end());
if (appendZero)
AggregateString += '\0';
}
AggregateString.append(Str.begin(), Str.end());
if (appendZero)
AggregateString += '\0';
}
- return
Entry.getValue()
;
+ return
IterBool.first->second
;
}
void EmitString(raw_ostream &O) {
}
void EmitString(raw_ostream &O) {