SourceLocation *MacroBegin = nullptr) const;
bool isAtEndOfMacroExpansion(SourceLocation loc,
SourceLocation *MacroEnd = nullptr) const;
-
- StringRef copyString(StringRef str) {
- char *buf = StrAlloc.Allocate<char>(str.size());
- std::memcpy(buf, str.data(), str.size());
- return StringRef(buf, str.size());
- }
};
}
void applyRewrites(EditsReceiver &receiver);
void clearRewrites();
- StringRef copyString(StringRef str) {
- char *buf = StrAlloc.Allocate<char>(str.size());
- std::memcpy(buf, str.data(), str.size());
- return StringRef(buf, str.size());
- }
+ StringRef copyString(StringRef str) { return str.copy(StrAlloc); }
StringRef copyString(const Twine &twine);
private:
data.Kind = Act_Insert;
data.OrigLoc = OrigLoc;
data.Offset = Offs;
- data.Text = copyString(text);
+ data.Text = text.copy(StrAlloc);
data.BeforePrev = beforePreviousInsertions;
CachedEdits.push_back(data);
}